Merge pull request #1236 from Textualize/bump050

bumped version
This commit is contained in:
Will McGugan
2022-11-20 16:45:13 +00:00
committed by GitHub
4 changed files with 6 additions and 6 deletions

View File

@@ -6,7 +6,7 @@ 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/).
## [0.5.0] - Unreleased
## [0.5.0] - 2022-11-20
### Added

View File

@@ -1,6 +1,6 @@
[tool.poetry]
name = "textual"
version = "0.4.0"
version = "0.5.0"
homepage = "https://github.com/Textualize/textual"
description = "Modern Text User Interface framework"
authors = ["Will McGugan <will@textualize.io>"]

View File

@@ -2011,7 +2011,7 @@ class App(Generic[ReturnType], DOMNode):
for children in reversed(node_children):
# Closing children can be done asynchronously.
close_messages = [
child._close_messages() for child in children if child._running
child._close_messages(wait=True) for child in children if child._running
]
# TODO: What if a message pump refuses to exit?
if close_messages:
@@ -2019,7 +2019,7 @@ class App(Generic[ReturnType], DOMNode):
for child in children:
self._unregister(child)
await root._close_messages()
await root._close_messages(wait=False)
self._unregister(root)
async def action_check_bindings(self, key: str) -> None:

View File

@@ -284,7 +284,7 @@ class MessagePump(metaclass=MessagePumpMeta):
async def _on_close_messages(self, message: messages.CloseMessages) -> None:
await self._close_messages()
async def _close_messages(self) -> None:
async def _close_messages(self, wait: bool = True) -> None:
"""Close message queue, and optionally wait for queue to finish processing."""
if self._closed or self._closing:
return
@@ -296,7 +296,7 @@ class MessagePump(metaclass=MessagePumpMeta):
await self._message_queue.put(events.Unmount(sender=self))
Reactive._reset_object(self)
await self._message_queue.put(None)
if self._task is not None and asyncio.current_task() != self._task:
if wait and self._task is not None and asyncio.current_task() != self._task:
# Ensure everything is closed before returning
await self._task