From bc6de29a5a17048f3fa07ce1dc32bce6600adccd Mon Sep 17 00:00:00 2001 From: Nick Sweeting Date: Mon, 4 Feb 2019 20:41:35 -0800 Subject: [PATCH] recreate chunks on each new progress bar --- archivebox/util.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/archivebox/util.py b/archivebox/util.py index f708a4bf..81da4c20 100644 --- a/archivebox/util.py +++ b/archivebox/util.py @@ -121,11 +121,10 @@ def progress(seconds=TIMEOUT, prefix=''): if not SHOW_PROGRESS: return lambda: None - chunk = '█' if sys.stdout.encoding == 'UTF-8' else '#' - chunks = TERM_WIDTH - len(prefix) - 20 # number of progress chunks to show (aka max bar width) - def progress_bar(seconds, prefix): """show timer in the form of progress bar, with percentage and seconds remaining""" + chunk = '█' if sys.stdout.encoding == 'UTF-8' else '#' + chunks = TERM_WIDTH - len(prefix) - 20 # number of progress chunks to show (aka max bar width) try: for s in range(seconds * chunks): progress = s / chunks / seconds * 100