mirror of
https://github.com/Textualize/textual.git
synced 2025-10-17 02:38:12 +03:00
force updates
This commit is contained in:
@@ -139,20 +139,22 @@ class Pilot(Generic[ReturnType]):
|
|||||||
delay: Seconds to pause, or None to wait for cpu idle.
|
delay: Seconds to pause, or None to wait for cpu idle.
|
||||||
"""
|
"""
|
||||||
# These sleep zeros, are to force asyncio to give up a time-slice,
|
# These sleep zeros, are to force asyncio to give up a time-slice,
|
||||||
self.app.screen._on_timer_update() # Force one last repaint
|
|
||||||
if delay is None:
|
if delay is None:
|
||||||
await wait_for_idle(0)
|
await wait_for_idle(0)
|
||||||
else:
|
else:
|
||||||
await asyncio.sleep(delay)
|
await asyncio.sleep(delay)
|
||||||
|
self.app.screen._on_timer_update()
|
||||||
|
|
||||||
async def wait_for_animation(self) -> None:
|
async def wait_for_animation(self) -> None:
|
||||||
"""Wait for any current animation to complete."""
|
"""Wait for any current animation to complete."""
|
||||||
await self._app.animator.wait_for_idle()
|
await self._app.animator.wait_for_idle()
|
||||||
|
self.app.screen._on_timer_update()
|
||||||
|
|
||||||
async def wait_for_scheduled_animations(self) -> None:
|
async def wait_for_scheduled_animations(self) -> None:
|
||||||
"""Wait for any current and scheduled animations to complete."""
|
"""Wait for any current and scheduled animations to complete."""
|
||||||
await self._app.animator.wait_until_complete()
|
await self._app.animator.wait_until_complete()
|
||||||
await wait_for_idle()
|
await wait_for_idle()
|
||||||
|
self.app.screen._on_timer_update()
|
||||||
|
|
||||||
async def exit(self, result: ReturnType) -> None:
|
async def exit(self, result: ReturnType) -> None:
|
||||||
"""Exit the app with the given result.
|
"""Exit the app with the given result.
|
||||||
|
|||||||
Reference in New Issue
Block a user