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

Support callables in App.SCREENS #1185

Merged
merged 5 commits into from
Nov 16, 2022
Merged

Support callables in App.SCREENS #1185

merged 5 commits into from
Nov 16, 2022

Conversation

darrenburns
Copy link
Member

@darrenburns darrenburns commented Nov 15, 2022

Allows you to pass callables rather than Screen instances.

@darrenburns darrenburns changed the title Support Type[Screen] in App.SCREENS (lazy screens) Support callables in App.SCREENS Nov 15, 2022
@darrenburns darrenburns marked this pull request as ready for review November 15, 2022 14:34
@@ -1532,14 +1536,14 @@ async def _close_all(self) -> None:

# Close all screens on the stack
for screen in self._screen_stack:
if screen._running:
if isinstance(screen, Screen) and screen._running:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are we going to have something on the Screen stack that is not a screen?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, good catch. Have removed this isinstance check

@darrenburns darrenburns merged commit e32e094 into main Nov 16, 2022
@darrenburns darrenburns deleted the lazy-screens branch November 16, 2022 15:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants