Skip to content

Conversation

@kenodegard
Copy link
Contributor

Include a distinction for counters that have stopped (time_elapsed no longer increments and Bar formatter stops running in the case of unknown totals). This allows bars to better handle cases where a counter doesn't complete properly and terminates in some error state the developer cares about.

@jonathanslenders I think this is one of the last ProgressBar ideas I have.

@jonathanslenders
Copy link
Member

jonathanslenders commented Dec 19, 2019

This makes sense, I've added a few remarks. Thanks a lot for this!

And thanks for your patience, it's been very busy here...

yield item
self.item_completed()

# Only done if we iterate to the very end.
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should we intercept any exceptions here and set stopped?

@kenodegard kenodegard changed the title Introducing ProgressBarCounter.stop Introducing ProgressBarCounter.stopped Dec 20, 2019
Include a distinction for counters that have stopped (time_elapsed no longer increments and Bar formatter stops running in the case of unknown totals). This allows bars to better handle cases where a counter doesn't complete properly and terminates in some error state the developer cares about. Added breaking task to a-lot-of-parallel-tasks.py example.
@jonathanslenders jonathanslenders merged commit 21eeda9 into prompt-toolkit:master Dec 20, 2019
@jonathanslenders
Copy link
Member

I'm merging this. It looks good. We can still improve/fix in other PRs.

Wouldn't it make sense to set the ETA to 0 when stopped=True? This confused me in the example.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants