def handleLine(self, sock, line): if self._responseIdToWaitFor != None: msg = json.loads(line) if msg[0] == "response" and msg[1] == self._responseIdToWaitFor: self._lastMatchingMessage = msg if self._lineHandler: self._lineHandler(sock, line)
def handleLine(self, sock, line): if self._responseIdToWaitFor != None: msg = json.loads(line) if msg[0] == 'response' and msg[1] == self._responseIdToWaitFor: self._lastMatchingMessage = msg if self._lineHandler: self._lineHandler(sock, line)
def handleLine(self, conn, text): cmd = json.loads(text) print 'Slave: handleLine:', cmd if cmd[0] == 'status': _, taskName, status = cmd self.handleStatus(taskName, status) else: pass # nothing to do for other message types yet
def parseTerm(s): if isIdentifier(s): return s else: try: obj = json.loads(s) except ValueError, err: raise geocamPycroraptor.errors.PycroSyntaxError(*err.args) else:
def makeHumanReadable(self, line): if line.startswith('#'): return line else: cmd = json.loads(line) if (cmd and cmd[0] == 'response'): _response, _lineId, returnCode = cmd[:3] result = cmd[3:] if returnCode == 'ok': return self.makeOkResponseHumanReadable(result[0]) else: return ' '.join([returnCode] + result) else: return line
def parseShellJsonStrict(cmd): try: return json.loads(cmd) except ValueError, err: raise geocamPycroraptor.errors.PycroSyntaxError(*err.args)