and again

This commit is contained in:
Kovid Goyal 2020-05-15 09:15:09 +05:30
parent 069e3e69b4
commit 9015530224
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -17,10 +17,13 @@ class ReadFileWithProgressReporting: # {{{
def __init__(self, path, mode='rb'):
self.fobj = open(path, mode)
self.fobj.seek(0, os.SEEK_END)
self._total = self.tell()
self._total = self.fobj.tell()
self.fobj.seek(0)
self.start_time = time.time()
def tell(self, *a):
return self.fobj.tell(*a)
def __enter__(self):
return self