@@ -46,21 +46,26 @@ def onResume(self, screen):
4646 for dir_path in [apps_dir , apps_dir_builtin ]:
4747 try :
4848 if uos .stat (dir_path )[0 ] & 0x4000 : # Verify directory exists
49- for d in uos .listdir (dir_path ):
50- full_path = f"{ dir_path } /{ d } "
51- #print(f"full_path: {full_path}")
52- if uos .stat (full_path )[0 ] & 0x4000 : # Check if it's a directory
53- base_name = d
54- if base_name not in seen_base_names : # Avoid duplicates
55- seen_base_names .add (base_name )
56- app = mpos .apps .parse_manifest (f"{ full_path } /META-INF/MANIFEST.JSON" )
57- if app .category != "launcher" : # Skip launchers
58- main_launcher = mpos .apps .find_main_launcher_activity (app )
59- if main_launcher :
60- app_list .append ((app .name , full_path ))
49+ try :
50+ for d in uos .listdir (dir_path ):
51+ full_path = f"{ dir_path } /{ d } "
52+ #print(f"full_path: {full_path}")
53+ try :
54+ if uos .stat (full_path )[0 ] & 0x4000 : # Check if it's a directory
55+ base_name = d
56+ if base_name not in seen_base_names : # Avoid duplicates
57+ seen_base_names .add (base_name )
58+ app = mpos .apps .parse_manifest (f"{ full_path } /META-INF/MANIFEST.JSON" )
59+ if app .category != "launcher" : # Skip launchers
60+ main_launcher = mpos .apps .find_main_launcher_activity (app )
61+ if main_launcher :
62+ app_list .append ((app .name , full_path ))
63+ except OSError :
64+ print (f"launcher.py stat of { full_path } got OSError: { e } " )
65+ except OSError :
66+ print (f"launcher.py listdir of { dir_path } got OSError: { e } " )
6167 except OSError :
62- print (f"launcher.py got OSError: { e } " )
63- pass
68+ print (f"launcher.py stat of { dir_path } got OSError: { e } " )
6469
6570 import time
6671 start = time .ticks_ms ()
0 commit comments