Example #1
0
File: cli.py Project: sssst315/beah
 def set_controller(self, controller=None):
     ExtBackend.set_controller(self, controller)
     if controller:
         #controller.proc_cmd(self, command.ping("Are you there?"))
         controller.proc_cmd(self, command.no_output())
         controller.proc_cmd(self, self.cmd)
         self.wait = True
Example #2
0
 def set_controller(self, controller=None):
     ExtBackend.set_controller(self, controller)
     if controller:
         #controller.proc_cmd(self, command.ping("Are you there?"))
         controller.proc_cmd(self, command.no_output())
         controller.proc_cmd(self, self.cmd)
         self.wait = True
Example #3
0
    def testMain(self):

        be = backends.CmdOnlyBackend()
        be.set_controller(FakeController(test_case=self, expected=command.no_output()))

        def test(be, input, output):
            be.controller.expected = output
            be.proc_input(input)

        test(be, 'ping', command.ping())
        test(be, 'PING a message', command.PING('a message'))
        test(be, 'run a_task', command.run('a_task'))
Example #4
0
 def set_controller(self, controller=None):
     ExtBackend.set_controller(self, controller)
     if controller:
         self.__status = self._CONNECTED
         # FIXME: implement proper output filterring instead of no_output:
         controller.proc_cmd(self, command.no_output())
         for cid in self.__queue:
             cmd, d = self.__pending[cid]
             controller.proc_cmd(self, cmd)
             reactor.callLater(self.TIMEOUT, self.timeout, cid)
     else:
         self.__status = self._IDLE
Example #5
0
 def set_controller(self, controller=None):
     ExtBackend.set_controller(self, controller)
     if controller:
         self.__status = self._CONNECTED
         # FIXME: implement proper output filterring instead of no_output:
         controller.proc_cmd(self, command.no_output())
         for cid in self.__queue:
             cmd, d = self.__pending[cid]
             controller.proc_cmd(self, cmd)
             reactor.callLater(self.TIMEOUT, self.timeout, cid)
     else:
         self.__status = self._IDLE
Example #6
0
    def testMain(self):

        be = backends.CmdOnlyBackend()
        be.set_controller(
            FakeController(test_case=self, expected=command.no_output()))

        def test(be, input, output):
            be.controller.expected = output
            be.proc_input(input)

        test(be, 'ping', command.ping())
        test(be, 'PING a message', command.PING('a message'))
        test(be, 'run a_task', command.run('a_task'))
Example #7
0
 def set_controller(self, controller=None):
     CmdBackend.set_controller(self, controller)
     if controller:
         self.controller.proc_cmd(self, command.no_output())
Example #8
0
 def set_controller(self, controller=None):
     CmdBackend.set_controller(self, controller)
     if controller:
         self.controller.proc_cmd(self, command.no_output())