Skip to content

Commit

Permalink
progress: add main bars (#3594)
Browse files Browse the repository at this point in the history
* progress: add main push/pull bar

Fixes #3452
Related #1840
Related #3565

* adjust desc

* fix merge

Co-authored-by: Ruslan Kuprieiev <[email protected]>
Co-authored-by: Ruslan Kuprieiev <[email protected]>
  • Loading branch information
3 people authored Apr 25, 2020
1 parent e2981d2 commit b312895
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion dvc/remote/local.py
Original file line number Diff line number Diff line change
Expand Up @@ -448,9 +448,11 @@ def _process(
file_mode=self._file_mode,
)
status = STATUS_DELETED
desc = "Downloading"
else:
func = remote.upload
status = STATUS_NEW
desc = "Uploading"

if jobs is None:
jobs = remote.JOBS
Expand All @@ -466,9 +468,12 @@ def _process(
dir_plans = self._get_plans(download, remote, dir_status, status)
file_plans = self._get_plans(download, remote, file_status, status)

if len(dir_plans[0]) + len(file_plans[0]) == 0:
total = len(dir_plans[0]) + len(file_plans[0])
if total == 0:
return 0

with Tqdm(total=total, unit="file", desc=desc) as pbar:
func = pbar.wrap_fn(func)
with ThreadPoolExecutor(max_workers=jobs) as executor:
if download:
fails = sum(executor.map(func, *dir_plans))
Expand Down

0 comments on commit b312895

Please sign in to comment.