Ejemplo n.º 1
0
def load():
    import sys
    from enso.contrib.scriptotron.ensoapi import EnsoApi
    sys.path.append(EnsoApi().get_enso_commands_folder())

    ScriptTracker.install( EventManager.get(),
                           CommandManager.get() )
Ejemplo n.º 2
0
def post_enso_commands_write_category(value):
    category_file = os.path.join(config.ENSO_USER_DIR, "commands",
                                 value + ".py")

    with open(category_file, "wb") as cat:
        cat.write(request.form["code"].encode("utf-8"))

    ScriptTracker.get().setPendingChanges()

    return ""
Ejemplo n.º 3
0
def cmd_enso(ensoapi, action):
    """ Enso system command
    <b>Actions:</b><br>
    &nbsp;&nbsp- quit - quit Enso<br>
    &nbsp;&nbsp- restart - restart Enso<br>
    &nbsp;&nbsp- refresh - reload shortcuts available for the 'open' command<br>
    &nbsp;&nbsp- settings - open Enso settings page<br>
    &nbsp;&nbsp- commands - open Enso command list<br>
    &nbsp;&nbsp- tasks - open Enso task editor<br>
    &nbsp;&nbsp- editor - open Enso command editor<br>
    &nbsp;&nbsp- 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)
Ejemplo n.º 4
0
def load():
    ScriptTracker.install(EventManager.get(), CommandManager.get())
Ejemplo n.º 5
0
def load():
    sys.path.append(EnsoApi().get_enso_commands_folder())

    ScriptTracker.install(EventManager.get(), CommandManager.get())
Ejemplo n.º 6
0
def load():
    import sys
    from enso.contrib.scriptotron.ensoapi import EnsoApi
    sys.path.append(EnsoApi().get_enso_commands_folder())

    ScriptTracker.install(EventManager.get(), CommandManager.get())
Ejemplo n.º 7
0
def load():
    ScriptTracker.install( EventManager.get(),
                           CommandManager.get() )
Ejemplo n.º 8
0
def load():
    sys.path.append(EnsoApi().get_enso_commands_folder())

    ScriptTracker.install( EventManager.get(),
                           CommandManager.get() )