From d2b0dd5ed83b69a50f6fd924a4cb92577310d81e Mon Sep 17 00:00:00 2001 From: Casper da Costa-Luis Date: Sun, 5 Apr 2020 13:43:25 +0100 Subject: [PATCH] progress: add main push/pull bar Fixes #3452 Related #1840 Related #3565 --- dvc/remote/local.py | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/dvc/remote/local.py b/dvc/remote/local.py index fe0270ef34..7da35343fe 100644 --- a/dvc/remote/local.py +++ b/dvc/remote/local.py @@ -341,9 +341,11 @@ def _process( file_mode=self._file_mode, ) status = STATUS_DELETED + desc = "Pulling" else: func = remote.upload status = STATUS_NEW + desc = "Pushing" if jobs is None: jobs = remote.JOBS @@ -361,11 +363,13 @@ def _process( if len(plans[0]) == 0: return 0 - if jobs > 1: - with ThreadPoolExecutor(max_workers=jobs) as executor: - fails = sum(executor.map(func, *plans)) - else: - fails = sum(map(func, *plans)) + with Tqdm(total=len(plans[0]), unit="file", desc=desc) as pbar: + func = pbar.wrap_fn(func) + if jobs > 1: + with ThreadPoolExecutor(max_workers=jobs) as executor: + fails = sum(executor.map(func, *plans)) + else: + fails = sum(map(func, *plans)) if fails: if download: