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) }
def typing_commands(): return { "<letters_and_keys>": df.Function(lambda **kw: type_characters(kw['letters_and_keys'])), "title <dictation>": dictation_wrap(title_case), }
class ShelfNumber(dragonfly.MappingRule): mapping = { # Call shelfNumber(<n>) "shelf <n>": dragonfly.Function(lambda n: shelfNumber(n)) } extras = [ dragonfly.IntegerRef("n", 0, 99), ]
class ShowShelfList(dragonfly.MappingRule): mapping = {command_table['shelf list']: dragonfly.Function(showShelfList)}
class ShowWindowList(dragonfly.MappingRule): mapping = {command_table['window list']: dragonfly.Function(showWindowList)}
class ChangeToWindows(dragonfly.MappingRule): mapping = {command_table['change to Windows']: dragonfly.Function(changeToWindows)}
class ChangeToLinux(dragonfly.MappingRule): mapping = {command_table['change to Linux']: dragonfly.Function(changeToLinux)}
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) }
class DisableKeyboard(dragonfly.MappingRule): mapping = {command_table['disable keyboard']: dragonfly.Function(disableKeyboard)}
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')]
def dictation_wrap(fn): return df.Function(lambda dictation: do_dictation(fn(dictation.split())))
def wrap_function(function): def _function(dictation): formatted_text = function(dictation) fly.Text(formatted_text).execute() return fly.Function(_function)
class ShowHistory(dragonfly.MappingRule): mapping = {command_table['show history']: dragonfly.Function(showHistory)}
class PlayMusic(dragonfly.MappingRule): mapping = {command_table['play music']: dragonfly.Function(playMusic)}
class ReloadGrammarsRule(dragonfly.MappingRule): mapping = {command_table["forcefield"]: dragonfly.Function(reload_code)}
class ExampleDictationRule(dragonfly.MappingRule): mapping = { "dictate <text>": dragonfly.Function(lambda text: print("I heard %r!" % str(text))), } extras = [dragonfly.Dictation("text")]
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), }
class ShervsTest(dragonfly.MappingRule): mapping = {command_table['shervs test']: dragonfly.Function(shervstest)}