Skip to content

Commit

Permalink
ssh: show total-size when uploading/downloading on ssh remote (#5383)
Browse files Browse the repository at this point in the history
  • Loading branch information
isidentical authored Feb 2, 2021
1 parent 4348832 commit 9ad1e0e
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion dvc/tree/ssh/connection.py
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,7 @@ def download(self, src, dest, no_progress_bar=False, progress_title=None):
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)

Expand Down Expand Up @@ -221,7 +222,10 @@ def upload(self, src, dest, no_progress_bar=False, progress_title=None):
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)

Expand Down

0 comments on commit 9ad1e0e

Please sign in to comment.