def savesettingsandreload(self, sender, args): """Callback method for saving pyRevit settings and reloading """ self.savesettings(sender, args) from pyrevit.loader.sessionmgr import execute_command execute_command(PYREVIT_CORE_RELOAD_COMMAND_NAME)
def _reload(self): from pyrevit.loader.sessionmgr import execute_command execute_command(pyrevitcore_globals.PYREVIT_CORE_RELOAD_COMMAND_NAME)
def _reload(self): from pyrevit.loader.sessionmgr import execute_command #pylint: disable=import-outside-toplevel execute_command(pyrevitcore_globals.PYREVIT_CORE_RELOAD_COMMAND_NAME)
def call_reload(): from pyrevit.loader.sessionmgr import execute_command execute_command(PYREVIT_CORE_RELOAD_COMMAND_NAME)
if __name__ == '__main__': # collect a list of all repos to be updates if _check_connection(): pyrevit_repo = updater.get_pyrevit_repo() thirdparty_repos = updater.get_thirdparty_ext_repos() logger.debug('List of thirdparty repos to be updated: {}'.format( thirdparty_repos)) for thirdparty_repo_info in thirdparty_repos: _update_repo(thirdparty_repo_info) if not updater.has_core_updates(): _update_repo(pyrevit_repo) # perform upgrade tasks logger.info('Upgrading settings...') upgrade.upgrade_existing_pyrevit() # Call pyRevit reload command to reload pyRevit # The reason to call the command instead of using sessionmgr module # to realod is that the repo has been just updatedm so all # modules need to be re-imported again in a clean engine. from pyrevit.loader.sessionmgr import execute_command execute_command(PYREVIT_CORE_RELOAD_COMMAND_NAME) else: output = script.get_output() output.print_html(COREUPDATE_MESSAGE.format(home=HOME_DIR)) logger.debug('Core updates. Skippin update and reload.') else: logger.warning('No internet access detected. Skipping update.')
import revitron import rpm if not revitron.Document().isFamily(): rpm.Update.extensions() # Call pyRevit reload command to reload pyRevit # The reason to call the command instead of using sessionmgr module # to realod is that the repo has been just updatedm so all # modules need to be re-imported again in a clean engine. from pyrevit.loader.sessionmgr import execute_command execute_command('pyrevitcore-pyrevit-pyrevit-tools-reload')
from pyrevit.loader.sessionmgr import execute_command __context__ = 'zerodoc' commandlist = \ ["pyRevitDevToolspyRevitDevDebugUnitTestsTestRPW", "pyRevitToolspyRevitSelectionselectSelectListSelectionasClickableLinks"] for cmd in commandlist: for i in range(5): execute_command(cmd)
"""Test opening multiple output windows.""" #pylint: disable=import-error,line-too-long from pyrevit.loader import sessionmgr __context__ = 'zero-doc' for cmd in [ "pyrevitdevtools-pyrevitdev-debug-misctests-testrpw", "pyrevittools-pyrevit-selection-select-select-listselectionasclickablelinks" ]: for i in range(5): sessionmgr.execute_command(cmd)