예제 #1
0
 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)
예제 #2
0
 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)
예제 #3
0
 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
예제 #4
0
 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
예제 #5
0
def parseTerm(s):
    if isIdentifier(s):
        return s
    else:
        try:
            obj = json.loads(s)
        except ValueError, err:
            raise geocamPycroraptor.errors.PycroSyntaxError(*err.args)
        else:
예제 #6
0
def parseTerm(s):
    if isIdentifier(s):
        return s
    else:
        try:
            obj = json.loads(s)
        except ValueError, err:
            raise geocamPycroraptor.errors.PycroSyntaxError(*err.args)
        else:
예제 #7
0
 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
예제 #8
0
def parseShellJsonStrict(cmd):
    try:
        return json.loads(cmd)
    except ValueError, err:
        raise geocamPycroraptor.errors.PycroSyntaxError(*err.args)
예제 #9
0
def parseShellJsonStrict(cmd):
    try:
        return json.loads(cmd)
    except ValueError, err:
        raise geocamPycroraptor.errors.PycroSyntaxError(*err.args)