Skip to content

Conversation

@kenodegard
Copy link
Contributor

@jonathanslenders - this is dependant on #950

Ken Odegard added 3 commits September 27, 2019 12:16
Store the stop_time in order to track how long it took for the event to complete not how long the ProgressBarCounter has been around.
Remove_when_done accepts bool or int. Bool does as before where the counter is removed upon done or remains indefinitely. Int will cause counter to be removed only after that many seconds have passed.
@jonathanslenders
Copy link
Member

Can you explain a bit why exactly this feature would be good to have?
I have some comments about the implementation, but first, I'd like to understand the use case.

(It sounds like a very specific use case, and in that case, it shouldn't be in prompt_toolkit itself, but we should expose the APIs to make it possible to build this on top.)

@kenodegard
Copy link
Contributor Author

I have developed some relatively complex progress bars that contain a lot of information. For example, I have one example that does bulk downloads of files and upon downloading run some tests/post download process. In another example, I'm running a bulk SVN to Git migration where after cloning the SVN repo additional processing is done to clean up the repo prior to pushing. In other words, both of these processes contains a lot of different information. And when a process succeeds (or fails) I want to have an opportunity to inspect the bar prior to the bar being removed - hence a delayed remove.

I can agree that this feature could be better implemented as some kind of callable - that way it could be a conditional remove (e.g. only keep the last 5 bars or a time delay removal).

@kenodegard
Copy link
Contributor Author

closing in favor of #1025

@kenodegard kenodegard closed this Dec 12, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants