Exemple #1
0
 def controller_input(self, cmd):
     # FIXME: process commands on input
     # - allowed commands: sync-set, sync-block, kill
     # - anything else?
     cmd = command.command(cmd)
     log.debug("received cmd: %r", cmd)
     if cmd.command() == 'variable_value':
         self.handle_variable_value(cmd)
Exemple #2
0
 def controller_input(self, cmd):
     # FIXME: process commands on input
     # - allowed commands: sync-set, sync-block, kill
     # - anything else?
     cmd = command.command(cmd)
     log.debug("received cmd: %r", cmd)
     if cmd.command() == 'variable_value':
         self.handle_variable_value(cmd)
Exemple #3
0
 def proc_evt_forward_response(self, evt):
     cmd = command.command(evt.arg('command'))
     cid = evt.arg('forward_id')
     d = self.__replaced(cid, None)
     if d:
         cmd_ok = cmd.command() in self.ALLOWED_COMMANDS
         if not cmd_ok:
             log.warning("Command %s not allowed! cmd=%r", cmd.command(), cmd)
         d.callback(('forward_response', cmd_ok, self, cid, cmd))
Exemple #4
0
 def proc_evt_forward_response(self, evt):
     cmd = command.command(evt.arg('command'))
     cid = evt.arg('forward_id')
     d = self.__replaced(cid, None)
     if d:
         cmd_ok = cmd.command() in self.ALLOWED_COMMANDS
         if not cmd_ok:
             log.warning("Command %s not allowed! cmd=%r", cmd.command(),
                         cmd)
         d.callback(('forward_response', cmd_ok, self, cid, cmd))
Exemple #5
0
 def testCommands(self):
     self._test_('ping', command.ping())
     self._test_('ping hello world', command.ping('hello world'))
     self._test_('PING', command.PING())
     self._test_('PING hello world', command.PING('hello world'))
     self._test_('kill', command.command('kill'))
Exemple #6
0
def a_command(str):
    return command.command(json.loads(str))
Exemple #7
0
def a_command(str):
    return command.command(json.loads(str))
 def testCommands(self):
     self._test_('ping', command.ping())
     self._test_('ping hello world', command.ping('hello world'))
     self._test_('PING', command.PING())
     self._test_('PING hello world', command.PING('hello world'))
     self._test_('kill', command.command('kill'))