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

(cherry picked from commit 9ad1e0e159)

Co-authored-by: Batuhan Taskaya <[email protected]>
This commit is contained in:
mergify[bot]
2021-02-02 11:54:45 +02:00
committed by GitHub
co-authored by Batuhan Taskaya
parent bd39e4eb1a
commit fb4c2e5eb1
+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)