From 45b6c6a33bab826367611c2fbf5cc50bb6d1cb94 Mon Sep 17 00:00:00 2001 From: Moul Date: Thu, 3 Dec 2015 12:04:21 +0100 Subject: [PATCH 01/20] Working status and some fixes. --- README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index a722f3a..deebade 100644 --- a/README.md +++ b/README.md @@ -41,23 +41,23 @@ sudo yunohost app fetchlist -n community -u https://yunohost.org/community.json * Fork and edit the [community list](https://github.com/YunoHost/apps/tree/master/community.json) * Add your app's ID and git information at the right alphabetical place -* Indicate the app's functioning state: `notworking`, `inprogress`, or `ready` +* Indicate the app's functioning state: `notworking`, `inprogress`, or `working` * Send a [Pull Request](https://github.com/YunoHost/apps/pulls/) -An example app addition: +App example addition: ```json "wallabag": { "branch": "master", "revision": "c2fc62438ac5c9503e3f4ebfdc425ec03a0ec0c0", "url": "https://github.com/abeudin/wallabag_ynh.git", - "state": "ready" + "state": "working" } ``` #### How to add an app to the official list Same steps than above, but on the `official.json` list with the status `validated`. -The integration will be discussed on the Pull Request. +Integration will be discussed on the Pull Request. **Important**: You will have to find a maintainer willing to take care of the package while published if you want your app to be validated. From 7b413b8edeffada61f1686624af5cf5d7c22baf1 Mon Sep 17 00:00:00 2001 From: Moul Date: Thu, 11 Feb 2016 17:24:24 +0100 Subject: [PATCH 02/20] Add header on python script to permit launch it with './'. --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index deebade..c95421f 100644 --- a/README.md +++ b/README.md @@ -69,7 +69,7 @@ your app from one of the 2 json files. Usage: ```bash -python ./add_or_update.py [community.json OR official.json] [github url [github url [github url ...]]] +./add_or_update.py [community.json OR official.json] [github url [github url [github url ...]]] ``` #### More information on [yunohost.org/packaging_apps](https://yunohost.org/packaging_apps) From 93a16dba040339e481a2786af295412c99cefe98 Mon Sep 17 00:00:00 2001 From: Laurent Peuch Date: Fri, 11 Mar 2016 16:50:04 +0100 Subject: [PATCH 03/20] [doc] improve documentation regarding making an app official --- README.md | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index c95421f..1411f67 100644 --- a/README.md +++ b/README.md @@ -54,12 +54,18 @@ App example addition: } ``` -#### How to add an app to the official list +#### How to propose your app to be integrated in the official applications list -Same steps than above, but on the `official.json` list with the status `validated`. -Integration will be discussed on the Pull Request. +Here is the procedure to request that your app will be part of the list of official applications of YunoHost: -**Important**: You will have to find a maintainer willing to take care of the package while published if you want your app to be validated. +* before everything, having you application joining the list of official applications will make you a maintainer of it and will requires you to ensure this position or to find someone else to do it in the future +* your app must be tested on several architectures (32/64 bits, ARM) or depends on crossplatform systems +* you must be subscribed to the [apps official mailing list](https://list.yunohost.org/cgi-bin/mailman/listinfo/apps) since this is the way that we communicate to apps maintainers +* your application must have at least a install, remove and upgrade (if this makes sens) scripts +* your applicaiton must be installable on a custom path (`domain.tld/custom_path/`) in addition to the root path +* your application you have packaged must be free software +* once all those requirements are fulfilled, fork this repository, add your application to the official.json list with the status "validated" following the documentation above, then open a pull request +* we will then start a reviewing process and we will work together to bring your application to a state where we can hopefully include it to the official applications list :) #### Helper script From aab9e84e07a9b635d7c2a8551c1128a0cc4b6655 Mon Sep 17 00:00:00 2001 From: Laurent Peuch Date: Fri, 11 Mar 2016 20:38:43 +0100 Subject: [PATCH 04/20] [doc] improve requirements list for becoming an official app --- README.md | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 1411f67..989bb07 100644 --- a/README.md +++ b/README.md @@ -59,10 +59,15 @@ App example addition: Here is the procedure to request that your app will be part of the list of official applications of YunoHost: * before everything, having you application joining the list of official applications will make you a maintainer of it and will requires you to ensure this position or to find someone else to do it in the future -* your app must be tested on several architectures (32/64 bits, ARM) or depends on crossplatform systems +* your app must be tested on several architectures (32/64 bits, ARM) or depends on cross-platform systems * you must be subscribed to the [apps official mailing list](https://list.yunohost.org/cgi-bin/mailman/listinfo/apps) since this is the way that we communicate to apps maintainers -* your application must have at least a install, remove and upgrade (if this makes sens) scripts -* your applicaiton must be installable on a custom path (`domain.tld/custom_path/`) in addition to the root path +* your application must have the following scripts: + * a install script, obviously + * a remove script + * an upgrade script if needed + * a backup/restore script if your application stores data +* your application must be installable on a custom path (`domain.tld/custom_path/`) in addition to the root path +* if relevant, your application must be integrated with YunoHost SSO * your application you have packaged must be free software * once all those requirements are fulfilled, fork this repository, add your application to the official.json list with the status "validated" following the documentation above, then open a pull request * we will then start a reviewing process and we will work together to bring your application to a state where we can hopefully include it to the official applications list :) From 77eea0bbbb3ac096ea9d1356d55eb6863379232a Mon Sep 17 00:00:00 2001 From: Laurent Peuch Date: Fri, 11 Mar 2016 20:44:49 +0100 Subject: [PATCH 05/20] [doc] point to mailing for inclear points --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 989bb07..64ec88b 100644 --- a/README.md +++ b/README.md @@ -72,6 +72,8 @@ Here is the procedure to request that your app will be part of the list of offic * once all those requirements are fulfilled, fork this repository, add your application to the official.json list with the status "validated" following the documentation above, then open a pull request * we will then start a reviewing process and we will work together to bring your application to a state where we can hopefully include it to the official applications list :) +Since our documentation regarding all those part is not as complete as it should be, don't hesitate to ask questions on the [apps mailing list](https://list.yunohost.org/cgi-bin/mailman/listinfo/apps) regarding those points. + #### Helper script You can use the add_or_update.py python script to add or update From 33c33d06fecbf33535ef0672a04bbe116e99a24e Mon Sep 17 00:00:00 2001 From: opi Date: Sat, 19 Mar 2016 10:55:55 +0100 Subject: [PATCH 06/20] Update README.md --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 64ec88b..8f7a233 100644 --- a/README.md +++ b/README.md @@ -61,14 +61,14 @@ Here is the procedure to request that your app will be part of the list of offic * before everything, having you application joining the list of official applications will make you a maintainer of it and will requires you to ensure this position or to find someone else to do it in the future * your app must be tested on several architectures (32/64 bits, ARM) or depends on cross-platform systems * you must be subscribed to the [apps official mailing list](https://list.yunohost.org/cgi-bin/mailman/listinfo/apps) since this is the way that we communicate to apps maintainers -* your application must have the following scripts: +* your application package must have the following scripts: * a install script, obviously * a remove script * an upgrade script if needed * a backup/restore script if your application stores data -* your application must be installable on a custom path (`domain.tld/custom_path/`) in addition to the root path +* your application must be installable on a custom path (`domain.tld/custom_path/`) in addition to the root path (`some.domain.tld/`) * if relevant, your application must be integrated with YunoHost SSO -* your application you have packaged must be free software +* the application you have packaged must be free software, as in free speech * once all those requirements are fulfilled, fork this repository, add your application to the official.json list with the status "validated" following the documentation above, then open a pull request * we will then start a reviewing process and we will work together to bring your application to a state where we can hopefully include it to the official applications list :) From 8c3294fb902db74331f577b8f8754c0aba96f2da Mon Sep 17 00:00:00 2001 From: Laurent Peuch Date: Thu, 31 Mar 2016 14:58:35 +0200 Subject: [PATCH 07/20] [enh] don't reprocess github app if the revision is the same --- list_builder.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/list_builder.py b/list_builder.py index 09470f4..8287603 100755 --- a/list_builder.py +++ b/list_builder.py @@ -60,6 +60,13 @@ print(":: Building %s list..." % list_name) if not args.output: args.output = '%s-build.json' % list_name +already_built_file = {} +if os.path.exists(args.output): + try: + already_built_file = json.load(open(args.output)) + except Exception as e: + print("Error while trying to load already built file: %s" % e) + # GitHub credentials if args.github: token = (args.github.split(':')[0], args.github.split(':')[1]) @@ -78,6 +85,11 @@ for app, info in apps_list.items(): manifest = {} timestamp = None + if already_built_file.get(app, {}).get("git", {}).get("revision", None) == app_rev: + print("%s[%s] is already up to date in target output, ignore" % (app, app_rev)) + result_dict[app] = already_built_file[app] + continue + ## Hosted on GitHub github_repo = re_github_repo.match(app_url) if github_repo: From a1f320ea888d3d323643082111eee373eb1e9bd4 Mon Sep 17 00:00:00 2001 From: Laurent Peuch Date: Tue, 3 May 2016 21:04:40 +0200 Subject: [PATCH 08/20] [fix] also test if repo has changed of url before chosing to rebuild --- list_builder.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/list_builder.py b/list_builder.py index 8287603..55740fb 100755 --- a/list_builder.py +++ b/list_builder.py @@ -85,7 +85,7 @@ for app, info in apps_list.items(): manifest = {} timestamp = None - if already_built_file.get(app, {}).get("git", {}).get("revision", None) == app_rev: + if already_built_file.get(app, {}).get("git", {}).get("revision", None) == app_rev and already_built_file.get(app, {}).get("git", {}).get("url") == app_url: print("%s[%s] is already up to date in target output, ignore" % (app, app_rev)) result_dict[app] = already_built_file[app] continue From fb21c9b34cb9b0f729b5206c37636551363b7118 Mon Sep 17 00:00:00 2001 From: Laurent Peuch Date: Sat, 17 Sep 2016 22:59:51 +0200 Subject: [PATCH 09/20] [doc] update documentation regarding add_or_update --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 8f7a233..8269811 100644 --- a/README.md +++ b/README.md @@ -82,7 +82,7 @@ your app from one of the 2 json files. Usage: ```bash -./add_or_update.py [community.json OR official.json] [github url [github url [github url ...]]] +./add_or_update.py [community.json OR official.json] [github url OR app name [github url OR app name [github url OR app name ...]]] ``` #### More information on [yunohost.org/packaging_apps](https://yunohost.org/packaging_apps) From 812de035824c6fec687592f93f7bbb5a0651f828 Mon Sep 17 00:00:00 2001 From: Laurent Peuch Date: Fri, 20 Jan 2017 11:34:55 +0100 Subject: [PATCH 10/20] [mod] make code more lisible --- list_builder.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/list_builder.py b/list_builder.py index 55740fb..e0ff66f 100755 --- a/list_builder.py +++ b/list_builder.py @@ -85,7 +85,10 @@ for app, info in apps_list.items(): manifest = {} timestamp = None - if already_built_file.get(app, {}).get("git", {}).get("revision", None) == app_rev and already_built_file.get(app, {}).get("git", {}).get("url") == app_url: + revision = already_built_file.get(app, {}).get("git", {}).get("revision", None) + url = already_built_file.get(app, {}).get("git", {}).get("url") + + if revision == app_rev and url == app_url: print("%s[%s] is already up to date in target output, ignore" % (app, app_rev)) result_dict[app] = already_built_file[app] continue From 0ddb0235169108bde488a1f2edcf9ca459214a78 Mon Sep 17 00:00:00 2001 From: Laurent Peuch Date: Fri, 20 Jan 2017 11:35:49 +0100 Subject: [PATCH 11/20] [mod] pep8 --- list_builder.py | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/list_builder.py b/list_builder.py index e0ff66f..69fbedf 100755 --- a/list_builder.py +++ b/list_builder.py @@ -11,7 +11,7 @@ import requests from dateutil.parser import parse -## Regular expression patterns +# Regular expression patterns """GitHub repository URL.""" re_github_repo = re.compile( @@ -24,7 +24,7 @@ re_commit_author = re.compile( ) -## Helpers +# Helpers def fail(msg, retcode=1): """Show failure message and exit.""" @@ -32,7 +32,7 @@ def fail(msg, retcode=1): sys.exit(retcode) -## Main +# Main # Create argument parser parser = argparse.ArgumentParser(description='Process YunoHost application list.') @@ -93,14 +93,14 @@ for app, info in apps_list.items(): result_dict[app] = already_built_file[app] continue - ## Hosted on GitHub + # Hosted on GitHub github_repo = re_github_repo.match(app_url) if github_repo: owner = github_repo.group('owner') repo = github_repo.group('repo') raw_url = 'https://raw.githubusercontent.com/%s/%s/%s/manifest.json' % ( - owner, repo, app_rev + owner, repo, app_rev ) try: # Retrieve and load manifest @@ -115,7 +115,7 @@ for app, info in apps_list.items(): continue api_url = 'https://api.github.com/repos/%s/%s/commits/%s' % ( - owner, repo, app_rev + owner, repo, app_rev ) try: # Retrieve last commit information @@ -131,7 +131,8 @@ for app, info in apps_list.items(): else: commit_date = parse(info2['commit']['author']['date']) timestamp = int(time.mktime(commit_date.timetuple())) - ## Git repository with HTTP/HTTPS (Gogs, GitLab, ...) + + # Git repository with HTTP/HTTPS (Gogs, GitLab, ...) elif app_url.startswith('http') and app_url.endswith('.git'): raw_url = '%s/raw/%s/manifest.json' % (app_url[:-4], app_rev) try: @@ -147,7 +148,7 @@ for app, info in apps_list.items(): continue obj_url = '%s/objects/%s/%s' % ( - app_url, app_rev[0:2], app_rev[2:] + app_url, app_rev[0:2], app_rev[2:] ) try: # Retrieve last commit information @@ -202,7 +203,7 @@ for app, info in apps_list.items(): continue # Write resulting file -with open(args.output , 'w') as f: +with open(args.output, 'w') as f: f.write(json.dumps(result_dict, sort_keys=True)) print("\nDone! Written in %s" % args.output) From 018cb777062ee248bb1841baf5a03a4b92bca34e Mon Sep 17 00:00:00 2001 From: Laurent Peuch Date: Fri, 20 Jan 2017 11:45:43 +0100 Subject: [PATCH 12/20] [mod] make variable more readable --- list_builder.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/list_builder.py b/list_builder.py index 69fbedf..ad282c1 100755 --- a/list_builder.py +++ b/list_builder.py @@ -85,10 +85,10 @@ for app, info in apps_list.items(): manifest = {} timestamp = None - revision = already_built_file.get(app, {}).get("git", {}).get("revision", None) - url = already_built_file.get(app, {}).get("git", {}).get("url") + previous_rev = already_built_file.get(app, {}).get("git", {}).get("revision", None) + previous_url = already_built_file.get(app, {}).get("git", {}).get("url") - if revision == app_rev and url == app_url: + if previous_rev == app_rev and previous_url == app_url: print("%s[%s] is already up to date in target output, ignore" % (app, app_rev)) result_dict[app] = already_built_file[app] continue From 6c9173ff634a442e820d6ee5e126b4b3a6d56a67 Mon Sep 17 00:00:00 2001 From: Laurent Peuch Date: Fri, 20 Jan 2017 11:52:04 +0100 Subject: [PATCH 13/20] [fix] modify state of a cached app if it has changed --- list_builder.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/list_builder.py b/list_builder.py index ad282c1..7c30316 100755 --- a/list_builder.py +++ b/list_builder.py @@ -81,6 +81,9 @@ for app, info in apps_list.items(): # Store usefull values app_url = info['url'] app_rev = info['revision'] + app_state = info["state"] + + previous_state = already_built_file.get(app, {}).get("state", {}) manifest = {} timestamp = None @@ -91,6 +94,9 @@ for app, info in apps_list.items(): if previous_rev == app_rev and previous_url == app_url: print("%s[%s] is already up to date in target output, ignore" % (app, app_rev)) result_dict[app] = already_built_file[app] + if previous_state != app_state: + result_dict[app]["state"] = app_state + print("... but has changed of state, updating it from '%s' to '%s'" % (previous_state, app_state)) continue # Hosted on GitHub From 255db43aba4cf34cab02e4f68e6773bbc0ba18ac Mon Sep 17 00:00:00 2001 From: Maniack Crudelis Date: Thu, 12 Jan 2017 13:04:09 +0100 Subject: [PATCH 14/20] =?UTF-8?q?Int=C3=A8gre=20le=20level=20du=20json=20a?= =?UTF-8?q?u=20-build.json?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- list_builder.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/list_builder.py b/list_builder.py index 7c30316..e9e5a46 100755 --- a/list_builder.py +++ b/list_builder.py @@ -202,7 +202,8 @@ for app, info in apps_list.items(): }, 'lastUpdate': timestamp, 'manifest': manifest, - 'state': info['state'] + 'state': info['state'], + 'level': info['level'] } except KeyError as e: print("-> Error: invalid app info or manifest, %s" % e) From 3c8140ca2217a4244faba8cca049b90fb2b1389c Mon Sep 17 00:00:00 2001 From: Laurent Peuch Date: Mon, 30 Jan 2017 23:52:05 +0100 Subject: [PATCH 15/20] [enh] more robust code --- list_builder.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/list_builder.py b/list_builder.py index e9e5a46..d7640f2 100755 --- a/list_builder.py +++ b/list_builder.py @@ -203,7 +203,7 @@ for app, info in apps_list.items(): 'lastUpdate': timestamp, 'manifest': manifest, 'state': info['state'], - 'level': info['level'] + 'level': info.get('level', '?') } except KeyError as e: print("-> Error: invalid app info or manifest, %s" % e) From c26c08a9fd0c11f636ac5a9adfe684f1dd315e53 Mon Sep 17 00:00:00 2001 From: Laurent Peuch Date: Tue, 31 Jan 2017 00:04:52 +0100 Subject: [PATCH 16/20] [enh] handle level modification in caching --- list_builder.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/list_builder.py b/list_builder.py index d7640f2..4b6db05 100755 --- a/list_builder.py +++ b/list_builder.py @@ -82,6 +82,7 @@ for app, info in apps_list.items(): app_url = info['url'] app_rev = info['revision'] app_state = info["state"] + app_level = info.get("level") previous_state = already_built_file.get(app, {}).get("state", {}) @@ -90,6 +91,7 @@ for app, info in apps_list.items(): previous_rev = already_built_file.get(app, {}).get("git", {}).get("revision", None) previous_url = already_built_file.get(app, {}).get("git", {}).get("url") + previous_level = already_built_file.get(app, {}).get("level") if previous_rev == app_rev and previous_url == app_url: print("%s[%s] is already up to date in target output, ignore" % (app, app_rev)) @@ -97,6 +99,9 @@ for app, info in apps_list.items(): if previous_state != app_state: result_dict[app]["state"] = app_state print("... but has changed of state, updating it from '%s' to '%s'" % (previous_state, app_state)) + if previous_level != app_level or app_level is None: + result_dict[app]["level"] = app_level + print("... but has changed of level, updating it from '%s' to '%s'" % (previous_level, app_level)) continue # Hosted on GitHub From 772d59014d692072601e28d4ed306df2237043cf Mon Sep 17 00:00:00 2001 From: Laurent Peuch Date: Fri, 24 Feb 2017 09:26:37 +0100 Subject: [PATCH 17/20] This procedure is not valid anymore --- README.md | 20 -------------------- 1 file changed, 20 deletions(-) diff --git a/README.md b/README.md index 8269811..5faf4bc 100644 --- a/README.md +++ b/README.md @@ -54,26 +54,6 @@ App example addition: } ``` -#### How to propose your app to be integrated in the official applications list - -Here is the procedure to request that your app will be part of the list of official applications of YunoHost: - -* before everything, having you application joining the list of official applications will make you a maintainer of it and will requires you to ensure this position or to find someone else to do it in the future -* your app must be tested on several architectures (32/64 bits, ARM) or depends on cross-platform systems -* you must be subscribed to the [apps official mailing list](https://list.yunohost.org/cgi-bin/mailman/listinfo/apps) since this is the way that we communicate to apps maintainers -* your application package must have the following scripts: - * a install script, obviously - * a remove script - * an upgrade script if needed - * a backup/restore script if your application stores data -* your application must be installable on a custom path (`domain.tld/custom_path/`) in addition to the root path (`some.domain.tld/`) -* if relevant, your application must be integrated with YunoHost SSO -* the application you have packaged must be free software, as in free speech -* once all those requirements are fulfilled, fork this repository, add your application to the official.json list with the status "validated" following the documentation above, then open a pull request -* we will then start a reviewing process and we will work together to bring your application to a state where we can hopefully include it to the official applications list :) - -Since our documentation regarding all those part is not as complete as it should be, don't hesitate to ask questions on the [apps mailing list](https://list.yunohost.org/cgi-bin/mailman/listinfo/apps) regarding those points. - #### Helper script You can use the add_or_update.py python script to add or update From 7b0a59f7c9804254ee6e8af6359804ccd04f83d5 Mon Sep 17 00:00:00 2001 From: Alexandre Aubin Date: Wed, 29 Mar 2017 22:40:03 +0200 Subject: [PATCH 18/20] Fixing weird image display bug in README --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 5faf4bc..425f251 100644 --- a/README.md +++ b/README.md @@ -1,12 +1,12 @@ # YunoHost apps directory + ![roundcube](https://yunohost.org/images/roundcube.png) ![ttrss](https://yunohost.org/images/ttrss.png) ![wordpress](https://yunohost.org/images/wordpress.png) ![transmission](https://yunohost.org/images/transmission.png) ![jappix](https://yunohost.org/images/jappix.png) - From f8fbe69032de946daf5655692692aa4ff4297b52 Mon Sep 17 00:00:00 2001 From: Laurent Peuch Date: Fri, 31 Mar 2017 23:32:39 +0200 Subject: [PATCH 19/20] [enh] include translation in manifest when rebuilding it --- list_builder.py | 31 ++++++++++++++++++++++++++++++- 1 file changed, 30 insertions(+), 1 deletion(-) diff --git a/list_builder.py b/list_builder.py index 4b6db05..a32bebc 100755 --- a/list_builder.py +++ b/list_builder.py @@ -32,6 +32,31 @@ def fail(msg, retcode=1): sys.exit(retcode) +def include_translations_in_manifest(app_name, manifest): + for i in os.listdir("locales"): + if not i.endswith("json"): + continue + + if i == "en.json": + continue + + current_lang = i.split(".")[0] + translations = json.load(open(os.path.join("locales", i), "r")) + + key = "%s_manifest_description" % app_name + if key in translations and translations[key]: + manifest["description"][current_lang] = translations[key] + + for category, questions in manifest["arguments"].items(): + for question in questions: + key = "%s_manifest_arguments_%s_%s" % (app_name, category, question["name"]) + if key in translations and translations[key]: + print current_lang, key + question["ask"][current_lang] = translations[key] + + return manifest + + # Main # Create argument parser @@ -102,6 +127,10 @@ for app, info in apps_list.items(): if previous_level != app_level or app_level is None: result_dict[app]["level"] = app_level print("... but has changed of level, updating it from '%s' to '%s'" % (previous_level, app_level)) + + print "update translations but don't download anything" + result_dict[app]['manifest'] = include_translations_in_manifest(app, result_dict[app]['manifest']) + continue # Hosted on GitHub @@ -206,7 +235,7 @@ for app, info in apps_list.items(): 'url': app_url }, 'lastUpdate': timestamp, - 'manifest': manifest, + 'manifest': include_translations_in_manifest(manifest['id'], manifest), 'state': info['state'], 'level': info.get('level', '?') } From b1757b72a20dddaee254c8baca78c6bd743aa414 Mon Sep 17 00:00:00 2001 From: Laurent Peuch Date: Thu, 6 Apr 2017 15:00:58 +0200 Subject: [PATCH 20/20] [enh] help keys are now translatables --- list_builder.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/list_builder.py b/list_builder.py index a32bebc..47c4b38 100755 --- a/list_builder.py +++ b/list_builder.py @@ -51,9 +51,14 @@ def include_translations_in_manifest(app_name, manifest): for question in questions: key = "%s_manifest_arguments_%s_%s" % (app_name, category, question["name"]) if key in translations and translations[key]: - print current_lang, key + print "[ask]", current_lang, key question["ask"][current_lang] = translations[key] + key = "%s_manifest_arguments_%s_help_%s" % (app_name, category, question["name"]) + if key in translations and translations[key]: + print "[help]", current_lang, key + question["help"][current_lang] = translations[key] + return manifest