mirror of
https://github.com/YunoHost/moulinette.git
synced 2024-09-03 20:06:31 +02:00
Put apps in a list
This commit is contained in:
parent
557a46f0b1
commit
655550ec6b
1 changed files with 16 additions and 8 deletions
|
@ -121,7 +121,10 @@ def app_list(offset=None, limit=None, filter=None, raw=False):
|
||||||
|
|
||||||
applists = os.listdir(repo_path)
|
applists = os.listdir(repo_path)
|
||||||
app_dict = {}
|
app_dict = {}
|
||||||
list_dict = {}
|
if raw:
|
||||||
|
list_dict = {}
|
||||||
|
else:
|
||||||
|
list_dict=[]
|
||||||
|
|
||||||
if not applists: app_fetchlist()
|
if not applists: app_fetchlist()
|
||||||
|
|
||||||
|
@ -144,22 +147,27 @@ def app_list(offset=None, limit=None, filter=None, raw=False):
|
||||||
installed_txt = 'Yes ('+ str(instance_number) +' times)'
|
installed_txt = 'Yes ('+ str(instance_number) +' times)'
|
||||||
elif instance_number == 1:
|
elif instance_number == 1:
|
||||||
installed_txt = 'Yes'
|
installed_txt = 'Yes'
|
||||||
|
installed = True
|
||||||
else:
|
else:
|
||||||
installed_txt = 'No'
|
installed_txt = 'No'
|
||||||
|
installed = False
|
||||||
|
|
||||||
if raw:
|
if raw:
|
||||||
|
app_info['installed'] = installed
|
||||||
list_dict[app_id] = app_info
|
list_dict[app_id] = app_info
|
||||||
else:
|
else:
|
||||||
list_dict[app_id] = [
|
list_dict.append({
|
||||||
('Name', app_info['manifest']['name']),
|
'ID': app_id,
|
||||||
('Version', app_info['manifest']['version']),
|
'Name': app_info['manifest']['name'],
|
||||||
('Description', app_info['manifest']['description']),
|
'Version': app_info['manifest']['version'],
|
||||||
('Installed', installed_txt)
|
'Description': app_info['manifest']['description'],
|
||||||
]
|
'Installed': installed_txt
|
||||||
|
})
|
||||||
i += 1
|
i += 1
|
||||||
else:
|
else:
|
||||||
break
|
break
|
||||||
|
if not raw:
|
||||||
|
list_dict = { 'Apps': list_dict }
|
||||||
return list_dict
|
return list_dict
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue