mirror of
https://github.com/Textualize/textual.git
synced 2025-10-17 02:38:12 +03:00
more reliable pause (#1993)
This commit is contained in:
@@ -71,7 +71,7 @@ Build sophisticated user interfaces with a simple Python API. Run your apps in t
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
```{.textual path="examples/calculator.py" columns=100 lines=41 press="3,.,1,4,5,9,2,_,_,_,_,_,_,_,_"}
|
```{.textual path="examples/calculator.py" columns=100 lines=41 press="3,.,1,4,5,9,2,wait:400"}
|
||||||
```
|
```
|
||||||
|
|
||||||
```{.textual path="examples/pride.py"}
|
```{.textual path="examples/pride.py"}
|
||||||
|
|||||||
@@ -868,6 +868,8 @@ class App(Generic[ReturnType], DOMNode):
|
|||||||
_, wait_ms = key.split(":")
|
_, wait_ms = key.split(":")
|
||||||
print(f"(pause {wait_ms}ms)")
|
print(f"(pause {wait_ms}ms)")
|
||||||
await asyncio.sleep(float(wait_ms) / 1000)
|
await asyncio.sleep(float(wait_ms) / 1000)
|
||||||
|
await app._animator.wait_until_complete()
|
||||||
|
await wait_for_idle(0)
|
||||||
else:
|
else:
|
||||||
if len(key) == 1 and not key.isalnum():
|
if len(key) == 1 and not key.isalnum():
|
||||||
key = _character_to_key(key)
|
key = _character_to_key(key)
|
||||||
|
|||||||
Reference in New Issue
Block a user