mirror of
https://github.com/YunoHost/moulinette.git
synced 2024-09-03 20:06:31 +02:00
merge
This commit is contained in:
commit
fed9e529fd
1 changed files with 2 additions and 21 deletions
|
@ -30,31 +30,12 @@ def app_updatelist(url=None):
|
||||||
try: info_fetch = urlopen(list_url)
|
try: info_fetch = urlopen(list_url)
|
||||||
except IOError: info_fetch = False
|
except IOError: info_fetch = False
|
||||||
finally:
|
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"))
|
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
|
return True
|
||||||
|
|
||||||
|
|
||||||
def app_list(args):
|
def app_list(args):
|
||||||
|
info_dict = json.loads(str(info_fetch.read()))
|
||||||
pass
|
pass
|
||||||
|
|
Loading…
Reference in a new issue