Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for setting/changing total after creation #43

Open
jonhoo opened this issue Jan 31, 2017 · 1 comment
Open

Add support for setting/changing total after creation #43

jonhoo opened this issue Jan 31, 2017 · 1 comment

Comments

@jonhoo
Copy link

jonhoo commented Jan 31, 2017

In some cases, like HTTP downloads (see progress_function in libcurl for example), you may not know the size of the download until after you have been in touch with the remote server. But you may still want to create the progress bar to show that things are happening. Once the connection is established, and the Content-Length header has been received, the total for the progress bar can be set, and progress can be logged.

It'd be great if pb offered a way to create a new, "indeterminate" progress bar, and then allow for the total to be set afterwards.

@stbuehler
Copy link

Just for the record: you CAN change total afterwards (the struct field is directly accessible). Call tick manually afterwards if you don't also change the current value (inc, set, add).

I didn't test it, but I guess you can also change the show_* fields in a similar fashion, e.g. only start showing a timer later.

What did you try so far?

Was this only an issue in an older version?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants