Skip to content

Commit fb4c2e5

Browse files
ssh: show total-size when uploading/downloading on ssh remote (#5383) (#5384)
(cherry picked from commit 9ad1e0e) Co-authored-by: Batuhan Taskaya <[email protected]>
1 parent bd39e4e commit fb4c2e5

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

dvc/tree/ssh/connection.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -189,6 +189,7 @@ def download(self, src, dest, no_progress_bar=False, progress_title=None):
189189
desc=progress_title or os.path.basename(src),
190190
disable=no_progress_bar,
191191
bytes=True,
192+
total=self.getsize(src),
192193
) as pbar:
193194
self.sftp.get(src, dest, callback=pbar.update_to)
194195

@@ -221,7 +222,10 @@ def upload(self, src, dest, no_progress_bar=False, progress_title=None):
221222
progress_title = posixpath.basename(dest)
222223

223224
with Tqdm(
224-
desc=progress_title, disable=no_progress_bar, bytes=True
225+
desc=progress_title,
226+
disable=no_progress_bar,
227+
bytes=True,
228+
total=os.path.getsize(src),
225229
) as pbar:
226230
self.sftp.put(src, tmp_file, callback=pbar.update_to)
227231

0 commit comments

Comments
 (0)