-
Notifications
You must be signed in to change notification settings - Fork 103
Open
Description
A progressbar with maxval=0 doesn't fill its bars on .finish(). I know it's not mathematically sound (0/0 is undefined, not 100%) but I think it should. It means that when I'm uploading 0-length files they stick out weirdly in the log.
$ cat t.py
import sys
from progressbar import *
widgets = [f'fname: ', Percentage(), ' ', Bar(marker=RotatingMarker()),
' ', ETA(), ' ', FileTransferSpeed()]
pbar = ProgressBar(widgets=widgets, maxval=int(sys.argv[1]))
pbar.start()
pbar.finish()
$ python t.py 0
fname: 100% | | ETA: --:--:-- 0.00 B/s
$ python t.py 1
fname: 100% |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| Time: 0:00:00 1.52 kB/s
$ python t.py 100
fname: 100% |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| Time: 0:00:00 153.08 kB/s
Metadata
Metadata
Assignees
Labels
No labels