Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit1f66f13

Browse files
Launcher app: improve error handling
Previously, a dead symlink would throw an error andprevent the other apps from showing up.
1 parent2932f37 commit1f66f13

File tree

1 file changed

+19
-14
lines changed
  • internal_filesystem/builtin/apps/com.micropythonos.launcher/assets

1 file changed

+19
-14
lines changed

‎internal_filesystem/builtin/apps/com.micropythonos.launcher/assets/launcher.py‎

Lines changed: 19 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -46,21 +46,26 @@ def onResume(self, screen):
4646
fordir_pathin [apps_dir,apps_dir_builtin]:
4747
try:
4848
ifuos.stat(dir_path)[0]&0x4000:# Verify directory exists
49-
fordinuos.listdir(dir_path):
50-
full_path=f"{dir_path}/{d}"
51-
#print(f"full_path: {full_path}")
52-
ifuos.stat(full_path)[0]&0x4000:# Check if it's a directory
53-
base_name=d
54-
ifbase_namenotinseen_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-
ifapp.category!="launcher":# Skip launchers
58-
main_launcher=mpos.apps.find_main_launcher_activity(app)
59-
ifmain_launcher:
60-
app_list.append((app.name,full_path))
49+
try:
50+
fordinuos.listdir(dir_path):
51+
full_path=f"{dir_path}/{d}"
52+
#print(f"full_path: {full_path}")
53+
try:
54+
ifuos.stat(full_path)[0]&0x4000:# Check if it's a directory
55+
base_name=d
56+
ifbase_namenotinseen_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+
ifapp.category!="launcher":# Skip launchers
60+
main_launcher=mpos.apps.find_main_launcher_activity(app)
61+
ifmain_launcher:
62+
app_list.append((app.name,full_path))
63+
exceptOSError:
64+
print(f"launcher.py stat of{full_path} got OSError:{e}")
65+
exceptOSError:
66+
print(f"launcher.py listdir of{dir_path} got OSError:{e}")
6167
exceptOSError:
62-
print(f"launcher.py got OSError:{e}")
63-
pass
68+
print(f"launcher.py stat of{dir_path} got OSError:{e}")
6469

6570
importtime
6671
start=time.ticks_ms()

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp