From 508aec5c8488fcabd96830bda64df4498584abd1 Mon Sep 17 00:00:00 2001 From: Kloadut Date: Sun, 10 Feb 2013 20:31:29 +0100 Subject: [PATCH] auto-append -h --- parse_args | 5 ++++- yunohost_app.py | 6 +++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/parse_args b/parse_args index 67e59d1f..c7f0a199 100755 --- a/parse_args +++ b/parse_args @@ -161,6 +161,9 @@ def main(): int -- 0 or error code """ + if len(sys.argv) < 2: + sys.argv.append('-h') + with open('action_map.yml') as f: action_map = yaml.load(f) @@ -169,7 +172,7 @@ def main(): for key, arg in enumerate(sys.argv): if arg == '--admin-password': admin_password_provided = True - admin_password = sys.argv[key+1] + admin_password = sys.argv[key+1] sys.argv.pop(key) sys.argv.pop(key) diff --git a/yunohost_app.py b/yunohost_app.py index cdb48cd2..84ab8ec4 100644 --- a/yunohost_app.py +++ b/yunohost_app.py @@ -32,7 +32,7 @@ def app_updatelist(url=None): finally: if info_fetch and (info_fetch.code == 200): info_dict = json.loads(str(info_fetch.read())) else: raise YunoHostError(1, _("List server connection failed")) - + # Fetch manifests and icons for appid, infos in info_dict.items(): if appid not in os.listdir(app_path): @@ -43,13 +43,13 @@ def app_updatelist(url=None): try: manifest_fetch = urlopen(infos['manifest']) except IOError: manifest_fetch = False - finally: + finally: if manifest_fetch and (manifest_fetch.code == 200): urlretrieve(infos['manifest'], app_path + appid + '/' + str(infos['lastUpdate'])) else: raise YunoHostError(1, appid + _(" manifest download failed")) try: icon_fetch = urlopen(infos['icon']) except IOError: icon_fetch = False - finally: + finally: if icon_fetch and (icon_fetch.code == 200): urlretrieve(infos['icon'], app_path + appid + '/icon.png') else: raise YunoHostError(1, appid + _(" icon download failed"))