コード例 #1
0
 def isResetOK(self, msg):
     if msg == 'RESET OK':
         self.resetOK()
     elif msg == 'RESET FAIL':
         self.resetFail(Failure(error.KernelError('RESET FAIL')))
     else:
         self.dieLoudly('RESET OK|FAIL not received: ' + msg)
コード例 #2
0
 def isKillOK(self, msg):
     if msg == 'KILL OK':
         self.killOK()
     elif msg == 'KILL FAIL':
         self.killFail(Failure(error.KernelError('KILL FAIL')))
     else:
         self.dieLoudly('KILL OK|FAIL not received: ' + msg)
コード例 #3
0
 def isPushOK(self, msg):
     if msg == 'PUSH OK':
         self.pushOK()
     elif msg == 'PUSH FAIL':
         self.pushFail(Failure(error.KernelError('Received PUSH FAIL')))
     else:
         self.dieLoudly('Expected PUSH OK, got: ' + msg)
コード例 #4
0
 def handleIncomingSerialized(self, msg):
     if msg == self.workVars['callbackString']:
         self.workVars['deferred'].callback(self.workVars['serialsList'])
         return
     elif msg == self.workVars['errbackString']:
         self.workVars['deferred'].errback(Failure(error.KernelError(msg)))
         return
         
     msgList = msg.split(' ', 1)
     if len(msgList) == 2:
         serialType = msgList[0]
         self.workVars['serialKey'] = msgList[1]
         f = getattr(self, 'handleSerial_%s' % serialType, None)
         if f is not None:
             self.nextHandler = f
         else:
             self.dieLoudly('Unsupported serialization type: ' + serialType)
     else:
         self.dieLoudly('Data commands must have two arguments: ' + msg)
コード例 #5
0
 def __delattr__(self, key):
     raise error.KernelError("I am protected!")
コード例 #6
0
 def __setattr__(self, k, v):
     if self._fix:
         raise error.KernelError("I am protected!")
     else:
         object.__setattr__(self, k, v)
コード例 #7
0
 def __setattr__(self, k,v):
     if hasattr(self,'_fix'):
         raise error.KernelError("I am protected!")
     else:
         object.__setattr__(self, k, v)