11import task_handler
22import _thread
33import lvgl as lv
4- import mpos
4+
55import mpos .apps
6- import mpos .config
76import mpos .ui
8-
9- from .content .package_manager import PackageManager
10- from .ui .appearance_manager import AppearanceManager
11- from .ui .display_metrics import DisplayMetrics
12-
137import mpos .ui .topmenu
14- from .task_manager import TaskManager
158
9+ from mpos import AppearanceManager , DisplayMetrics , PackageManager , SharedPreferences , TaskManager
1610
1711# White text on black logo works (for dark mode) and can be inverted (for light mode)
1812logo_white = "M:builtin/res/mipmap-mdpi/MicroPythonOS-logo-white-long-w296.png" # from the MPOS-logo repo
@@ -80,7 +74,7 @@ def detect_board():
8074fs_drv = lv .fs_drv_t ()
8175mpos .fs_driver .fs_register (fs_drv , 'M' )
8276
83- prefs = mpos . config . SharedPreferences ("com.micropythonos.settings" )
77+ prefs = SharedPreferences ("com.micropythonos.settings" )
8478
8579AppearanceManager .init (prefs )
8680init_rootscreen ()
@@ -145,7 +139,7 @@ def custom_exception_handler(e):
145139async def asyncio_repl ():
146140 print ("Starting very limited asyncio REPL task. To stop all asyncio tasks and go to real REPL, do: import mpos ; mpos.TaskManager.stop()" )
147141 await aiorepl .task ()
148- mpos . TaskManager .create_task (asyncio_repl ()) # only gets started when mpos. TaskManager.start() is created
142+ TaskManager .create_task (asyncio_repl ()) # only gets started after TaskManager.start()
149143
150144async def ota_rollback_cancel ():
151145 try :
@@ -157,11 +151,11 @@ async def ota_rollback_cancel():
157151if not started_launcher :
158152 print (f"WARNING: launcher { launcher_app } failed to start, not cancelling OTA update rollback" )
159153else :
160- mpos . TaskManager .create_task (ota_rollback_cancel ()) # only gets started when mpos. TaskManager() is created
154+ TaskManager .create_task (ota_rollback_cancel ()) # only gets started after TaskManager.start()
161155
162156try :
163- mpos . TaskManager .start () # do this at the end because it doesn't return
157+ TaskManager .start () # do this at the end because it doesn't return
164158except KeyboardInterrupt as k :
165- print (f"mpos. TaskManager() got KeyboardInterrupt, falling back to REPL shell..." ) # only works if no aiorepl is running
159+ print (f"TaskManager.start () got KeyboardInterrupt, falling back to REPL shell..." ) # only works if no aiorepl is running
166160except Exception as e :
167- print (f"mpos. TaskManager() got exception: { e } " )
161+ print (f"TaskManager.start () got exception: { e } " )
0 commit comments