ssh: show total-size when uploading/downloading on ssh remote (#5383)

This commit is contained in:
Batuhan Taskaya
2021-02-02 11:27:19 +02:00
committed by GitHub
parent 4348832b44
commit 9ad1e0e159
+5 -1
View File
@@ -189,6 +189,7 @@ class SSHConnection:
desc=progress_title or os.path.basename(src),
disable=no_progress_bar,
bytes=True,
total=self.getsize(src),
) as pbar:
self.sftp.get(src, dest, callback=pbar.update_to)
@@ -221,7 +222,10 @@ class SSHConnection:
progress_title = posixpath.basename(dest)
with Tqdm(
desc=progress_title, disable=no_progress_bar, bytes=True
desc=progress_title,
disable=no_progress_bar,
bytes=True,
total=os.path.getsize(src),
) as pbar:
self.sftp.put(src, tmp_file, callback=pbar.update_to)