Skip to content

Commit

Permalink
polish
Browse files Browse the repository at this point in the history
  • Loading branch information
willmcgugan committed Jun 24, 2024
1 parent ee71b34 commit b40387d
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,14 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](http://keepachangelog.com/)
and this project adheres to [Semantic Versioning](http://semver.org/).

## Unreleased

### Changed

- Breaking change: `App.push_screen` now returns an Awaitable rather than a screen. https://github.com/Textualize/textual/pull/4672
- Breaking change: `Screen.dismiss` now returns an Awaitable rather than a bool. https://github.com/Textualize/textual/pull/4672


## [0.70.0] - 2024-06-19

### Fixed
Expand Down
6 changes: 4 additions & 2 deletions src/textual/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -1938,7 +1938,8 @@ def remove_mode(self, mode: str) -> AwaitComplete:
stack = self._screen_stacks[mode]
del self._screen_stacks[mode]

async def remove_screens():
async def remove_screens() -> None:
"""Remove screens."""
for screen in reversed(stack):
await self._replace_screen(screen)

Expand Down Expand Up @@ -2173,6 +2174,7 @@ def switch_screen(self, screen: Screen | str) -> AwaitComplete:
)

async def do_switch() -> None:
"""Task to perform switch."""
next_screen, await_mount = self._get_screen(screen)
if screen is self.screen or next_screen is self.screen:
self.log.system(f"Screen {screen} is already current.")
Expand Down Expand Up @@ -2264,6 +2266,7 @@ def pop_screen(self) -> AwaitComplete:
)

async def do_pop() -> None:
"""Task to pop the screen."""
previous_screen = await self._replace_screen(screen_stack.pop())
previous_screen._pop_result_callback()
self.screen.post_message(events.ScreenResume())
Expand Down Expand Up @@ -2370,7 +2373,6 @@ def _handle_exception(self, error: Exception) -> None:
Args:
error: An exception instance.
"""
self.log.error(error)
self._return_code = 1
# If we're running via pilot and this is the first exception encountered,
# take note of it so that we can re-raise for test frameworks later.
Expand Down

0 comments on commit b40387d

Please sign in to comment.