Skip to content
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

Lazy-load the TUI #20

Merged
merged 7 commits into from
Jun 24, 2024
Merged

Lazy-load the TUI #20

merged 7 commits into from
Jun 24, 2024

Conversation

AnonymouX47
Copy link
Owner

@AnonymouX47 AnonymouX47 commented Jun 24, 2024

Load submodules of .tui, if and only if the TUI is launched.

Interestingly, I'm yet to perceive any significant (even if a little) performance implications.

- Change: Localize all non-stdlib imports.
- Change: Define `Loop` within `init()`.
- Change: Import `.tui` if and only of launching the TUI.
- Change: Use `BaseImage` instances in image lists instead of `Image`
  widget instances.
- Change: Reconfigure the TUI when initializing it instead of
  immediately after loading user config.
- Change: `.tui.main.quitting` -> `.tui.quitting`.

  Eliminates the need to load sub-modules of `.tui` in order to access
  the quitting status.
- Change: Import from `.tui` in `load()`, if and only if not skipping
  the TUI loading indication phase.
- Change: Do not import submodules of `.tui` at module level.
- Fix: Resolve circular imports caused by interdependencies between
  submodules of `.tui`.
- Fix: Change annotation of `.tui.main.loop` from `Loop` to
  `urwid.MainLoop`, since `Loop` is now defined within `.tui.init()`.
- Change: Remove unnecessary import of `.tui`.
@AnonymouX47 AnonymouX47 added the improvement Implementation of improvement to an existing feature label Jun 24, 2024
@AnonymouX47 AnonymouX47 added this to the 0.2.0 milestone Jun 24, 2024
@AnonymouX47 AnonymouX47 merged commit b2b768e into main Jun 24, 2024
16 checks passed
@AnonymouX47
Copy link
Owner Author

AnonymouX47 commented Jun 24, 2024

main was reset and the PR is superseded by #21.

@AnonymouX47 AnonymouX47 mentioned this pull request Jun 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
improvement Implementation of improvement to an existing feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant