-
-
Notifications
You must be signed in to change notification settings - Fork 211
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
Using the progress without the with statement #99
Comments
Hello @RobinFrcd, In the new yet unreleased 2.0 you can: from alive_progress import alive_it
for item in alive_it(items): # <<-- wrapped items
print(item) # process each item If you want to test it, before I release it, you can: pip install git+https://github.com/rsalmei/alive-progress.git@rsa-refac |
Well, I'm going to assume it did work. |
Thank you for your answer! Sorry for the late reply, I've only been able to test it today, but I've an issue with this version (with both alive_bar and alive_it):
Is it a known bug in this version ? Thanks |
No problem, you're welcome. But wow, that's very weird. Can you please write a minimal code that triggers this error? |
My company uses a custom logger wrapper. I just realized this bug happens only when I'm using this custom logger and not the vanilla one. I guess I'll have to take a look at our own logger then! Thanks! Alright, it's related to coloredlogs import coloredlogs, logging
from alive_progress import alive_it
LOGGER = logging.getLogger(__name__)
coloredlogs.install(level="DEBUG")
coloredlogs.install(level="DEBUG", logger=LOGGER)
if __name__ == "__main__":
for e in alive_it(range(5)):
print(e) This package seems almost abandoned now, maybe we should consider removing this dependency |
Wow, that's it. Since Python 3.7, StreamHandler has this setStream method, and that implementation simply breaks it... On a quick look, you should try to avoid that coloredlogs' |
Nice, hope they fix that. |
Hello,
I know with statements are great in some cases, but I also like to have my code with as less indents blocks as possible.
Is it possible to use the package without the with statement ? With a wrapper function over the generator I'm looping over.
Thanks!
The text was updated successfully, but these errors were encountered: