WIP on stepwise undo app lifecycle spaghetti code

This commit is contained in:
Isaiah Odhner 2023-09-09 16:35:44 -04:00
parent 961e9a1560
commit 74c3c49eb7

View File

@ -81,14 +81,17 @@ async def replay_steps() -> None:
assert app is not None, "app should be set by now" assert app is not None, "app should be set by now"
# for event, offset, selector, index in steps: # for event, offset, selector, index in steps:
# ... # ...
if not steps:
return
pilot = Pilot(app) pilot = Pilot(app)
await pilot._wait_for_screen() # await pilot._wait_for_screen()
await async_exec(get_replay_code()) # await async_exec(get_replay_code())
def run() -> None: def run() -> None:
global app, next_after_exit global app, next_after_exit
def startup_and_replay() -> None: def startup_and_replay() -> None:
global app, next_after_exit global app, next_after_exit
next_after_exit = None # important to allowing you to exit; don't keep launching the app
app = PaintApp() app = PaintApp()
app.on_event = on_event.__get__(app) app.on_event = on_event.__get__(app)