mirror of
https://github.com/ArchiveBox/ArchiveBox
synced 2024-11-10 14:44:18 +00:00
recreate chunks on each new progress bar
This commit is contained in:
parent
78ffa57c06
commit
bc6de29a5a
1 changed files with 2 additions and 3 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue