Exemplo n.º 1
0
 def test_mcontext(self):
     python = Python()
     eclipse = EclipseCCR(mcontext=AppContext(executable='test'))
     self.assertIsNone(python.get_context())
     self.assertIsNotNone(eclipse.get_context())
Exemplo n.º 2
0
            "nrw", {
                "first": 1,
                "second": 2,
                "third": 3,
                "fourth": 4,
                "fifth": 5,
                "sixth": 6,
                "seventh": 7,
                "eighth": 8,
                "(ninth | last)": 9,
            }),
    ]
    defaults = {
        "n": 1,
        "mim": "",
    }


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

context = AppContext(executable="atom", title="Atom")
grammar = Grammar("Atom", context=context)
if settings.SETTINGS["apps"]["atom"]:
    if settings.SETTINGS["miscellaneous"]["rdp_mode"]:
        control.nexus().merger.add_global_rule(AtomRule())
    else:
        rule = AtomRule()
        gfilter.run_on(rule)
        grammar.add_rule(AtomRule(name="atom"))
        grammar.load()
Exemplo n.º 3
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()
Exemplo n.º 4
0
                                                          rdescript="Eclipse: Go To Line"),
            "shackle <n> [<back>]":                     R(Key("c-l")+Key("right, cs-left")+ \
                                                          Function(ec_con.lines_relative), rdescript="Eclipse: Select Relative Lines"),

        }
    extras = [
        Dictation("text"),
        IntegerRefST("n", 1, 1000),
        Boolean("back"),
    ]
    defaults = {"n": 1, "back": False}


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

context = AppContext(executable="javaw", title="Eclipse") | AppContext(
    executable="eclipse",
    title="Eclipse") | AppContext(executable="AptanaStudio3")
grammar = Grammar("Eclipse", context=context)

if settings.SETTINGS["apps"]["eclipse"]:
    #     if settings.SETTINGS["miscellaneous"]["rdp_mode"]:
    #         control.nexus().merger.add_global_rule(EclipseRule())
    #         control.nexus().merger.add_global_rule(EclipseCCR())
    #     else:
    #         control.nexus().merger.add_app_rule(EclipseCCR(), context)

    rule = EclipseRule(name="eclipse")
    gfilter.run_on(rule)
    ccr = EclipseCCR()
    gfilter.run_on(ccr)
Exemplo n.º 5
0
        R(Key("a-f, w, t"), rdescript="Explorer: New File"),
        "(show | file | folder) properties":
        R(Key("a-enter"), rdescript="Explorer: Properties Dialog"),
        "get up":
        R(Key("a-up"), rdescript="Explorer: Navigate up"),
        "get back":
        R(Key("a-left"), rdescript="Explorer: Navigate back"),
        "get forward":
        R(Key("a-right"), rdescript="Explorer: Navigate forward"),
    }
    extras = [
        Dictation("text"),
        IntegerRefST("n", 1, 1000),
    ]
    defaults = {"n": 1}


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

context = AppContext(executable="explorer")
grammar = Grammar("Windows Explorer", context=context)

if settings.SETTINGS["apps"]["explorer"]:
    if settings.SETTINGS["miscellaneous"]["rdp_mode"]:
        control.nexus().merger.add_global_rule(IERule())
    else:
        rule = IERule(name="explorer")
        gfilter.run_on(rule)
        grammar.add_rule(rule)
        grammar.load()
Exemplo n.º 6
0
        Choice("cols", {
            "one": "1",
            "two": "2",
            "three": "3",
            "grid": "5",
        }),
        Choice("panel", {
            "one": "1",
            "left": "1",
            "two": "2",
            "right": "2",
            }),
    ]
    defaults = {
        "n12": "",
        "n2": 1,
        "n3": 1,
    }


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

context = AppContext(executable="sublime_text", title="Sublime Text")
grammar = Grammar("Sublime", context=context)

if settings.SETTINGS["apps"]["sublime"]:
    rule = SublimeRule(name="sublime")
    gfilter.run_on(rule)
    grammar.add_rule(rule)
    grammar.load()
Exemplo n.º 7
0
        R(Key("c-enter"), rdescript="RStudio: Run Line"),
        "run document":
        R(Key("ac-r"), rdescript="RStudio: Run Document"),
        "comment (line | selected)":
        R(Key("cs-c"), rdescript="RStudio: Comment Line"),
        "knit (document | file)":
        R(Key("cs-k")),
        "next plot":
        R(Key("ac-f12"), rdescript="RStudio: Next Plot"),
        "previous plot":
        R(Key("ac-f11"), rdescript="RStudio: Previous Plot"),
        "help":
        R(Key("c-c, c-2, question, c-v, enter, c-1")),
    }
    extras = [
        IntegerRefST("n", 1, 10000),
    ]
    defaults = {}


context = AppContext(executable="rstudio")
grammar = Grammar("RStudio", context=context)
if settings.SETTINGS["apps"]["rstudio"]:
    if settings.SETTINGS["miscellaneous"]["rdp_mode"]:
        control.nexus().merger.add_global_rule(RStudioRule())
    else:
        rule = RStudioRule()
        gfilter.run_on(rule)
        grammar.add_rule(RStudioRule(name="rstudio"))
        grammar.load()
Exemplo n.º 8
0
        "step over [<n>]":
            R(Key("f10/50")*Repeat(extra="n"), rdescript="SSMS: Step Over"),
        "step into":
            R(Key("f11"), rdescript="SSMS: Step Into"),
        "step out [of]":
            R(Key("s-f11"), rdescript="SSMS: Step Out"),
        "resume":
            R(Key("f5"), rdescript="SSMS: Resume"),
    }
    extras = [
        Dictation("text"),
        Dictation("mim"),
        IntegerRefST("n", 1, 1000),
    ]
    defaults = {"n": 1, "mim": ""}


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

context = AppContext(executable="ssms")
grammar = Grammar("SQL Server Management Studio", context=context)

if settings.SETTINGS["apps"]["ssms"]:
    if settings.SETTINGS["miscellaneous"]["rdp_mode"]:
        control.nexus().merger.add_global_rule(SSMSRule())
    else:
        rule = SSMSRule(name="ssms")
        gfilter.run_on(rule)
        grammar.add_rule(rule)
        grammar.load()
Exemplo n.º 9
0
        Choice(
            "color", {
                "red": 0,
                "(orange | tan | brown)": 1,
                "yellow": 2,
                "green": 3,
                "blue": 4,
                "purple": 5
            }),
        Choice("action", {
            "kick": 0,
            "psychic": 1,
        }),
        IntegerRefST("n", 0, 100),
    ]
    defaults = {
        "pre": 0,
        "action": -1,
    }


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

context = AppContext(title="rainbowgrid")
grammar = Grammar("rainbowgrid", context=context)
if settings.SETTINGS["apps"]["rainbow"]:
    rule = GridControlRule(name="rainbow")
    gfilter.run_on(rule)
    grammar.add_rule(rule)
    grammar.load()
Exemplo n.º 10
0
        "(show | hide) hidden": R(Key("c-dot")),
        "sort [by] name": R(Key("c-f1")),
        "sort [by] size": R(Key("c-f2")),
        "sort [by] (modified | date)": R(Key("c-f3")),
        "(stoosh | copy) path": R(Key("f11")),
        "terminal": R(Key("f9")),
        "command pallette": R(Key("cs-p")),
    }

    extras = [
        IntegerRefST("num", 1, 4),
        Choice("fav", {
            "example favourite": "ef",
        }),
    ]
    defaults = {
        "num": 1,
    }


context = AppContext(executable="fman", title="fman")
grammar = Grammar("fman", context=context)
if settings.SETTINGS["apps"]["fman"]:
    if settings.SETTINGS["miscellaneous"]["rdp_mode"]:
        control.nexus().merger.add_global_rule(fmanRule())
    else:
        rule = fmanRule()
        gfilter.run_on(rule)
        grammar.add_rule(fmanRule(name="fman"))
        grammar.load()
Exemplo n.º 11
0
from caster.lib.dfplus.merge.mergerule import MergeRule
from caster.lib.dfplus.state.short import R


class MSWordRule(MergeRule):
    pronunciation = "Microsoft Word"

    mapping = {
        "insert image": R(Key("alt, n, p"), rdescript="Word: Insert Image"),
    }
    extras = [
        Dictation("dict"),
        IntegerRefST("n", 1, 100),
    ]
    defaults = {"n": 1, "dict": "nothing"}


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

context = AppContext(executable="winword")
grammar = Grammar("Microsoft Word", context=context)

if settings.SETTINGS["apps"]["winword"]:
    if settings.SETTINGS["miscellaneous"]["rdp_mode"]:
        control.nexus().merger.add_global_rule(MSWordRule())
    else:
        rule = MSWordRule(name="microsoft word")
        gfilter.run_on(rule)
        grammar.add_rule(rule)
        grammar.load()
Exemplo n.º 12
0
        "compare files":
        R(Key('c-f3'), rdescript="Sync Dirs: compare right and left"),
        "copy left":
        R(Key('c-l'), rdescript="Sync Dirs: select for copying left"),
        "copy right":
        R(Key('c-r'), rdescript="Sync Dirs: select for copying right"),
        "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)
Exemplo n.º 13
0
    mapping = {
        "<n> [by] <n2> [<action>]":
        R(Function(send_input, nexus=_NEXUS),
          rdescript="Douglas Grid: Action"),
        "exit | escape | cancel":
        R(Function(kill, nexus=_NEXUS), rdescript="Exit Douglas Grid"),
    }
    extras = [
        IntegerRefST("n", 0, 300),
        IntegerRefST("n2", 0, 300),
        Choice("action", {
            "kick": 0,
            "psychic": 1,
        }),
    ]
    defaults = {
        "action": -1,
    }


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

context = AppContext(title="douglasgrid")
grammar = Grammar("douglasgrid", context=context)

if settings.SETTINGS["apps"]["douglas"]:
    rule = GridControlRule(name="Douglas")
    gfilter.run_on(rule)
    grammar.add_rule(rule)
    grammar.load()
Exemplo n.º 14
0
                "(AMS gathered environment | AMS gather)": "g",
                "(AMS multline [environment]| multiline)": "m",
                "array [environment]": "y",
                "(cases [environment] | piecewise)": "c",
                "(aligned [environment] | align)": "l",
                "aligned at [environment]": "v",
                "gathered [environment]": "h",
                "split [environment]": "s",
                "delimiters": "r",
                "matrix": "x",
                "macro": "o",
            }),
    ]
    defaults = {
        "n": 1,
    }


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

context = AppContext(executable="lyx")
grammar = Grammar("lyx", context=context)

if settings.SETTINGS["apps"]["lyx"]:
    if settings.SETTINGS["miscellaneous"]["rdp_mode"]:
        control.nexus().merger.add_global_rule(LyxRule())
    else:
        rule = LyxRule(name="lyx")
        gfilter.run_on(rule)
        grammar.add_rule(rule)
        grammar.load()
Exemplo n.º 15
0
        "developer tools":              R(Key("f12"), rdescript="Browser: Developer Tools"),
        "view [page] source":           R(Key("c-u"), rdescript="Browser: View Page Source"),
        "resume":                       R(Key("f8"), rdescript="Browser: Resume"),
        "step over":                    R(Key("f10"), rdescript="Browser: Step Over"),
        "step into":                    R(Key("f11"), rdescript="Browser: Step Into"),
        "step out":                     R(Key("s-f11"), rdescript="Browser: Step Out"),

        "IRC identify":                 R(Text("/msg NickServ identify PASSWORD"), rdescript="IRC Chat Channel Identify"),
        }
    extras = [
        Dictation("dict"),
        IntegerRefST("n", 1, 10),
    ]
    defaults = {"n": 1, "dict": "nothing"}


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

context = AppContext(executable="chrome")
grammar = Grammar("chrome", context=context)

if settings.SETTINGS["apps"]["chrome"]:
    if settings.SETTINGS["miscellaneous"]["rdp_mode"]:
        control.nexus().merger.add_global_rule(ChromeRule())
    else:
        rule = ChromeRule(name="chrome")
        gfilter.run_on(rule)
        grammar.add_rule(rule)
        grammar.load()
Exemplo n.º 16
0
        "step over [<n>]":
        R(Key("f10/50") * Repeat(extra="n"),
          rdescript="Visual Studio Code:Step Over"),
        "step into":
        R(Key("f11"), rdescript="Visual Studio Code:Step Into"),
        "step out [of]":
        R(Key("s-f11"), rdescript="Visual Studio Code:Step Out"),
        "resume":
        R(Key("f5"), rdescript="Visual Studio Code:Resume"),
    }
    extras = [
        Dictation("text"),
        Dictation("mim"),
        IntegerRefST("n", 1, 1000),
    ]
    defaults = {"n": 1, "mim": "", "text": ""}


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

context = AppContext(executable="code")
grammar = Grammar("Visual Studio Code", context=context)
if settings.SETTINGS["apps"]["visualstudiocode"]:
    if settings.SETTINGS["miscellaneous"]["rdp_mode"]:
        control.nexus().merger.add_global_rule(VisualStudioCodeRule())
    else:
        rule = VisualStudioCodeRule(name="visualstudiocode")
        gfilter.run_on(rule)
        grammar.add_rule(rule)
        grammar.load()
Exemplo n.º 17
0
        R(Text("@"), rdescript="Gitter: Mention"),
        "insert link":
        R(Text("[]()") + Key("left:3"), rdescript="Gitter: Insert Link"),
        "insert image":
        R(Text("![]()") + Key("left:3"), rdescript="Gitter: Insert Image"),
        "insert code":
        R(Text("``") + Key("left"), rdescript="Gitter: Insert Code"),
        "formatted code":
        R(Text("```") + Key("s-enter"), rdescript="Gitter: Formatted Code"),
    }
    extras = [
        Dictation("text"),
    ]
    Defaults = {}


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

context = AppContext(executable="gitter")
grammar = Grammar("gitter", context=context)

if settings.SETTINGS["apps"]["gitter"]:
    if settings.SETTINGS["miscellaneous"]["rdp_mode"]:
        control.nexus().merger.add_global_rule(GitterRule())
        print("added Gitter")
    else:
        rule = GitterRule(name="gitter")
        gfilter.run_on(rule)
        grammar.add_rule(rule)
        grammar.load()
Exemplo n.º 18
0
        R(Key("f9"), rdescript="MSVC: Breakpoint"),
        "format code":
        R(Key("cs-f"), rdescript="MSVC: Format Code"),
        "(do imports | import all)":
        R(Key("cs-o"), rdescript="MSVC: Do Imports"),
        "comment line":
        R(Key("c-slash"), rdescript="MSVC: Comment Line"),
        "go to line":
        R(Key("c-g"), rdescript="MSVC: Go To Line"),
    }
    extras = [
        Dictation("text"),
        IntegerRefST("n", 1, 1000),
    ]
    defaults = {"n": 1}


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

context = AppContext(executable="WDExpress")
grammar = Grammar("WDExpress", context=context)

if settings.SETTINGS["apps"]["msvc"]:
    if settings.SETTINGS["miscellaneous"]["rdp_mode"]:
        control.nexus().merger.add_global_rule(MSVCRule())
    else:
        rule = MSVCRule(name="M S V C")
        gfilter.run_on(rule)
        grammar.add_rule(rule)
        grammar.load()
Exemplo n.º 19
0
        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()
Exemplo n.º 20
0
    mapping = {
        "[go to] line <n>":
        R(Key("c-g") + Pause("50") + Text("%(n)d") + Key("enter"),
          rdescript="FlashDevelop: Go To Line"),
    }
    extras = [
        Dictation("text"),
        IntegerRefST("n", 1, 1000),
    ]
    defaults = {"n": 1}


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

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

if settings.SETTINGS["apps"]["flashdevelop"]:
    if settings.SETTINGS["miscellaneous"]["rdp_mode"]:
        control.nexus().merger.add_global_rule(FlashDevelopRule())
        control.nexus().merger.add_global_rule(FlashDevelopCCR())
    else:
        control.nexus().merger.add_app_rule(
            FlashDevelopCCR(name="FlashDevelop"), context)

        rule = FlashDevelopRule()
        gfilter.run_on(rule)
        grammar.add_rule(rule)
        grammar.load()
Exemplo n.º 21
0
            "two": "2",
            "three": "3",
            "grid": "5",
        }),
        Choice("panel", {
            "one": "1",
            "left": "1",
            "two": "2",
            "right": "2",
        }),
    ]
    defaults = {
        "n2": 1,
        "n3": 1,
    }


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

context = AppContext(executable="sublime_text")
grammar = Grammar("Sublime", context=context)

if settings.SETTINGS["apps"]["sublime"]:
    if settings.SETTINGS["miscellaneous"]["rdp_mode"]:
        control.nexus().merger.add_global_rule(SublimeRule())
    else:
        rule = SublimeRule(name="sublime")
        gfilter.run_on(rule)
        grammar.add_rule(rule)
        grammar.load()
Exemplo n.º 22
0
        "step over":
        R(Key("f10"), rdescript="Browser: Step Over"),
        "step into":
        R(Key("f11"), rdescript="Browser: Step Into"),
        "step out":
        R(Key("s-f11"), rdescript="Browser: Step Out"),
        "IRC identify":
        R(Text("/msg NickServ identify PASSWORD"),
          rdescript="IRC Chat Channel Identify"),
    }
    extras = [
        Dictation("dict"),
        IntegerRefST("n", 1, 100),
    ]
    defaults = {"n": 1, "dict": "nothing"}


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

context = AppContext(executable="firefox")
grammar = Grammar("firefox", context=context)

if settings.SETTINGS["apps"]["firefox"]:
    if settings.SETTINGS["miscellaneous"]["rdp_mode"]:
        control.nexus().merger.add_global_rule(FirefoxRule())
    else:
        rule = FirefoxRule(name="firefox")
        gfilter.run_on(rule)
        grammar.add_rule(rule)
        grammar.load()
Exemplo n.º 23
0
class CMDRule(MergeRule):
    pronunciation = "command prompt"

    mapping = {
        "C drive": R(Text(r"cd C:/") + Key("enter"), rdescript="CMD: Go To C:"),
        "CD up": R(Text("cd ..") + Key("enter"), rdescript="CMD: Up Directory"),
        "CD": R(Text("cd "), rdescript="CMD: Navigate Directory"),
        "list": R(Text("dir") + Key("enter"), rdescript="CMD: List Files"),
        "make directory": R(Text("mkdir "), rdescript="CMD: Make directory"),
        "exit": R(Text("exit") + Key("enter"), rdescript="CMD: Exit"),
    }
    extras = []
    defaults = {}


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

context = AppContext(executable="cmd")
grammar = Grammar("cmd", context=context)

if settings.SETTINGS["apps"]["cmd"]:
    if settings.SETTINGS["miscellaneous"]["rdp_mode"]:
        control.nexus().merger.add_global_rule(CMDRule())
        print("added CMD")
    else:
        rule = CMDRule(name="command prompt")
        gfilter.run_on(rule)
        grammar.add_rule(rule)
        grammar.load()
Exemplo n.º 24
0
        R(Key("c-tab"), rdescript="Foxit Reader: Next Tab") *
        Repeat(extra="n"),
        "prior tab [<n>]":
        R(Key("cs-tab"), rdescript="Foxit Reader: Previous Tab") *
        Repeat(extra="n"),
        "close tab [<n>]":
        R(Key("c-f4/20"), rdescript="Foxit Reader: Close Tab") *
        Repeat(extra="n"),
    }
    extras = [
        Dictation("text"),
        Dictation("mim"),
        IntegerRefST("n", 1, 1000),
    ]
    defaults = {"n": 1, "mim": ""}


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

context = AppContext(executable="Foxit Reader")
grammar = Grammar("Foxit Reader", context=context)

if settings.SETTINGS["apps"]["foxitreader"]:
    if settings.SETTINGS["miscellaneous"]["rdp_mode"]:
        control.nexus().merger.add_global_rule(FoxitRule())
    else:
        rule = FoxitRule(name="Foxit Reader")
        gfilter.run_on(rule)
        grammar.add_rule(rule)
        grammar.load()
Exemplo n.º 25
0
            R(Key("s-f6"), rdescript="Jet Brains: Refactor rename"),
        "go to declaration":
            R(Key("c-b"), rdescript="Jet Brains: Go to declaration"),
        "smart kraken": #kraken is Caster default for control space
            R(Key("cs-space"), rdescript="Jet Brains: Smart completion"),
    }
    extras = [
        Dictation("text"),
        Dictation("mim"),
        IntegerRefST("n", 1, 1000),
    ]
    defaults = {"n": 1, "mim": ""}


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

context = AppContext(executable="idea", title="IntelliJ") \
          | AppContext(executable="idea64", title="IntelliJ") \
          | AppContext(executable="studio64") \
          | AppContext(executable="pycharm")
grammar = Grammar("IntelliJ + Android Studio + PyCharm", context=context)

if settings.SETTINGS["apps"]["jetbrains"]:
    if settings.SETTINGS["miscellaneous"]["rdp_mode"]:
        control.nexus().merger.add_global_rule(JetbrainsRule())
    else:
        rule = JetbrainsRule(name="jet brains")
        gfilter.run_on(rule)
        grammar.add_rule(rule)
        grammar.load()
Exemplo n.º 26
0
        "compare (files | versions)":
        R(Key("a-f, r, h"), rdescript="Visual Studio: Compare..."),
        "undo (checkout | pending changes)":
        R(Key("a-f, r, u"), rdescript="Visual Studio: Undo Pending Changes"),
        "[open] [go to] work item":
        R(Key("a-m, g"), rdescript="Visual Studio: Open Work Item"),
        "[add] [new] linked work item":
        R(Key("sa-l"), rdescript="Visual Studio: New Linked Work Item"),
    }
    extras = [
        Dictation("text"),
        Dictation("mim"),
        IntegerRefST("n", 1, 1000),
    ]
    defaults = {"n": 1, "mim": ""}


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

context = AppContext(executable="devenv")
grammar = Grammar("Visual Studio", context=context)

if settings.SETTINGS["apps"]["visualstudio"]:
    if settings.SETTINGS["miscellaneous"]["rdp_mode"]:
        control.nexus().merger.add_global_rule(VisualStudioRule())
    else:
        rule = VisualStudioRule(name="visualstudio")
        gfilter.run_on(rule)
        grammar.add_rule(rule)
        grammar.load()
Exemplo n.º 27
0
        "explorer": R(Key("cs-f")),
        "edit": R(Key("cs-a")),
        "new branch": R(Key("cs-n")),
        "rename branch": R(Key("cs-r")),
        "delete branch": R(Key("cs-d")),
        "update from master": R(Key("cs-u")),
        "compare to [branch]": R(Key("cs-b")),
        "merge into current [branch]": R(Key("cs-m")),
        "compare on github": R(Key("cs-c")),
        "create pull request": R(Key("c-r")),
    }
    extras = [
        IntegerRefST("n", 1, 10),
    ]
    defaults = {"n": 1}


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

context = AppContext(executable="GitHubDesktop")
grammar = Grammar("GitHubDesktop", context=context)

if settings.SETTINGS["apps"]["github"]:
    if settings.SETTINGS["miscellaneous"]["rdp_mode"]:
        control.nexus().merger.add_global_rule(GitHubRule())
    else:
        rule = GitHubRule(name="GitHubDesktop")
        gfilter.run_on(rule)
        grammar.add_rule(rule)
        grammar.load()
Exemplo n.º 28
0

class SQLDeveloperRule(MergeRule):
    pronunciation = "sequel developer"

    mapping = {
        "run this query": R(Key("f9"), rdescript="SQL Dev: Run Query"),
        "format code": R(Key("c-f7"), rdescript="SQL Dev: Format Code"),
        "comment line": R(Key("c-slash"), rdescript="SQL Dev: Comment Line"),
    }
    extras = [
        Dictation("text"),
        IntegerRefST("n", 1, 1000),
    ]
    defaults = {"n": 1}


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

context = AppContext(executable="sqldeveloper64W", title="SQL Developer")
grammar = Grammar("Sql Developer", context=context)

if settings.SETTINGS["apps"]["sqldeveloper"]:
    if settings.SETTINGS["miscellaneous"]["rdp_mode"]:
        control.nexus().merger.add_global_rule(SQLDeveloperRule())
    else:
        rule = SQLDeveloperRule(name="sql developer")
        gfilter.run_on(rule)
        grammar.add_rule(rule)
        grammar.load()
Exemplo n.º 29
0
          rdescript="GREP: Search Recursive Count"),
        "search recursive filetype":
        R(Text("find . -name \"*.java\" -exec grep -rinH \"PATTERN\" {} \\;"),
          rdescript="GREP: Search Recursive Filetype"),
        "to file":
        R(Text(" > FILENAME"), rdescript="Bash: To File"),
    }
    extras = [
        IntegerRefST("n", 1, 10000),
    ]
    defaults = {"n": 0}


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

context = AppContext(executable="\\sh.exe")
context2 = AppContext(executable="\\bash.exe")
context3 = AppContext(executable="\\cmd.exe")
context4 = AppContext(executable="\\mintty.exe")

grammar = Grammar("MINGW32",
                  context=(context | context2 | context3 | context4))

if settings.SETTINGS["apps"]["gitbash"]:
    if settings.SETTINGS["miscellaneous"]["rdp_mode"]:
        control.nexus().merger.add_global_rule(GitBashRule())
    else:
        rule = GitBashRule(name="git bash")
        gfilter.run_on(rule)
        grammar.add_rule(rule)
        grammar.load()
Exemplo n.º 30
0
        R(Function(send_input, nexus=_NEXUS), rdescript="Legion: Action"),
        "refresh":
        R(Function(navigation.mouse_alternates, mode="legion", nexus=_NEXUS),
          rdescript="Legion: Refresh"),
        "exit | escape | cancel":
        R(Function(kill, nexus=_NEXUS), rdescript="Exit Legion"),
    }
    extras = [
        Choice("action", {
            "kick": 0,
            "psychic": 1,
            "light": 2,
        }),
        IntegerRefST("n", 0, 1000),
    ]
    defaults = {
        "action": -1,
    }


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

context = AppContext(title="legiongrid")
grammar = Grammar("legiongrid", context=context)

if settings.SETTINGS["apps"]["legion"]:
    rule = GridControlRule(name="legion")
    gfilter.run_on(rule)
    grammar.add_rule(rule)
    grammar.load()