Insert a pause. Args: delay: Seconds to pause, or None to wait for cpu idle.
(self, delay: float | None = None)
| 533 | return True |
| 534 | |
| 535 | async def pause(self, delay: float | None = None) -> None: |
| 536 | """Insert a pause. |
| 537 | |
| 538 | Args: |
| 539 | delay: Seconds to pause, or None to wait for cpu idle. |
| 540 | """ |
| 541 | # These sleep zeros, are to force asyncio to give up a time-slice. |
| 542 | await self._wait_for_screen() |
| 543 | if delay is None: |
| 544 | await wait_for_idle(0) |
| 545 | else: |
| 546 | await asyncio.sleep(delay) |
| 547 | self.app.screen._on_timer_update() |
| 548 | |
| 549 | async def wait_for_animation(self) -> None: |
| 550 | """Wait for any current animation to complete.""" |