def __init__(self, collector, serial, chunkSize=8192, callback=None, *args, **kw): # Save the pickled metadata to self._firstPage and pass the # data to StringPager.__init__ assert newserialized.ISerialized.providedBy(serial) self._atFirstPage = True md = serial.getMetadata() md['type'] = serial.getTypeDescriptor() self._firstPage = pickle.dumps(md, 2) data = serial.getData() StringPager.__init__(self, collector, data, chunkSize, callback, *args, **kw)
def nextPage(self): if self._atFirstPage: self._atFirstPage = False return self._firstPage else: return StringPager.nextPage(self)
def __init__(self, collector, string, firstPage): self._atFirstPage = True self._firstPage = firstPage self._deferred = Deferred() StringPager.__init__(self, collector, string, callback=self.done)
def remote_getPages(self, collector): StringPager(collector, bigString, 100, self.callback, *self.args, **self.kw) self.args = self.kw = None