Handle invalid syntax in some local app's manifest during initial apps listing
This commit is contained in:
parent
51dd818445
commit
ae6b32c786
1 changed files with 10 additions and 7 deletions
|
@ -57,7 +57,7 @@ def get_github() -> tuple[tuple[str, str] | None, github.Github | None, github.I
|
||||||
return None, None, None
|
return None, None, None
|
||||||
|
|
||||||
|
|
||||||
def apps_to_run_auto_update_for():
|
def apps_to_run_auto_update_for() -> list[str]:
|
||||||
apps_flagged_as_working_and_on_yunohost_apps_org = [
|
apps_flagged_as_working_and_on_yunohost_apps_org = [
|
||||||
app
|
app
|
||||||
for app, infos in get_catalog().items()
|
for app, infos in get_catalog().items()
|
||||||
|
@ -67,12 +67,15 @@ def apps_to_run_auto_update_for():
|
||||||
|
|
||||||
relevant_apps = []
|
relevant_apps = []
|
||||||
for app in apps_flagged_as_working_and_on_yunohost_apps_org:
|
for app in apps_flagged_as_working_and_on_yunohost_apps_org:
|
||||||
manifest_toml = app_cache_folder(app) / "manifest.toml"
|
try:
|
||||||
if manifest_toml.exists():
|
manifest_toml = app_cache_folder(app) / "manifest.toml"
|
||||||
manifest = toml.load(manifest_toml.open("r", encoding="utf-8"))
|
if manifest_toml.exists():
|
||||||
sources = manifest.get("resources", {}).get("sources", {})
|
manifest = toml.load(manifest_toml.open("r", encoding="utf-8"))
|
||||||
if any("autoupdate" in source for source in sources.values()):
|
sources = manifest.get("resources", {}).get("sources", {})
|
||||||
relevant_apps.append(app)
|
if any("autoupdate" in source for source in sources.values()):
|
||||||
|
relevant_apps.append(app)
|
||||||
|
except Exception as e:
|
||||||
|
print(f"Error while loading {app}'s manifest: {e}")
|
||||||
return relevant_apps
|
return relevant_apps
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue