Esempio n. 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)
Esempio n. 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)
Esempio n. 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
Esempio n. 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
Esempio n. 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:
Esempio n. 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:
Esempio n. 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
Esempio n. 8
0
def parseShellJsonStrict(cmd):
    try:
        return json.loads(cmd)
    except ValueError, err:
        raise geocamPycroraptor.errors.PycroSyntaxError(*err.args)
Esempio n. 9
0
def parseShellJsonStrict(cmd):
    try:
        return json.loads(cmd)
    except ValueError, err:
        raise geocamPycroraptor.errors.PycroSyntaxError(*err.args)