Exemple #1
0
    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)
Exemple #2
0
 def nextPage(self):
     if self._atFirstPage:
         self._atFirstPage = False
         return self._firstPage
     else:
         return StringPager.nextPage(self)
Exemple #3
0
 def __init__(self, collector, string, firstPage):
     self._atFirstPage = True
     self._firstPage = firstPage
     self._deferred = Deferred()
     StringPager.__init__(self, collector, string, callback=self.done)
Exemple #4
0
 def nextPage(self):
     if self._atFirstPage:
         self._atFirstPage = False
         return self._firstPage
     else:
         return StringPager.nextPage(self)
Exemple #5
0
 def remote_getPages(self, collector):
     StringPager(collector, bigString, 100, self.callback, *self.args,
                 **self.kw)
     self.args = self.kw = None
Exemple #6
0
 def __init__(self, collector, string, firstPage):
     self._atFirstPage = True
     self._firstPage = firstPage
     self._deferred = Deferred()
     StringPager.__init__(self, collector, string, callback=self.done)