Also log start of upload

This commit is contained in:
Kovid Goyal 2023-02-24 20:29:51 +05:30
parent 7dd20d4c79
commit f7f4384876
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -183,11 +183,12 @@ def run_sdist(args: Any) -> None:
class ReadFileWithProgressReporting(io.FileIO): # {{{ class ReadFileWithProgressReporting(io.FileIO): # {{{
def __init__(self, path: str): def __init__(self, path: str):
io.FileIO.__init__(self, path, 'rb') super().__init__(path, 'rb')
self.seek(0, os.SEEK_END) self.seek(0, os.SEEK_END)
self._total = self.tell() self._total = self.tell()
self.seek(0) self.seek(0)
self.start_time = time.monotonic() self.start_time = time.monotonic()
print('Starting upload of:', os.path.basename(path), 'size:', self._total)
def __len__(self) -> int: def __len__(self) -> int:
return self._total return self._total