From 3f2bd322e3f80b422dbba359dfaf8be4eed035d0 Mon Sep 17 00:00:00 2001 From: pmp-p Date: Fri, 7 Oct 2022 07:00:38 +0200 Subject: [PATCH] 0.4.0 release --- static/default.tmpl | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/static/default.tmpl b/static/default.tmpl index 0d83209..3136705 100644 --- a/static/default.tmpl +++ b/static/default.tmpl @@ -139,13 +139,22 @@ async def sitecustomize(): main = appdir / "assets" / "main.py" - + # start async top level machinery and add a console. await TopLevel_async_handler.start_toplevel(platform.shell, console=window.python.config.debug) + # get a relevant list of modules to import __file__ = main - await TopLevel_async_handler.async_imports(*TopLevel_async_handler.list_imports(None, main)) + + imports_ready = False + + async def imports(): + nonlocal imports_ready + await TopLevel_async_handler.async_imports(*TopLevel_async_handler.list_imports(None, main)) + imports_ready = True + await imports() + # test/wait user media interaction if not platform.window.MM.UME: @@ -165,8 +174,8 @@ async def sitecustomize(): while not platform.window.MM.UME: await asyncio.sleep(.1) - screen.fill( (0,0,0,0) ) - pygame.display.flip() + screen.fill( (0,0,0,0) ) + pygame.display.flip()