hopefully temp fix for uncalled checkout progress_callback

This commit is contained in:
Casper da Costa-Luis
2019-08-19 00:28:18 +01:00
parent 13e76de5e9
commit 6102caa309
+8 -1
View File
@@ -37,7 +37,10 @@ def checkout(self, target=None, with_deps=False, force=False, recursive=False):
with self.state:
_cleanup_unused_links(self, all_stages)
with Tqdm(total=get_all_files_numbers(stages), unit="file") as pbar:
total = get_all_files_numbers(stages)
with Tqdm(
total=total, unit="file", desc="Checkout", disable=total == 0
) as pbar:
for stage in stages:
if stage.locked:
logger.warning(
@@ -47,4 +50,8 @@ def checkout(self, target=None, with_deps=False, force=False, recursive=False):
)
)
done = pbar.n
stage.checkout(force=force, progress_callback=pbar.update_desc)
if done == pbar.n:
# callback not called
pbar.update(stage.get_all_files_number())