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

Commitc70ed72

Browse files
Simplify is_launcher
1 parent3828a5f commitc70ed72

File tree

2 files changed

+5
-8
lines changed

2 files changed

+5
-8
lines changed

‎internal_filesystem/lib/mpos/apps.py‎

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ def start_app(fullname):
122122
start_script_fullpath=f"{app.installed_path}/{app.main_launcher_activity.get('entrypoint')}"
123123
execute_script(start_script_fullpath,True,app.installed_path+"/assets/",app.main_launcher_activity.get("classname"))
124124
# Launchers have the bar, other apps don't have it
125-
ifPackageManager.is_launcher(fullname):
125+
ifPackageManager.is_valid_launcher(app):
126126
mpos.ui.topmenu.open_bar()
127127
else:
128128
mpos.ui.topmenu.close_bar()
@@ -135,12 +135,10 @@ def restart_launcher():
135135
mpos.ui.empty_screen_stack()
136136
# No need to stop the other launcher first, because it exits after building the screen
137137
forappinmpos.package_manager.PackageManager.get_app_list():
138-
#print(f"checking {app}")
139-
ifapp.category=="launcher"andapp.main_launcher_activity:# if it's a launcher and it has a main_launcher_activity
138+
ifPackageManager.is_valid_launcher(app):
140139
print(f"Found launcher, starting{app.fullname}")
141140
start_app(app.fullname)
142141

143-
144142
classApp:
145143
def__init__(self,name,publisher,short_description,long_description,icon_url,download_url,fullname,version,category,activities,installed_path=None):
146144
self.name=name

‎internal_filesystem/lib/mpos/package_manager.py‎

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,6 @@ def is_installed_by_name(app_fullname):
221221
returnPackageManager.is_installed_by_path(f"apps/{app_fullname}")orPackageManager.is_installed_by_path(f"builtin/apps/{app_fullname}")
222222

223223
@staticmethod
224-
defis_launcher(app_name):
225-
print(f"checking is_launcher for{app_name}")
226-
# Simple check, could be more elaborate by checking the MANIFEST.JSON for the app...
227-
return"launcher"inapp_nameorlen(mpos.ui.screen_stack)<2# assumes the first one on the stack is the launcher
224+
defis_valid_launcher(app_obj):
225+
#print(f"checking is_valid_launcher for {app_obj}")
226+
returnapp_obj.category=="launcher"andapp_obj.main_launcher_activity

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp