Package buildbot :: Package util :: Module state
[frames] | no frames]

Source Code for Module buildbot.util.state

 1  from twisted.internet import defer 
2 3 -class StateMixin(object):
4 ## state management 5 6 _objectid = None 7 8 @defer.inlineCallbacks
9 - def getState(self, *args, **kwargs):
10 # get the objectid, if not known 11 if self._objectid is None: 12 self._objectid = yield self.master.db.state.getObjectId(self.name, 13 self.__class__.__name__) 14 15 rv = yield self.master.db.state.getState(self._objectid, *args, 16 **kwargs) 17 defer.returnValue(rv)
18 19 @defer.inlineCallbacks
20 - def setState(self, key, value):
21 # get the objectid, if not known 22 if self._objectid is None: 23 self._objectid = yield self.master.db.state.getObjectId(self.name, 24 self.__class__.__name__) 25 26 yield self.master.db.state.setState(self._objectid, key, value)
27