コード例 #1
0
ファイル: _vocabulary.py プロジェクト: brxck/voice-coding
class DynamicRule(dragonfly.CompoundRule):
    spec = command_table['<dynamic>']

    extras = [
        dragonfly.DictListRef(
            'dynamic', aenea.vocabulary.register_global_dynamic_vocabulary())
    ]

    def _process_recognition(self, node, extras):
        extras['dynamic'].execute(extras)
コード例 #2
0
ファイル: _aenea.py プロジェクト: LemonBreezes/Voice-Coding
class ChangeServer(dragonfly.CompoundRule):
    spec = command_table['set proxy server to <proxy>']
    extras = [dragonfly.DictListRef('proxy', server_list)]

    def _process_recognition(self, node, extras):
        aenea.communications.set_server_address((extras['proxy']['host'], extras['proxy']['port']))

    def _process_begin(self):
        if server_list_watcher.refresh():
            server_list.clear()
            for k, v in server_list_watcher.conf.get('servers', {}).iteritems():
                server_list[str(k)] = v
コード例 #3
0
ファイル: _vocabulary.py プロジェクト: brxck/voice-coding
class StaticRule(dragonfly.CompoundRule):
    spec = command_table['<static>']

    extras = [
        dragonfly.DictListRef(
            'static',
            dragonfly.DictList(
                'static global',
                aenea.vocabulary.get_static_vocabulary('global')))
    ]

    def _process_recognition(self, node, extras):
        extras['static'].execute(extras)
コード例 #4
0
 def __init__(self, *args, **kwargs):
     self.spec = _('set proxy server to <proxy>')
     self.extras = [dragonfly.DictListRef('proxy', SERVER_LIST)]
     dragonfly.CompoundRule.__init__(self, *args, **kwargs)