Beispiel #1
0
def refresh(_NEXUS):
    ''' should be able to add new scripts on the fly and then call this '''
    unload()
    global grammar
    grammar = Grammar("si/kuli")

    def refresh_sick_command():
        server_proxy.terminate()
        refresh(_NEXUS)

    mapping = {
        "launch sick IDE": Function(launch_IDE),
        "launch sick server": Function(launch_server),
        "refresh sick you Lee": Function(refresh_sick_command),
        "sick shot": Key("cs-2"),
    }

    rule = MergeRule(name="sik", mapping=mapping)
    gfilter.run_on(rule)
    grammar.add_rule(rule)
    grammar.load()
    # start server
    try:
        # if the server is already running, this should go off without a hitch
        start_server_proxy()
    except Exception:
        launch_server()
        seconds5 = 5
        control.nexus().timer.add_callback(server_proxy_timer_fn, seconds5)
Beispiel #2
0
        "interactive search":
        R(Key("a-percent"), rdescript="Emacs: Interactive Search"),
        "go to line <n>":
        R(Key("a-x, %(n)d"), rdescript="Emacs: Go To Line"),
        "prior bracket":
        R(Key("escape:down, c-b, escape:up"),
          rdescript="Emacs: Prior Bracket"),
        "next bracket":
        R(Key("escape:down, c-f, escape:up"), rdescript="Emacs: Next Bracket"),
    }
    extras = [
        Dictation("text"),
        Dictation("mim"),
        IntegerRefST("n", 1, 1000),
    ]
    defaults = {"n": 1, "mim": ""}


#---------------------------------------------------------------------------

context = AppContext(executable="emacs", title="emacs")
grammar = Grammar("emacs", context=context)

if settings.SETTINGS["apps"]["emacs"]:
    if settings.SETTINGS["miscellaneous"]["rdp_mode"]:
        control.nexus().merger.add_global_rule(EmacsRule())
    else:
        rule = EmacsRule(name="emacs")
        gfilter.run_on(rule)
        grammar.add_rule(rule)
        grammar.load()
Beispiel #3
0
        IntegerRefST("monitor", 1, 10)
    ]
    defaults = {
        "n": 1,
        "nnv": 1,
        "text": "",
        "volume_mode": "setsysvolume",
        "enable": -1
    }


# t.join()

grammar = Grammar('general')
main_rule = MainRule()
gfilter.run_on(main_rule)
grammar.add_rule(main_rule)

gfilter.run_on(bring_rule)
grammar.add_rule(bring_rule)

if settings.SETTINGS["feature_rules"]["again"]:
    again_rule = Again(_NEXUS)
    gfilter.run_on(again_rule)
    grammar.add_rule(again_rule)

if settings.SETTINGS["feature_rules"]["alias"]:
    alias_rule = Alias(name="alias")
    gfilter.run_on(alias_rule)
    grammar.add_rule(alias_rule)
Beispiel #4
0
            R(Mouse("right") + Key("down:6/5, right/5, down:5/5, enter"),
              rdescript="Notepad++: Remove Style"),
        "preview in browser":
            R(Key("cas-r"), rdescript="Notepad++: Preview In Browser"),

        # requires function list plug-in:
        "function list":
            R(Key("cas-l"), rdescript="Notepad++: Function List"),
    }
    extras = [
        Dictation("text"),
        IntegerRefST("n", 1, 100),
        IntegerRefST("n2", 1, 10),
    ]
    defaults = {"n": 1}


#---------------------------------------------------------------------------

context = AppContext(executable="notepad++")
grammar = Grammar("Notepad++", context=context)

if settings.SETTINGS["apps"]["notepadplusplus"]:
    if settings.SETTINGS["miscellaneous"]["rdp_mode"]:
        control.nexus().merger.add_global_rule(NPPRule())
    else:
        rule = NPPRule(name="notepad plus plus")
        gfilter.run_on(rule)
        grammar.add_rule(rule)
        grammar.load()
Beispiel #5
0
        }),
        Choice("volume_mode", {
            "mute": "mute",
            "up": "up",
            "down": "down"
        }),
        generate_ccr_choices.__func__(_NEXUS),
        generate_sm_ccr_choices.__func__(_NEXUS),
        IntegerRefST("monitor", 1, 10)
    ]
    defaults = {"n": 1, "nnv": 1, "text": "", "volume_mode": "setsysvolume", "enable": -1}


grammar = Grammar('general')
main_rule = MainRule()
gfilter.run_on(main_rule)
grammar.add_rule(main_rule)

gfilter.run_on(bring_rule)
grammar.add_rule(bring_rule)

if settings.SETTINGS["feature_rules"]["again"]:
    again_rule = Again(_NEXUS)
    gfilter.run_on(again_rule)
    grammar.add_rule(again_rule)

if settings.SETTINGS["feature_rules"]["alias"]:
    alias_rule = Alias(_NEXUS)
    gfilter.run_on(alias_rule)
    grammar.add_rule(alias_rule)
Beispiel #6
0
def hmc_confirm(value, nexus):
    nexus.comm.get_com("hmc").do_action(value)
    
def hmc_settings_complete(nexus):
    nexus.comm.get_com("hmc").complete()
    


class HMCRule(MergeRule):
    mapping = {
        "kill homunculus":              R(Function(kill, nexus=_NEXUS), rdescript="Kill Helper Window"),
        "complete":                     R(Function(complete, nexus=_NEXUS), rdescript="Complete Input")
    }
grammar = Grammar("hmc", context=AppContext(title=settings.HOMUNCULUS_VERSION))
r1 = HMCRule()
gfilter.run_on(r1)
grammar.add_rule(r1)
if settings.SETTINGS["feature_rules"]["hmc"]:
    grammar.load()

class HMCHistoryRule(MergeRule):
    mapping = {
        # specific to macro recorder
        "check <n>":                    R(Function(hmc_checkbox, nexus=_NEXUS), rdescript="Check Checkbox"),
        "check from <n> to <n2>":       R(Function(hmc_recording_check_range, nexus=_NEXUS), rdescript="Check Range"),
        "exclude <n>":                  R(Function(hmc_recording_exclude, nexus=_NEXUS), rdescript="Uncheck Checkbox"),
        "[make] repeatable":            R(Function(hmc_recording_repeatable, nexus=_NEXUS), rdescript="Make Macro Repeatable")
    }   
    extras = [
              IntegerRefST("n", 1, 25),
              IntegerRefST("n2", 1, 25),
Beispiel #7
0
def hmc_settings_complete(nexus):
    nexus.comm.get_com("hmc").complete()


class HMCRule(MergeRule):
    mapping = {
        "kill homunculus":
            R(Function(kill, nexus=_NEXUS), rdescript="Kill Helper Window"),
        "complete":
            R(Function(complete, nexus=_NEXUS), rdescript="Complete Input")
    }


grammar = Grammar("hmc", context=AppContext(title=settings.HOMUNCULUS_VERSION))
r1 = HMCRule()
gfilter.run_on(r1)
grammar.add_rule(r1)
if settings.SETTINGS["feature_rules"]["hmc"]:
    grammar.load()


class HMCHistoryRule(MergeRule):
    mapping = {
        # specific to macro recorder
        "check <n>":
            R(Function(hmc_checkbox, nexus=_NEXUS), rdescript="Check Checkbox"),
        "check from <n> to <n2>":
            R(Function(hmc_recording_check_range, nexus=_NEXUS), rdescript="Check Range"),
        "exclude <n>":
            R(Function(hmc_recording_exclude, nexus=_NEXUS),
              rdescript="Uncheck Checkbox"),
Beispiel #8
0
        R(Key('s-f3'), rdescript="Sync Dirs: view right"),
        "remove selection":
        R(Key('c-m'), rdescript="Sync Dirs: remove selection"),
        "synchronize":
        R(Key('a-c'), rdescript="Total Commander: synchronize button"),
    }


context = AppContext(executable="totalcmd") | AppContext(
    executable="totalcmd64")
grammar = Grammar("Total Commander", context=context)
syncdir_context = AppContext(executable="totalcmd",
                             title='Synchronize directories')
syncdir_context |= AppContext(executable="totalcmd64",
                              title='Synchronize directories')
syncdir_grammar = Grammar("Total Commander Sync Dirs", context=syncdir_context)

if settings.SETTINGS["apps"]["totalcmd"]:
    if settings.SETTINGS["miscellaneous"]["rdp_mode"]:
        control.nexus().merger.add_global_rule(SyncDirsRule())
        control.nexus().merger.add_global_rule(TotalCommanderRule())
    else:
        syncdir_rule = SyncDirsRule(name="totalcmd sync dirs")
        gfilter.run_on(syncdir_rule)
        syncdir_grammar.add_rule(syncdir_rule)
        syncdir_grammar.load()
        rule = TotalCommanderRule(name="totalcmd")
        gfilter.run_on(rule)
        grammar.add_rule(rule)
        grammar.load()
Beispiel #9
0
        "view right":
            R(Key('s-f3'),
              rdescript="Sync Dirs: view right"),
        "remove selection":
            R(Key('c-m'),
              rdescript="Sync Dirs: remove selection"),
        "synchronize":
            R(Key('a-c'),
              rdescript="Total Commander: synchronize button"),
    }

context = AppContext(executable="totalcmd") | AppContext(executable="totalcmd64")
grammar = Grammar("Total Commander", context=context)
syncdir_context = AppContext(executable="totalcmd", title='Synchronize directories') 
syncdir_context |= AppContext(executable="totalcmd64", title='Synchronize directories')
syncdir_grammar = Grammar("Total Commander Sync Dirs", context=syncdir_context)

if settings.SETTINGS["apps"]["totalcmd"]:
    if settings.SETTINGS["miscellaneous"]["rdp_mode"]:
       control.nexus().merger.add_global_rule(SyncDirsRule())
       control.nexus().merger.add_global_rule(TotalCommanderRule())
    else:
        syncdir_rule = SyncDirsRule(name="totalcmd sync dirs")
        gfilter.run_on(syncdir_rule)
        syncdir_grammar.add_rule(syncdir_rule)
        syncdir_grammar.load()
        rule = TotalCommanderRule(name="totalcmd")
        gfilter.run_on(rule)
        grammar.add_rule(rule)
        grammar.load()