mirror of
https://github.com/pirate/ArchiveBox.git
synced 2025-08-28 08:39:54 +02:00
recreate chunks on each new progress bar
This commit is contained in:
@@ -121,11 +121,10 @@ def progress(seconds=TIMEOUT, prefix=''):
|
|||||||
if not SHOW_PROGRESS:
|
if not SHOW_PROGRESS:
|
||||||
return lambda: None
|
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):
|
def progress_bar(seconds, prefix):
|
||||||
"""show timer in the form of progress bar, with percentage and seconds remaining"""
|
"""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:
|
try:
|
||||||
for s in range(seconds * chunks):
|
for s in range(seconds * chunks):
|
||||||
progress = s / chunks / seconds * 100
|
progress = s / chunks / seconds * 100
|
||||||
|
Reference in New Issue
Block a user