Misc update and fixes /o\

This commit is contained in:
Alexandre Aubin 2023-06-11 14:34:22 +02:00
parent f718e5be53
commit e6edec84db
4 changed files with 10 additions and 6 deletions

View file

@ -47,7 +47,7 @@ class AppCatalog():
if isinstance(maintainers_info, list): if isinstance(maintainers_info, list):
known_app.maintainers = [ maintainer["name"] for maintainer in maintainers_info ] known_app.maintainers = [ maintainer["name"] for maintainer in maintainers_info ]
known_app.maintained = 'package-not-maintained' not in app.get('antifeatures', []), known_app.maintained = 'package-not-maintained' not in app.get('antifeatures', [])
known_app.state = app["state"] known_app.state = app["state"]
known_app.public_level = app.get("level", None) known_app.public_level = app.get("level", None)

View file

@ -23,7 +23,7 @@ class AppCIBranch(db.Model):
arch="amd64", arch="amd64",
branch="stable", branch="stable",
display_name='Stable (x86)', display_name='Stable (x86)',
url='https://ci-apps.yunohost.org/ci/logs/list_level_stable_amd64.json', url='https://ci-apps.yunohost.org/ci/api/results',
url_per_app='https://ci-apps.yunohost.org/ci/apps/{}/latestjob') url_per_app='https://ci-apps.yunohost.org/ci/apps/{}/latestjob')
yield AppCIBranch(name='unstable', yield AppCIBranch(name='unstable',

View file

@ -2,6 +2,7 @@ import requests
import json import json
import datetime import datetime
import os import os
import toml
from .. import db from .. import db
@ -24,7 +25,7 @@ class UnlistedApp(db.Model):
UnlistedApp.query.delete() UnlistedApp.query.delete()
community = json.loads(requests.get("https://raw.githubusercontent.com/YunoHost/apps/master/apps.json").text) community = toml.loads(requests.get("https://raw.githubusercontent.com/YunoHost/apps/master/apps.toml").text)
known_apps = set() known_apps = set()
known_apps = known_apps.union([os.path.basename(app["url"]).lower() for app in community.values() ]) known_apps = known_apps.union([os.path.basename(app["url"]).lower() for app in community.values() ])

View file

@ -1,4 +1,4 @@
import toml
import json import json
import os import os
import sys import sys
@ -63,9 +63,12 @@ def get_lists_history():
merged.update(official) merged.update(official)
else: else:
try: try:
merged = json.loads(open("./.work/apps/apps.json").read()) merged = toml.loads(open("./.work/apps/apps.toml").read())
except: except:
pass try:
merged = json.loads(open("./.work/apps/apps.json").read())
except:
pass
# Save it # Save it
json.dump(merged, open('./.work/merged_lists.json.%s' % t.strftime("%y-%m-%d"), 'w')) json.dump(merged, open('./.work/merged_lists.json.%s' % t.strftime("%y-%m-%d"), 'w'))