Beispiel #1
0
class ReloadGrammarsRule(dragonfly.MappingRule):
    mapping = {
        command_table['force natlink to reload all grammars']:
        dragonfly.Function(reload_code),
        command_table['reload grammars']:
        dragonfly.Function(reload_code)
    }
Beispiel #2
0
def typing_commands():
    return {
        "<letters_and_keys>":
        df.Function(lambda **kw: type_characters(kw['letters_and_keys'])),
        "title <dictation>":
        dictation_wrap(title_case),
    }
Beispiel #3
0
class ShelfNumber(dragonfly.MappingRule):
    mapping = {
        # Call shelfNumber(<n>)
        "shelf <n>": dragonfly.Function(lambda n: shelfNumber(n))
    }
    extras = [
        dragonfly.IntegerRef("n", 0, 99),
    ]
Beispiel #4
0
class ShowShelfList(dragonfly.MappingRule):
    mapping = {command_table['shelf list']: dragonfly.Function(showShelfList)}
Beispiel #5
0
class ShowWindowList(dragonfly.MappingRule):
    mapping = {command_table['window list']: dragonfly.Function(showWindowList)}
Beispiel #6
0
class ChangeToWindows(dragonfly.MappingRule):
    mapping = {command_table['change to Windows']: dragonfly.Function(changeToWindows)}
Beispiel #7
0
class ChangeToLinux(dragonfly.MappingRule):
    mapping = {command_table['change to Linux']: dragonfly.Function(changeToLinux)}
Beispiel #8
0
class PauseDragon(dragonfly.MappingRule):
    mapping = {command_table['pause']: dragonfly.Function(pauseDragon)}
class ControlRule(dragonfly.MappingRule):
    mapping = {
        'enable dictation capture': dragonfly.Function(enable_capture),
        'disable dictation capture': dragonfly.Function(disable_capture)
        }
Beispiel #10
0
class DisableKeyboard(dragonfly.MappingRule):
    mapping = {command_table['disable keyboard']: dragonfly.Function(disableKeyboard)}
Beispiel #11
0
class GreetUser(dragonfly.MappingRule):
    mapping = {
        'greet user example <name>': dragonfly.Function(greeter),
        'greet user anonymous example': dragonfly.Function(anonymous_greeter)
    }
    extras = [dragonfly.Dictation(name='name')]
Beispiel #12
0
def dictation_wrap(fn):
    return df.Function(lambda dictation: do_dictation(fn(dictation.split())))
Beispiel #13
0
            def wrap_function(function):
                def _function(dictation):
                    formatted_text = function(dictation)
                    fly.Text(formatted_text).execute()

                return fly.Function(_function)
Beispiel #14
0
class ShowHistory(dragonfly.MappingRule):
    mapping = {command_table['show history']: dragonfly.Function(showHistory)}
Beispiel #15
0
class PlayMusic(dragonfly.MappingRule):
    mapping = {command_table['play music']: dragonfly.Function(playMusic)}
Beispiel #16
0
class ReloadGrammarsRule(dragonfly.MappingRule):
    mapping = {command_table["forcefield"]: dragonfly.Function(reload_code)}
Beispiel #17
0
class ExampleDictationRule(dragonfly.MappingRule):
    mapping = {
        "dictate <text>":
        dragonfly.Function(lambda text: print("I heard %r!" % str(text))),
    }
    extras = [dragonfly.Dictation("text")]
Beispiel #18
0
class EnableKeyboard(dragonfly.MappingRule):
    mapping = {command_table['enable keyboard']: dragonfly.Function(enableKeyboard)}
class ReloadMacros(dragonfly.MappingRule):
    mapping = {
        'reload macros from server':
        dragonfly.Function(reload_macros_from_server),
        'reload server plugins': dragonfly.Function(reload_server_plugins),
    }
Beispiel #20
0
class ShervsTest(dragonfly.MappingRule):
    mapping = {command_table['shervs test']: dragonfly.Function(shervstest)}