Open vflaux opened 3 months ago
Thanks for reporting! I'll take a look at your PR. For now you can get closer to what you want using another subcounter.
import time
import enlighten
manager = enlighten.get_manager()
pbar: enlighten.Counter = manager.counter(total=500)
sub2 = pbar.add_subcounter("white")
sub1 = pbar.add_subcounter("blue3")
sub1.update(incr=200)
while pbar.count < pbar.total:
sub2.update(force=True)
time.sleep(0.05)
pbar.close()
I'm not sure I'm ok completely getting rid of the remainder logic and I think some corner cases weren't accounted for in your PR. I put something together in #71. Please try it out and see if it works for you.
But the sub counter bar can be inconsistent : going backward & forward even if the count have not changed.
OK, I pushed another change. Now it only rounds when the count matches the total. It's not ideal because it may jump at the end, but it would be weird if the bar wasn't full at the end. Please try it out and let me know what you think.
That's much better. The sub-counter bar can still progress by one character even if the sub-counter hasn't increased, but at least it never goes back after that.
Describe the bug The progress bar moves back and forth when incrementing a counter with a sub counter > 0, instead of smoothly going forward.
To Reproduce
Environment (please complete the following information):