You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
ProgressBar item_show_func displays the previous item #1353
I've noticed a bug with the item_show_func option for click.progressbar where the progress bar ends up showing the previous item instead of the current one.
The issue seems to be that ProgressBar.generator() will only render the progress bar after the current item has been processed. As a result, the previous item is visible on screen while the current one is in processing.
I think this change to lines 285-288 should fix the issue:
The documentation, to me at least, seems to indicate that the intended behavior is to display the current item as opposed to the previous one. So I guess this is less of a bug and more of a case of the docs and implementation being out of sync.
Any updates on this? I find the current behaviour quite confusing, especially when iterating over a single item (for example over a queryset which has been filtered by primary key) – then the progressbar is not shown at all.
Activity
davidism commentedon Jul 12, 2019
You can just as easily argue that the current behavior is correct as it shows the last completed task. Which is correct?
JoelEager commentedon Jul 12, 2019
The documentation, to me at least, seems to indicate that the intended behavior is to display the current item as opposed to the previous one. So I guess this is less of a bug and more of a case of the docs and implementation being out of sync.
davidism commentedon Jul 12, 2019
Still not sure, but would you mind making a PR so I can take a look at it?
JoelEager commentedon Jul 12, 2019
Sure, I'll try to put one up this evening.
Implement fix for pallets#1353
nip3o commentedon Oct 2, 2020
Any updates on this? I find the current behaviour quite confusing, especially when iterating over a single item (for example over a queryset which has been filtered by primary key) – then the progressbar is not shown at all.
BALaka-18 commentedon Mar 2, 2021
@davidism I'm from MLH fellowship, would like to work on this Issue.
davidism commentedon Mar 2, 2021
@BALaka-18 there is already a PR for this, but it wasn't linked for some reason. Sorry about that.
BALaka-18 commentedon Mar 2, 2021
Sure ! Not a problem.
JoelEager commentedon Mar 4, 2021
Thanks for taking the time to revive and resolve this. I'm looking forward to making use of your fix in the future.