From 63c2b653dbcd24a55ae7bd7b4301ae9cfefd4e1d Mon Sep 17 00:00:00 2001 From: Thomas Farstrike Date: Sat, 19 Apr 2025 22:34:06 +0200 Subject: [PATCH] Simplify --- appstore.py | 26 +++++--------------------- 1 file changed, 5 insertions(+), 21 deletions(-) diff --git a/appstore.py b/appstore.py index 5cad2034..b20aca2b 100644 --- a/appstore.py +++ b/appstore.py @@ -438,12 +438,12 @@ async def execute_script(script_source, lvgl_obj): print("Child script: Compiling") code = compile(script_source, "", "exec") exec(code, script_globals) - update_child = script_globals.get('update_child') - if update_child: - print("Child script: Starting update_child") + app_main = script_globals.get('app_main') + if app_main: + print("Child script: Starting app_main") await app_main() else: - print("Child script error: No update_child function defined") + print("Child script error: No app_main function defined") except Exception as e: print("Child script error:", e) @@ -489,20 +489,4 @@ async def app_main(): """ -# Main async function to run all tasks -async def main(): - print("Main: Starting tasks") - #asyncio.create_task(update_parent()) - asyncio.create_task(execute_script(script_buffer, subwindow)) - while True: - await asyncio.sleep_ms(100) - - -# Run the event loop -gc.collect() -print("Free memory before loop:", gc.mem_free()) -try: - asyncio.run(main()) -except Exception as e: - print("Main error:", e) - +asyncio.run(execute_script(script_buffer, subwindow))