[Twisted-Python] FilePager

Paul Boehm typo at soniq.net
Thu Aug 1 12:42:10 MDT 2002


intended for twisted.spread.util:

class FilePager(Pager):
    """A pager for files.
    """
    def __init__(self, collector, file, chunkSize=8192):
        self.file = file
        self.chunkSize = chunkSize
        Pager.__init__(self, collector)
    def nextPage(self):
        data = self.file.read(self.chunkSize)
        if len(data) < self.chunkSize:
            self.stopPaging()
        return data





More information about the Twisted-Python mailing list