From cac3900825c91f7139448c5453e51013801eae5c Mon Sep 17 00:00:00 2001 From: Thomas Farstrike Date: Thu, 5 Jun 2025 00:32:49 +0200 Subject: [PATCH] appstore: move to onResume() --- .../apps/com.micropythonos.appstore/assets/appstore.py | 5 ++++- internal_filesystem/lib/mpos/apps.py | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/internal_filesystem/builtin/apps/com.micropythonos.appstore/assets/appstore.py b/internal_filesystem/builtin/apps/com.micropythonos.appstore/assets/appstore.py index d0bc22f7..7b2b0cbb 100644 --- a/internal_filesystem/builtin/apps/com.micropythonos.appstore/assets/appstore.py +++ b/internal_filesystem/builtin/apps/com.micropythonos.appstore/assets/appstore.py @@ -29,7 +29,9 @@ class AppStore(Activity): self.please_wait_label.center() self.setContentView(self.main_screen) - def onStart(self, screen): + def onResume(self, screen): + if len(self.apps): + return try: import network except Exception as e: @@ -46,6 +48,7 @@ class AppStore(Activity): print("appstore.py ending") def download_app_index(self, json_url): + #time.sleep(5) try: response = requests.get(json_url, timeout=10) except Exception as e: diff --git a/internal_filesystem/lib/mpos/apps.py b/internal_filesystem/lib/mpos/apps.py index 55458910..1e0cd757 100644 --- a/internal_filesystem/lib/mpos/apps.py +++ b/internal_filesystem/lib/mpos/apps.py @@ -25,7 +25,7 @@ def execute_script(script_source, is_file, cwd=None, classname=None): try: if is_file: print(f"Thread {thread_id}: reading script from file {script_source}") - with open(script_source, 'r') as f: # TODO: check if file exists first? + with open(script_source, 'r') as f: # No need to check if it exists as exceptions are caught script_source = f.read() script_globals = { 'lv': lv,