reader: satisfy progress interface

This commit is contained in:
Julian Daube 2019-07-02 14:49:58 +02:00
parent 79550303fe
commit 94d8388382

View File

@ -27,12 +27,16 @@ class Reader(ProgressGetter):
return self.current / self.total return self.current / self.total
@property
def total(self):
return self._total
def __init__(self, file): def __init__(self, file):
self.stream = file self.stream = file
# find file size # find file size
self.stream.seek(0, 2) self.stream.seek(0, 2)
self.total = self.stream.tell() self._total = self.stream.tell()
self.stream.seek(0, 0) self.stream.seek(0, 0)
def skip(self, n): def skip(self, n):