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)
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)
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)
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)
def __delattr__(self, key): raise error.KernelError("I am protected!")
def __setattr__(self, k, v): if self._fix: raise error.KernelError("I am protected!") else: object.__setattr__(self, k, v)
def __setattr__(self, k,v): if hasattr(self,'_fix'): raise error.KernelError("I am protected!") else: object.__setattr__(self, k, v)