From 632e46b73b5830e02f92e95a9202683f71bbf4cd Mon Sep 17 00:00:00 2001 From: Thomas Farstrike Date: Fri, 25 Apr 2025 09:17:56 +0200 Subject: [PATCH] Change Main-Script to Start-Script --- apps/com.example.launcher/META-INF/MANIFEST.MF | 1 + .../assets/{main.py => launcher.py} | 0 apps/com.example.wstest/META-INF/MANIFEST.MF | 2 +- main.py | 14 +++++++------- 4 files changed, 9 insertions(+), 8 deletions(-) rename apps/com.example.launcher/assets/{main.py => launcher.py} (100%) diff --git a/apps/com.example.launcher/META-INF/MANIFEST.MF b/apps/com.example.launcher/META-INF/MANIFEST.MF index 78bd472c..c08c5829 100644 --- a/apps/com.example.launcher/META-INF/MANIFEST.MF +++ b/apps/com.example.launcher/META-INF/MANIFEST.MF @@ -1,2 +1,3 @@ Manifest-Version: 1.0 Name: Launcher +Start-Script: assets/launcher.py diff --git a/apps/com.example.launcher/assets/main.py b/apps/com.example.launcher/assets/launcher.py similarity index 100% rename from apps/com.example.launcher/assets/main.py rename to apps/com.example.launcher/assets/launcher.py diff --git a/apps/com.example.wstest/META-INF/MANIFEST.MF b/apps/com.example.wstest/META-INF/MANIFEST.MF index 7d46d4e9..86e7443a 100644 --- a/apps/com.example.wstest/META-INF/MANIFEST.MF +++ b/apps/com.example.wstest/META-INF/MANIFEST.MF @@ -1,3 +1,3 @@ Manifest-Version: 1.0 Name: WSTest -Main-Script: assets/bitcoin_price.py +Start-Script: assets/bitcoin_price.py diff --git a/main.py b/main.py index b1e02d45..e849fe57 100644 --- a/main.py +++ b/main.py @@ -239,18 +239,18 @@ import uio def parse_manifest(manifest_path): name = "Unknown" - main_script = "assets/main.py" + start_script = "assets/start.py" try: with uio.open(manifest_path, 'r') as f: for line in f: line = line.strip() if line.startswith("Name:"): name = line.split(":", 1)[1].strip() - elif line.startswith("Main-Script:"): - main_script = line.split(":", 1)[1].strip() + elif line.startswith("Start-Script:"): + start_script = line.split(":", 1)[1].strip() except OSError: print(f"Error reading {manifest_path}") - return name, main_script + return name, start_script def long_path_to_filename(path): try: @@ -315,9 +315,9 @@ def execute_script_new_thread(scriptname, is_file, return_to_launcher): def start_app(app_dir, return_to_launcher=True): print(f"/main.py start_app({app_dir},{return_to_launcher}") manifest_path = f"{app_dir}/META-INF/MANIFEST.MF" - app_name, main_script = parse_manifest(manifest_path) - main_script_fullpath = f"{app_dir}/{main_script}" - execute_script_new_thread(main_script_fullpath, True, return_to_launcher) + app_name, start_script = parse_manifest(manifest_path) + start_script_fullpath = f"{app_dir}/{start_script}" + execute_script_new_thread(start_script_fullpath, True, return_to_launcher) def run_launcher(): start_app("/apps/com.example.launcher", False)