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