-
Notifications
You must be signed in to change notification settings - Fork 179
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
Multiple Progress Bar Support #31
Comments
Unfortunately this is not easy to achieve with the current design. The way it works is that it moves the cursor back and overwrites the text on the same line. I'm leaving this open in case anyone wants to give it a try. |
Actually I think the current design may be ok. In thinking more about this, DNF has a great example of using 1 progress bar to show multiple progress bars. It only shows 1 progress bar and rotates the name every second or 2 seconds maybe. For DNF I think the progress is on the download of all packages (say 100) even though only 4 will download concurrently. I guess we could do the same thing to aggregate all of the work for a collection of progress bars. I'm wondering what (if anything) needs to be added to this project to easily accomplish this aggregated progress bar use case. I hope to make a fake example of the dnf look and feel with the existing library to see how hard it is. I'll post my code back here. |
What do you think about making another parent class of Bar for Collection to which you could add Bars, and put the WritelnMixin onto the Collection, so that Collection would appropriately handle clearln (i.e., print('\r\x1b[K')), writeln, and finish for any child instances attached to it? Use would be something like: bars = Collection() I'm not sure I can work on this for the next few weeks, but in mid-March I could probably commit some time to working on it. |
Since these days I don't have much time to work on this, I'm generally hesitant merging big changes. If however you think you can pull this off with minimal disruption and in a backwards compatible way I would be interested in merging it. |
@saraislet would download_bar and install_bar be shown on top of each other? Or would it do the rotating bar style like dnf? I can see value in both. I don't understand much about how the line unwinding works and if that is capable of doing it for many lines or not. |
My new progressbar doesn't support this as well. I'm looking for inspiration in other projects, but it seems all of them have an open ticket for that, it's really no easy achievement... |
I am interested in having multiple progress bars work. Can someone give me a pointer on how to start on this? This is important when reporting the state of a pipeline which is doing a count of work at each stage but all stages are executing in parallel.
Here is an example of my current problem. I want to update both bars in one loop and then finalize them both using this code:
It produces this output:
You only are shown bar2 since it did it's update last. How can multiple bar support be added to this codebase?
The text was updated successfully, but these errors were encountered: