Rockhopper-Technologies / enlighten

Enlighten Progress Bar for Python Console Apps
https://python-enlighten.readthedocs.io
Mozilla Public License 2.0
416 stars 25 forks source link

Missing code example for a functionality #23

Closed jiwidi closed 4 years ago

jiwidi commented 4 years ago

Hi!

I'm reading your code examples and I can't find an example that replicates the behaviour of the processing bar in the following gif you attach on your readme https://raw.githubusercontent.com/Rockhopper-Technologies/enlighten/master/doc/_static/demo.gif

In the processing bar there is a subpar for each datacenter created, but this bar is temporary as it gets replaced with the one from the next datacenter.

Is there any code sample on how to do this?

avylove commented 4 years ago

All the demo code is the example example directory. The code you're specifically looking for is in examples/multiple_logging.py.

If you want a bar to be removed when it is closed, set leave=True as an option when calling Manager.counter() and call Counter.close() when the bar is no longer needed.

I'll add a note to the docs with the gif pointing to the examples and maybe a stand alone example.