mirror of
https://github.com/YunoHost/apps.git
synced 2024-09-03 20:06:07 +02:00
Add specific catalog file for the catalog in new documentation
This commit is contained in:
parent
c11756cb44
commit
10f297c8c1
1 changed files with 24 additions and 0 deletions
|
@ -178,6 +178,30 @@ def build_catalog():
|
|||
with open("./builds/default/v0/community.json", 'w') as f:
|
||||
f.write(json.dumps(community_apps_dict, sort_keys=True))
|
||||
|
||||
##############################
|
||||
# Version for catalog in doc #
|
||||
##############################
|
||||
categories = yaml.load(open("categories.yml").read())
|
||||
os.system("mkdir -p ./builds/default/doc_catalog")
|
||||
def infos_for_doc_catalog(infos):
|
||||
level = infos.get("level")
|
||||
if not isinstance(level, int):
|
||||
level = -1
|
||||
return {
|
||||
"id": infos["id"],
|
||||
"category": infos["category"],
|
||||
"url": infos["git"]["url"],
|
||||
"name": infos["manifest"]["name"],
|
||||
"description": infos["manifest"]["description"],
|
||||
"state": infos["state"],
|
||||
"good_quality": level >= 8,
|
||||
"bad_quality": level <= 5,
|
||||
}
|
||||
result_dict_doc = {k: infos_for_doc_catalog(v) for k, v in result_dict.items() if v["state"] == "working"}
|
||||
with open("builds/default/doc_catalog/apps.json", 'w') as f:
|
||||
f.write(json.dumps({"apps": result_dict_doc, "categories": categories}, sort_keys=True))
|
||||
|
||||
|
||||
|
||||
def build_app_dict(app, infos):
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue