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

Allow total to be updated after creation #250

Closed
JoeJoeTV opened this issue Aug 25, 2023 · 1 comment
Closed

Allow total to be updated after creation #250

JoeJoeTV opened this issue Aug 25, 2023 · 1 comment

Comments

@JoeJoeTV
Copy link

I have a program, where I'm downloading a file using the requests.urllib.urlretrieve method.
Currently, i'm using the report_hook argument to print the percentage using the logging module.

Now I want to integrate alive-progress with this, but the problem is, that the total size only gets passed to the report hook and the with block will of course be outside of the callback function, so I can't set the total at creation.

From the docstrings and README, I haven't found a way to update the total while the progress is running. (I apologize, If this is written there and I didn't see it)

Is this possible using this package or do I just have to use manual mode without a total?

Thanks in advance!

@rsalmei
Copy link
Owner

rsalmei commented Sep 27, 2023

No, this is not possible indeed.
You could either postpone the creation until you do know the total, or yeah just use manual mode.

There is a future feature that will do something like this, it is called Quantifying Mode. This will allow putting an alive-bar out and then changing/resetting it afterward, including from unknown to definite mode! It is in #59.

@rsalmei rsalmei closed this as completed Sep 27, 2023
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