mirror of
https://github.com/YunoHost/yunohost.git
synced 2024-09-03 20:06:10 +02:00
Fuck it we don't need these options
This commit is contained in:
parent
97138e9209
commit
7518beaf2f
2 changed files with 5 additions and 27 deletions
|
@ -548,9 +548,6 @@ app:
|
||||||
action_help: List apps
|
action_help: List apps
|
||||||
api: GET /apps
|
api: GET /apps
|
||||||
arguments:
|
arguments:
|
||||||
-f:
|
|
||||||
full: --filter
|
|
||||||
help: Name filter of app_id or app_name
|
|
||||||
-r:
|
-r:
|
||||||
full: --raw
|
full: --raw
|
||||||
help: Return the full app_dict
|
help: Return the full app_dict
|
||||||
|
@ -559,10 +556,6 @@ app:
|
||||||
full: --installed
|
full: --installed
|
||||||
help: Return only installed apps
|
help: Return only installed apps
|
||||||
action: store_true
|
action: store_true
|
||||||
-b:
|
|
||||||
full: --with-backup
|
|
||||||
help: Return only apps with backup feature (force --installed filter)
|
|
||||||
action: store_true
|
|
||||||
|
|
||||||
### app_info()
|
### app_info()
|
||||||
info:
|
info:
|
||||||
|
|
|
@ -71,18 +71,14 @@ re_app_instance_name = re.compile(
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
def app_list(filter=None, raw=False, installed=False, with_backup=False):
|
def app_list(raw=False, installed=False):
|
||||||
"""
|
"""
|
||||||
List apps
|
List apps
|
||||||
|
|
||||||
Keyword argument:
|
Keyword argument:
|
||||||
filter -- Name filter of app_id or app_name
|
|
||||||
raw -- Return the full app_dict
|
raw -- Return the full app_dict
|
||||||
installed -- Return only installed apps
|
installed -- Return only installed apps
|
||||||
with_backup -- Return only apps with backup feature (force --installed filter)
|
|
||||||
|
|
||||||
"""
|
"""
|
||||||
installed = with_backup or installed
|
|
||||||
|
|
||||||
list_dict = {} if raw else []
|
list_dict = {} if raw else []
|
||||||
|
|
||||||
|
@ -112,27 +108,16 @@ def app_list(filter=None, raw=False, installed=False, with_backup=False):
|
||||||
|
|
||||||
app_info_dict = app_dict[app_id]
|
app_info_dict = app_dict[app_id]
|
||||||
|
|
||||||
# Apply filter if there's one
|
|
||||||
if (filter and
|
|
||||||
(filter not in app_id) and
|
|
||||||
(filter not in app_info_dict['manifest']['name'])):
|
|
||||||
continue
|
|
||||||
|
|
||||||
# Ignore non-installed app if user wants only installed apps
|
# Ignore non-installed app if user wants only installed apps
|
||||||
app_installed = _is_installed(app_id)
|
app_installed = _is_installed(app_id)
|
||||||
if installed and not app_installed:
|
if installed and not app_installed:
|
||||||
continue
|
continue
|
||||||
|
|
||||||
# Ignore apps which don't have backup/restore script if user wants
|
|
||||||
# only apps with backup features
|
|
||||||
if with_backup and (
|
|
||||||
not os.path.isfile(APPS_SETTING_PATH + app_id + '/scripts/backup') or
|
|
||||||
not os.path.isfile(APPS_SETTING_PATH + app_id + '/scripts/restore')
|
|
||||||
):
|
|
||||||
continue
|
|
||||||
|
|
||||||
if raw:
|
if raw:
|
||||||
app_info_dict['installed'] = app_installed
|
app_info_dict['installed'] = app_installed
|
||||||
|
app_info_dict['supports_backup_restore'] = (app_installed and
|
||||||
|
os.path.isfile(APPS_SETTING_PATH + app_id + '/scripts/backup') and
|
||||||
|
os.path.isfile(APPS_SETTING_PATH + app_id + '/scripts/restore'))
|
||||||
|
|
||||||
# dirty: we used to have manifest containing multi_instance value in form of a string
|
# dirty: we used to have manifest containing multi_instance value in form of a string
|
||||||
# but we've switched to bool, this line ensure retrocompatibility
|
# but we've switched to bool, this line ensure retrocompatibility
|
||||||
|
@ -173,7 +158,7 @@ def app_info(app, raw=False):
|
||||||
manifest = _get_manifest_of_app(app_setting_path)
|
manifest = _get_manifest_of_app(app_setting_path)
|
||||||
|
|
||||||
if raw:
|
if raw:
|
||||||
ret = app_list(filter=app, raw=True)[app]
|
ret = app_list(raw=True)[app]
|
||||||
ret['settings'] = _get_app_settings(app)
|
ret['settings'] = _get_app_settings(app)
|
||||||
|
|
||||||
# Determine upgradability
|
# Determine upgradability
|
||||||
|
|
Loading…
Add table
Reference in a new issue