mirror of
git://github.com/kovidgoyal/calibre.git
synced 2026-01-03 17:16:22 +01:00
and again
This commit is contained in:
parent
069e3e69b4
commit
9015530224
1 changed files with 4 additions and 1 deletions
|
|
@ -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
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue