mirror of
https://github.com/YunoHost/yunodevtools.git
synced 2024-09-03 20:16:19 +02:00
Ontegrate app categories into apps.json ...
This commit is contained in:
parent
98c5ffe1c6
commit
3d1ca85555
1 changed files with 24 additions and 15 deletions
|
@ -7,6 +7,7 @@ import json
|
||||||
import zlib
|
import zlib
|
||||||
import argparse
|
import argparse
|
||||||
import subprocess
|
import subprocess
|
||||||
|
import yaml
|
||||||
|
|
||||||
import requests
|
import requests
|
||||||
from dateutil.parser import parse
|
from dateutil.parser import parse
|
||||||
|
@ -349,19 +350,27 @@ for app, info in apps_list.items():
|
||||||
'level': info.get('level', '?'),
|
'level': info.get('level', '?'),
|
||||||
'maintained': app_maintained,
|
'maintained': app_maintained,
|
||||||
'high_quality': app_high_quality,
|
'high_quality': app_high_quality,
|
||||||
'featured': app_featured
|
'featured': app_featured,
|
||||||
|
'category': info.get('category', None),
|
||||||
|
'subtags': info.get('subtags', []),
|
||||||
}
|
}
|
||||||
except KeyError as e:
|
except KeyError as e:
|
||||||
error("Invalid app info or manifest for app %s, %s" % (app, e))
|
error("Invalid app info or manifest for app %s, %s" % (app, e))
|
||||||
continue
|
continue
|
||||||
|
|
||||||
# Write resulting file
|
## output version 2, including the categories
|
||||||
|
categories = yaml.load(open("categories.yml").read())
|
||||||
|
with open(args.output.replace(".json", "-v2.json"), 'w') as f:
|
||||||
|
f.write(json.dumps({"apps": result_dict, "categories": categories}, sort_keys=True))
|
||||||
|
|
||||||
|
## output version 1
|
||||||
with open(args.output, 'w') as f:
|
with open(args.output, 'w') as f:
|
||||||
f.write(json.dumps(result_dict, sort_keys=True))
|
f.write(json.dumps(result_dict, sort_keys=True))
|
||||||
|
|
||||||
print("\nDone! Written in %s" % args.output)
|
print("\nDone! Written in %s" % args.output)
|
||||||
|
|
||||||
if args.input == "apps.json":
|
|
||||||
|
## output version 0
|
||||||
print("\nAlso splitting the file into official and community-build.json for backward compatibility")
|
print("\nAlso splitting the file into official and community-build.json for backward compatibility")
|
||||||
|
|
||||||
official_apps = set(["agendav", "ampache", "baikal", "dokuwiki", "etherpad_mypads", "hextris", "jirafeau", "kanboard", "my_webapp", "nextcloud", "opensondage", "phpmyadmin", "piwigo", "rainloop", "roundcube", "searx", "shellinabox", "strut", "synapse", "transmission", "ttrss", "wallabag2", "wordpress", "zerobin"])
|
official_apps = set(["agendav", "ampache", "baikal", "dokuwiki", "etherpad_mypads", "hextris", "jirafeau", "kanboard", "my_webapp", "nextcloud", "opensondage", "phpmyadmin", "piwigo", "rainloop", "roundcube", "searx", "shellinabox", "strut", "synapse", "transmission", "ttrss", "wallabag2", "wordpress", "zerobin"])
|
||||||
|
|
Loading…
Add table
Reference in a new issue