diff --git a/CHANGELOG.md b/CHANGELOG.md index 312595a10..18c26b55a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,13 +1,12 @@ # Change Log - 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.6.0] +## [0.6.0] - Unreleased ### Added @@ -18,7 +17,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/). - Rebuilt `DirectoryTree` with new `Tree` control. -## [0.5.0] - Unreleased +## [0.5.0] - 2022-11-20 ### Added diff --git a/docs/blog/posts/steal-this-code.md b/docs/blog/posts/steal-this-code.md index 2e2053d4a..124a54794 100644 --- a/docs/blog/posts/steal-this-code.md +++ b/docs/blog/posts/steal-this-code.md @@ -67,7 +67,7 @@ Here's a quick example of its use. It works like a dictionary until you reach a {'bar': 2, 'baz': 3, 'egg': 4} ``` -In Textual, we use a [LRUCache](https://github.com/Textualize/textual/search?q=LRUCache) to store the results of rendering content to the terminal. For example, in a [datatable](https://twitter.com/search?q=%23textualdatatable) it is too costly to render everything up front. So Textual renders only the lines that are currently visible on the "screen". The cache ensures that scrolling only needs to render the newly exposed lines, and lines that haven't been displayed in a while are discarded to save memory. +In Textual, we use a [LRUCache](https://github.com/Textualize/textual/search?q=LRUCache) to store the results of rendering content to the terminal. For example, in a [datatable](https://twitter.com/search?q=%23textualdatatable&src=typed_query&f=live) it is too costly to render everything up front. So Textual renders only the lines that are currently visible on the "screen". The cache ensures that scrolling only needs to render the newly exposed lines, and lines that haven't been displayed in a while are discarded to save memory. ## Color diff --git a/pyproject.toml b/pyproject.toml index bf55b935b..56cdb4b80 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -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 "] diff --git a/src/textual/app.py b/src/textual/app.py index 0e22d3869..27fbc352a 100644 --- a/src/textual/app.py +++ b/src/textual/app.py @@ -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: diff --git a/src/textual/message_pump.py b/src/textual/message_pump.py index 615ec0742..9d28f738b 100644 --- a/src/textual/message_pump.py +++ b/src/textual/message_pump.py @@ -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