def tray_on_enso_restart(systray, get_state = False): if not get_state: if not retreat.is_locked(): subprocess.Popen([config.ENSO_EXECUTABLE, "--restart " + str(os.getpid())]) tray_on_enso_quit(systray) else: displayMessage(config.BLOCKED_BY_RETREAT_MSG)
def tray_on_enso_restart(systray, get_state=False): if not get_state: if not retreat.is_locked(): subprocess.Popen( [config.ENSO_EXECUTABLE, "--restart " + str(os.getpid())]) tray_on_enso_quit(systray) else: displayMessage(config.BLOCKED_BY_RETREAT_MSG)
def cmd_enso(ensoapi, action): """ Enso system command <b>Actions:</b><br>  - quit - quit Enso<br>  - restart - restart Enso<br>  - refresh - reload shortcuts available for the 'open' command<br>  - settings - open Enso settings page<br>  - commands - open Enso command list<br>  - tasks - open Enso task editor<br>  - editor - open Enso command editor<br>  - about - show application information<br> """ if action == 'quit': if not retreat.is_locked(): EventManager.get().stop() else: displayMessage(config.BLOCKED_BY_RETREAT_MSG) elif action == 'restart': if not retreat.is_locked(): EventManager.get().stop() subprocess.Popen( [config.ENSO_EXECUTABLE, "--restart " + str(os.getpid())]) else: displayMessage(config.BLOCKED_BY_RETREAT_MSG) elif action == 'refresh': Shortcuts.get().refreshShortcuts() ScriptTracker.get()._reloadPyScripts() displayMessage(config.REFRESHING_MSG_XML) elif action == 'settings': if config.ENABLE_WEB_UI: os.startfile("http://" + webui.HOST + ":" + str(webui.PORT) + "/options.html") elif action == 'commands': if config.ENABLE_WEB_UI: os.startfile("http://" + webui.HOST + ":" + str(webui.PORT) + "/commands.html") elif action == 'tasks': if config.ENABLE_WEB_UI: os.startfile("http://" + webui.HOST + ":" + str(webui.PORT) + "/tasks.html") elif action == 'editor': if config.ENABLE_WEB_UI: os.startfile("http://" + webui.HOST + ":" + str(webui.PORT) + "/edit.html") elif action == 'about': displayMessage(enso.config.ABOUT_BOX_XML)
def cmd_enso(ensoapi, action): """ Enso system command <b>Actions:</b><br>  - quit - quit Enso<br>  - restart - restart Enso<br>  - settings - open Enso settings page<br>  - commands - open Enso command list<br>  - task - open Enso task editor<br>  - editor - open Enso command editor<br>  - about - show application information<br> """ if action == 'quit': if not retreat.is_locked(): EventManager.get().stop() else: displayMessage(config.BLOCKED_BY_RETREAT_MSG) elif action == 'restart': if not retreat.is_locked(): EventManager.get().stop() subprocess.Popen([config.ENSO_EXECUTABLE, "--restart " + str(os.getpid())]) else: displayMessage(config.BLOCKED_BY_RETREAT_MSG) elif action == 'settings': if config.ENABLE_WEB_UI: os.startfile("http://" + webui.HOST + ":" + str(webui.PORT) + "/options.html") elif action == 'commands': if config.ENABLE_WEB_UI: os.startfile("http://" + webui.HOST + ":" + str(webui.PORT) + "/commands.html") elif action == 'tasks': if config.ENABLE_WEB_UI: os.startfile("http://" + webui.HOST + ":" + str(webui.PORT) + "/tasks.html") elif action == 'editor': if config.ENABLE_WEB_UI: os.startfile("http://" + webui.HOST + ":" + str(webui.PORT) + "/edit.html") elif action == 'about': displayMessage(enso.config.ABOUT_BOX_XML)
def tray_on_enso_quit(systray): if not retreat.is_locked(): EventManager.get().stop() else: displayMessage(config.BLOCKED_BY_RETREAT_MSG)