Closed GoogleCodeExporter closed 9 years ago
I believe you're correct, but I can't reproduce it. What's the implementation
of withProgress? Are you using the progressbar as an iterator like in example7:
http://code.google.com/p/python-progressbar/source/browse/progressbar/examples.p
y#84 ?
>>> from progressbar import *
>>> pbar = ProgressBar(widgets=[Percentage(), ' ', Bar(), ' ', ETA()])
>>> for i in pbar(range(10**6)):
... pass
...
100% |##################################################| Time: 0:00:06
Original comment by nilton.v...@gmail.com
on 19 Apr 2011 at 3:56
Ha, I didn't realize ProgressBar had that capability. =) I reimplemented the
iterator idea myself. But I have the same issue with slightly modified
example7() code:
def example7():
widgets = [RotatingMarker(), ' ', Percentage(), ' ', Bar(), ' ', ETA()]
pbar=ProgressBar(widgets=widgets)
x = []
for i in pbar(range(10**6)):
x.append(i**2)
return x
x = example7()
\ 100% |########################################################| ETA:
00:00:00
Adding the "or self.finished":
x = example7()
| 100% |########################################################| Time:
00:00:02
Can you reproduce it with that exact code?
Original comment by jni.s...@gmail.com
on 19 Apr 2011 at 4:08
Looking at self._next_update(), maybe it has something to do with
machine-dependent floating point errors?
Original comment by jni.s...@gmail.com
on 19 Apr 2011 at 4:12
Somehow that still works for me. It might indeed be some machine-dependent
floating point error. But I could reproduce with this:
def repro():
pbar = ProgressBar(maxval=10**6, widgets=[Percentage(), ' ', Bar(), ' ', ETA()]).start()
pbar.update(10**6 - 1)
pbar.update(10**6)
pbar.finish()
I'm submitting the fix you suggested.
Original comment by nilton.v...@gmail.com
on 19 Apr 2011 at 4:25
Done:
http://code.google.com/p/python-progressbar/source/detail?r=cb58b5d2c7669d8218ae
3b5966fc7e1389ed1d9b
Thanks for reporting!
Original comment by nilton.v...@gmail.com
on 19 Apr 2011 at 4:28
Thanks for the fast response! =)
Original comment by jni.s...@gmail.com
on 19 Apr 2011 at 4:44
Original issue reported on code.google.com by
jni.s...@gmail.com
on 18 Apr 2011 at 9:11