-
-
Notifications
You must be signed in to change notification settings - Fork 296
Show loading screen in urwid. #667
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
base: main
Are you sure you want to change the base?
Conversation
|
Making a new PR for this. Adding tests. |
0165cc0 to
89df998
Compare
89df998 to
bc62995
Compare
|
@kaustubh-nair I tried this out manually and it looks great! 👌 |
|
@kaustubh-nair I replied on the stream about this - functionally this does what we want, but the structure is a little confusing and smaller commits may help explain which changes you're making and why. It's great that you're picking up others' older PRs and moving them forward, but it can be challenging precisely since they're not your code Some aspects to consider:
|
38b0209 to
3a5ce6a
Compare
3a5ce6a to
4ea702d
Compare
This is done so that it can be later run asynchronously by introducing an intermediate view for loading.
Display LoadingView during startup. This blocks the settings shown in stdout while loading which will be added in the subsequent commits.
Stop showing loading settings for theme and autohide to stdout and use the LoadingView instead. Note that in case of invalid settings, output would still be displayed to stdout. Tests amended.
4ea702d to
4ae1f2a
Compare
sumanthvrao
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@kaustubh-nair Thanks for rebasing 👍 .
Additionally, I think this may avoid the UI distort race issue which we have seen in the past. I left a couple of commits but looks good overall.
| for cursor in '|/-\\': | ||
| yield cursor | ||
|
|
||
| self.capture_stdout() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need to capture stdout here again? We already do this now in the previous commit in the __init__ stage itself.
|
|
||
| def set_spinner(self, spinner: str) -> None: | ||
| self.base_widget.set_text(self.text + [spinner]) | ||
| self.body.base_widget.set_text(self.text + [spinner]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this something necessary for this commit? Couldn't we move this to the previous commit where you introduce the set_spinner class?
| def deregister_client(self) -> None: | ||
| queue_id = self.model.queue_id | ||
| self.client.deregister(queue_id, 1.0) | ||
| # Deregister before model has loaded. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this necessary in this commit?
|
Heads up @kaustubh-nair, we just merged some commits that conflict with the changes your made in this pull request! You can review this repository's recent commits to see where the conflicts occur. Please rebase your feature branch against the |
These commits are not perfectly isolated, because there are a lot of things to be done here:
LoadingViewfirst and runModelandViewinitialization asynchronously.run.pytoLoadingViewControllertoLoadingView