From af1dc8ba8628efe374b986713cbf2929add13ce7 Mon Sep 17 00:00:00 2001 From: Kload Date: Sun, 10 Feb 2013 19:28:52 +0100 Subject: [PATCH] Change app fetching --- yunohost_app.py | 23 ++--------------------- 1 file changed, 2 insertions(+), 21 deletions(-) diff --git a/yunohost_app.py b/yunohost_app.py index cdb48cd2..1cbdd06d 100644 --- a/yunohost_app.py +++ b/yunohost_app.py @@ -30,31 +30,12 @@ def app_updatelist(url=None): try: info_fetch = urlopen(list_url) except IOError: info_fetch = False finally: - if info_fetch and (info_fetch.code == 200): info_dict = json.loads(str(info_fetch.read())) + if info_fetch and (info_fetch.code == 200): urlretrieve(list_url, app_path + str(infos['lastUpdate']) + '.json') 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): - os.mkdir(app_path + appid) - if str(infos['lastUpdate']) not in os.listdir(app_path + appid): - os.rmdir(app_path + appid) - os.mkdir(app_path + appid) - - try: manifest_fetch = urlopen(infos['manifest']) - except IOError: manifest_fetch = False - 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: - if icon_fetch and (icon_fetch.code == 200): urlretrieve(infos['icon'], app_path + appid + '/icon.png') - else: raise YunoHostError(1, appid + _(" icon download failed")) return True def app_list(args): + info_dict = json.loads(str(info_fetch.read())) pass