mirror of
https://github.com/YunoHost/apps.git
synced 2024-09-03 20:06:07 +02:00
Merge pull request #727 from YunoHost/split-apps-to-community-and-official
list_builder.py backward compatibility : split apps-build.json to community and official
This commit is contained in:
commit
e743c2ac26
4 changed files with 2125 additions and 9 deletions
12
README.md
12
README.md
|
@ -11,21 +11,23 @@ https://yunohost.org/apps
|
||||||
**Situation will change soon regarding lists. Consider this info as obsolete**
|
**Situation will change soon regarding lists. Consider this info as obsolete**
|
||||||
- **official.json** contains the repository information of validated apps.
|
- **official.json** contains the repository information of validated apps.
|
||||||
- **community.json** contains all references to known "free-software" YunoHost packages. If you want to add your app to the list, please [send a Pull Request](#contributing)
|
- **community.json** contains all references to known "free-software" YunoHost packages. If you want to add your app to the list, please [send a Pull Request](#contributing)
|
||||||
|
- **apps.json** contains all references to known YunoHost packages. If you want to add your app to the list, please [send a Pull Request](#contributing). **This list replace both community.json and official.json.**
|
||||||
|
|
||||||
|
|
||||||
## Usage
|
## Usage
|
||||||
|
|
||||||
The official package list is automatically fetched. If you want to **enable the community package list** on your YunoHost instance:
|
The official package list is automatically fetched. If you want to **enable the apps package list** on your YunoHost instance:
|
||||||
```
|
```
|
||||||
sudo yunohost app fetchlist -n community -u https://yunohost.org/community.json
|
sudo yunohost app fetchlist -n apps -u https://yunohost.org/apps.json
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
## Contributing
|
## Contributing
|
||||||
|
|
||||||
### How to add your app to the community list
|
### How to add your app to the apps list
|
||||||
|
|
||||||
**If** your app is under a free-software licence :
|
**If** your app is under a free-software licence :
|
||||||
* Fork and edit the [community list](https://github.com/YunoHost/apps/tree/master/community.json)
|
* Fork and edit the [apps list](https://github.com/YunoHost/apps/tree/master/apps.json)
|
||||||
* Add your app's ID and git information at the right alphabetical place
|
* Add your app's ID and git information at the right alphabetical place
|
||||||
* Indicate the app's functioning state: `notworking`, `inprogress`, or `working`
|
* Indicate the app's functioning state: `notworking`, `inprogress`, or `working`
|
||||||
* Do not add the level yourself. The CI will do it.
|
* Do not add the level yourself. The CI will do it.
|
||||||
|
@ -57,7 +59,7 @@ your app from one of the 2 json files.
|
||||||
Usage:
|
Usage:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
./add_or_update.py [community.json OR official.json] [github/gitlab url OR app name [github/gitlab url OR app name [github/gitlab url OR app name ...]]]
|
./add_or_update.py apps.json [github/gitlab url OR app name [github/gitlab url OR app name [github/gitlab url OR app name ...]]]
|
||||||
```
|
```
|
||||||
|
|
||||||
### How to make my app a High Quality app ?
|
### How to make my app a High Quality app ?
|
||||||
|
|
|
@ -312,9 +312,9 @@ for app, info in apps_list.items():
|
||||||
continue
|
continue
|
||||||
|
|
||||||
if manifest["id"] != app or manifest["id"] != repo.replace("_ynh", ""):
|
if manifest["id"] != app or manifest["id"] != repo.replace("_ynh", ""):
|
||||||
print("Warning: IDs different between community.json, manifest and repo name")
|
print("Warning: IDs different between list.json, manifest and repo name")
|
||||||
print(" Manifest id : %s" % manifest["id"])
|
print(" Manifest id : %s" % manifest["id"])
|
||||||
print(" Name in community json : %s" % app)
|
print(" Name in json list : %s" % app)
|
||||||
print(" Repo name : %s" % repo.replace("_ynh", ""))
|
print(" Repo name : %s" % repo.replace("_ynh", ""))
|
||||||
|
|
||||||
try:
|
try:
|
||||||
|
@ -341,3 +341,19 @@ 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":
|
||||||
|
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_dict = {k: v for k, v in result_dict.items() if k in official_apps}
|
||||||
|
community_apps_dict = {k: v for k, v in result_dict.items() if k not in official_apps}
|
||||||
|
|
||||||
|
with open("official-build.json", 'w') as f:
|
||||||
|
f.write(json.dumps(official_apps_dict, sort_keys=True))
|
||||||
|
|
||||||
|
with open("community-build.json", 'w') as f:
|
||||||
|
f.write(json.dumps(community_apps_dict, sort_keys=True))
|
||||||
|
|
||||||
|
print("\nDone!")
|
||||||
|
|
14
merge_official_and_community.py
Normal file
14
merge_official_and_community.py
Normal file
|
@ -0,0 +1,14 @@
|
||||||
|
import json
|
||||||
|
|
||||||
|
community = json.loads(open("community.json").read())
|
||||||
|
official = json.loads(open("official.json").read())
|
||||||
|
|
||||||
|
# Add high quality and set working state for official apps
|
||||||
|
for app, infos in official.items():
|
||||||
|
infos["high_quality"] = True
|
||||||
|
infos["state"] = "working"
|
||||||
|
|
||||||
|
merged = community
|
||||||
|
merged.update(official)
|
||||||
|
|
||||||
|
open("apps.json", "w").write(json.dumps(merged, sort_keys=True, indent=4, separators=(',', ': ')))
|
Loading…
Add table
Reference in a new issue