Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

0-length files never finish #72

Open
kousu opened this issue Jun 29, 2020 · 0 comments
Open

0-length files never finish #72

kousu opened this issue Jun 29, 2020 · 0 comments

Comments

@kousu
Copy link
Contributor

kousu commented Jun 29, 2020

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant