def dataReceived(self, data):
     self.keep_going = False
     if self.waiting_for_response:
         self.waiting_for_response = False
         self.timeoutCallback.cancel()
         try:
             response = DaqServerResponse.deserialize(data)
         except Exception, e:  # pylint: disable=W0703
             self.errorOut('Invalid response: {} ({})'.format(data, e))
         else:
             if response.status != Status.ERROR:
                 self.processResponse(response)  # may set self.keep_going
                 if not self.keep_going:
                     self.commandCompleted(response.status, response.message, response.data)
             else:
                 self.errorOut(response.message)
Exemple #2
0
 def dataReceived(self, data):
     self.keep_going = False
     if self.waiting_for_response:
         self.waiting_for_response = False
         self.timeoutCallback.cancel()
         try:
             response = DaqServerResponse.deserialize(data)
         except Exception, e:  # pylint: disable=W0703
             self.errorOut('Invalid response: {} ({})'.format(data, e))
         else:
             if response.status != Status.ERROR:
                 self.processResponse(response)  # may set self.keep_going
                 if not self.keep_going:
                     self.commandCompleted(response.status,
                                           response.message, response.data)
             else:
                 self.errorOut(response.message)
 def sendResponse(self, status, message=None, data=None):
     response = DaqServerResponse(status, message=message, data=data)
     self.sendLine(response.serialize())
 def sendResponse(self, status, message=None, data=None):
     response = DaqServerResponse(status, message=message, data=data)
     self.sendLine(response.serialize())