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)
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
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)
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)