예제 #1
0
파일: state.py 프로젝트: caipeichao/Histo
 def loadState(self, state):
     stream = self.bundle.open(state, 'rb')
     from picklestream import PickleStream
     stream = PickleStream(stream)
     with stream as f:
         result = f.readObject()
     from histo.server.keysets import KeySets
     return KeySets.decode(result)
예제 #2
0
파일: state.py 프로젝트: caipeichao/Histo
 def writeStateToBundle(self):
     stateName = getStateName(self.state)
     from histo.server.keysets import KeySets
     encodedState = KeySets.encode(0, self.state)
     stream = self.bundle.open(stateName, 'wb')
     self.bundle.unprotect(self.lastProtectedStateName)
     self.bundle.protect(stateName)
     self.lastProtectedStateName = stateName
     from picklestream import PickleStream
     stream = PickleStream(stream)
     with stream as f:
         f.writeObject(encodedState)
예제 #3
0
파일: index.py 프로젝트: caipeichao/Histo
 def __iter__(self):
     from histo.server.keysets import KeySets
     for e in self.index:
         yield KeySets.decode(e)
예제 #4
0
파일: commit.py 프로젝트: caipeichao/Histo
 def encodeIndexItem(self):
     from histo.server.keysets import KeySets
     self.encodedIndexItem = KeySets.encode(1, self.indexItem)