reader: satisfy progress interface
This commit is contained in:
parent
79550303fe
commit
94d8388382
@ -27,12 +27,16 @@ class Reader(ProgressGetter):
|
||||
|
||||
return self.current / self.total
|
||||
|
||||
@property
|
||||
def total(self):
|
||||
return self._total
|
||||
|
||||
def __init__(self, file):
|
||||
self.stream = file
|
||||
|
||||
# find file size
|
||||
self.stream.seek(0, 2)
|
||||
self.total = self.stream.tell()
|
||||
self._total = self.stream.tell()
|
||||
self.stream.seek(0, 0)
|
||||
|
||||
def skip(self, n):
|
||||
|
Loading…
Reference in New Issue
Block a user