You've already forked MicroPythonOS
mirror of
https://github.com/m5stack/MicroPythonOS.git
synced 2026-05-20 11:51:27 -07:00
Simplify and fix settings app
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
from mpos.apps import Activity, ActivityNavigator, Intent
|
||||
from mpos.apps import Activity, Intent
|
||||
from mpos.navigator import ActivityNavigator
|
||||
|
||||
import mpos.config
|
||||
import mpos.ui
|
||||
|
||||
@@ -21,7 +21,7 @@ def good_stack_size():
|
||||
return stacksize
|
||||
|
||||
# Run the script in the current thread:
|
||||
def execute_script(script_source, is_file, cwd=None, classname=None, app=None):
|
||||
def execute_script(script_source, is_file, cwd=None, classname=None):
|
||||
import utime # for timing read and compile
|
||||
thread_id = _thread.get_ident()
|
||||
compile_name = 'script' if not is_file else script_source
|
||||
@@ -123,7 +123,7 @@ def start_app(fullname):
|
||||
print(f"WARNING: start_app can't start {fullname} because it doesn't have a main_launcher_activity")
|
||||
return
|
||||
start_script_fullpath = f"{app.installed_path}/{app.main_launcher_activity.get('entrypoint')}"
|
||||
execute_script(start_script_fullpath, True, app.installed_path + "/assets/", app.main_launcher_activity.get("classname"), app)
|
||||
execute_script(start_script_fullpath, True, app.installed_path + "/assets/", app.main_launcher_activity.get("classname"))
|
||||
# Launchers have the bar, other apps don't have it
|
||||
if app.is_valid_launcher():
|
||||
mpos.ui.topmenu.open_bar()
|
||||
@@ -143,4 +143,3 @@ def restart_launcher():
|
||||
start_app(app.fullname)
|
||||
break
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user