Recommended way to have multiple progress bars & multiple status spinners active at the same time #3440
Unanswered
akhileshraju
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
My use case requires that I have a way to support multiple status spinners and progress bars active at the same time.
I followed the recipe from #1500 (comment) and came up with the below snippet.
This works as I expect to and shows up like so
MultipleProgressAndSpinner.mp4
Questions
Is this the recommended way to achieve multiple active progress & spinners?
Since there can be only one
Liveinstance active at any given time, I had to find a way to get theStatusandProgressclasses to use theLiveinstance that I am creating.Progressseems to already have a way to get the current console like below.rich/rich/progress.py
Line 1095 in e1e6d74
However,
Statusdoesn't seem to have any such provision.rich/rich/status.py
Line 39 in e1e6d74
So, I had to resort to overriding the
Status._liveattribute to get it to use theLiveinstance I am creating. I don't feel very comfortable override a "protected" member variable. Is this a safe approach? Alternatively, would the maintainers be willing to entertain a PR for gettingStatusto callget_console()when creating itsLiveinstance?NOTE - I see that
Progressis creating its ownLiveinstance different from the one I am creating, but that does seem to peacefully co-exist with theLiveI am creating. I assume that this is has something to do with theget_console()call within theLiveinstance creation inProgressBeta Was this translation helpful? Give feedback.
All reactions