Beispiel #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)
Beispiel #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)
Beispiel #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))
Beispiel #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))
Beispiel #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'))
Beispiel #6
0
def a_command(str):
    return command.command(json.loads(str))
Beispiel #7
0
def a_command(str):
    return command.command(json.loads(str))
Beispiel #8
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'))