mirror of
https://github.com/YunoHost/moulinette.git
synced 2024-09-03 20:06:31 +02:00
auto-append -h
This commit is contained in:
parent
98ada0253e
commit
508aec5c84
2 changed files with 7 additions and 4 deletions
|
@ -161,6 +161,9 @@ def main():
|
||||||
int -- 0 or error code
|
int -- 0 or error code
|
||||||
|
|
||||||
"""
|
"""
|
||||||
|
if len(sys.argv) < 2:
|
||||||
|
sys.argv.append('-h')
|
||||||
|
|
||||||
with open('action_map.yml') as f:
|
with open('action_map.yml') as f:
|
||||||
action_map = yaml.load(f)
|
action_map = yaml.load(f)
|
||||||
|
|
||||||
|
@ -169,7 +172,7 @@ def main():
|
||||||
for key, arg in enumerate(sys.argv):
|
for key, arg in enumerate(sys.argv):
|
||||||
if arg == '--admin-password':
|
if arg == '--admin-password':
|
||||||
admin_password_provided = True
|
admin_password_provided = True
|
||||||
admin_password = sys.argv[key+1]
|
admin_password = sys.argv[key+1]
|
||||||
sys.argv.pop(key)
|
sys.argv.pop(key)
|
||||||
sys.argv.pop(key)
|
sys.argv.pop(key)
|
||||||
|
|
||||||
|
|
|
@ -32,7 +32,7 @@ def app_updatelist(url=None):
|
||||||
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): info_dict = json.loads(str(info_fetch.read()))
|
||||||
else: raise YunoHostError(1, _("List server connection failed"))
|
else: raise YunoHostError(1, _("List server connection failed"))
|
||||||
|
|
||||||
# Fetch manifests and icons
|
# Fetch manifests and icons
|
||||||
for appid, infos in info_dict.items():
|
for appid, infos in info_dict.items():
|
||||||
if appid not in os.listdir(app_path):
|
if appid not in os.listdir(app_path):
|
||||||
|
@ -43,13 +43,13 @@ def app_updatelist(url=None):
|
||||||
|
|
||||||
try: manifest_fetch = urlopen(infos['manifest'])
|
try: manifest_fetch = urlopen(infos['manifest'])
|
||||||
except IOError: manifest_fetch = False
|
except IOError: manifest_fetch = False
|
||||||
finally:
|
finally:
|
||||||
if manifest_fetch and (manifest_fetch.code == 200): urlretrieve(infos['manifest'], app_path + appid + '/' + str(infos['lastUpdate']))
|
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"))
|
else: raise YunoHostError(1, appid + _(" manifest download failed"))
|
||||||
|
|
||||||
try: icon_fetch = urlopen(infos['icon'])
|
try: icon_fetch = urlopen(infos['icon'])
|
||||||
except IOError: icon_fetch = False
|
except IOError: icon_fetch = False
|
||||||
finally:
|
finally:
|
||||||
if icon_fetch and (icon_fetch.code == 200): urlretrieve(infos['icon'], app_path + appid + '/icon.png')
|
if icon_fetch and (icon_fetch.code == 200): urlretrieve(infos['icon'], app_path + appid + '/icon.png')
|
||||||
else: raise YunoHostError(1, appid + _(" icon download failed"))
|
else: raise YunoHostError(1, appid + _(" icon download failed"))
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue