Exemple #1
0
 def __init__(self, filelike, start, end, blksize = 131072):
     """
     Call our parent's initialize. Then set our start/end/curr pointers and
     seek the file to that position.
     """
     if start > end:
         raise NameError("request end must be greater or equal to start. Start: %d, end: %d" % (start, end))
     
     FileWrapper.__init__(self, filelike, blksize)
     self.start = start
     self.curr = start
     self.end = end
     self.filelike.seek(self.start, 0)
Exemple #2
0
 def __init__(self, item, *args, **kwargs):
     self._item = item
     self._counter = 0
     self._stale = 0
     self._throttle = kwargs.get("throttle", 100)
     self._stale_limit = kwargs.get("stale_limit", 10000)
     return FileWrapper.__init__(self, *args, **kwargs)
Exemple #3
0
 def __init__(self, item, *args, **kwargs):
     self._item = item
     self._counter = 0
     self._stale = 0
     self._throttle = kwargs.get("throttle", 100)
     self._stale_limit = kwargs.get("stale_limit", 10000)
     return FileWrapper.__init__(self, *args, **kwargs)
Exemple #4
0
 def __init__(self, fileName, chunkSize=16 * 1024, deleteAfter=False):
     self.fileName = fileName
     self.deleteAfter = deleteAfter
     self.fileHandler = open(self.fileName, "rb")
     FileWrapper.__init__(self, self.fileHandler, chunkSize)
Exemple #5
0
 def __init__(self, fileName, chunkSize=16*1024, deleteAfter=False):
     self.fileName = fileName
     self.deleteAfter = deleteAfter
     self.fileHandler = open(self.fileName, "rb")
     FileWrapper.__init__(self, self.fileHandler, chunkSize)