From 7518beaf2f8a02482b4b89e350d8fb6bdb65f263 Mon Sep 17 00:00:00 2001 From: Alexandre Aubin Date: Mon, 25 Nov 2019 19:16:46 +0100 Subject: [PATCH] Fuck it we don't need these options --- data/actionsmap/yunohost.yml | 7 ------- src/yunohost/app.py | 25 +++++-------------------- 2 files changed, 5 insertions(+), 27 deletions(-) diff --git a/data/actionsmap/yunohost.yml b/data/actionsmap/yunohost.yml index 4cb108e3a..fbdd8aff6 100644 --- a/data/actionsmap/yunohost.yml +++ b/data/actionsmap/yunohost.yml @@ -548,9 +548,6 @@ app: action_help: List apps api: GET /apps arguments: - -f: - full: --filter - help: Name filter of app_id or app_name -r: full: --raw help: Return the full app_dict @@ -559,10 +556,6 @@ app: full: --installed help: Return only installed apps action: store_true - -b: - full: --with-backup - help: Return only apps with backup feature (force --installed filter) - action: store_true ### app_info() info: diff --git a/src/yunohost/app.py b/src/yunohost/app.py index 4ecdc0db6..2b0bba33e 100644 --- a/src/yunohost/app.py +++ b/src/yunohost/app.py @@ -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 Keyword argument: - filter -- Name filter of app_id or app_name raw -- Return the full app_dict 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 [] @@ -112,27 +108,16 @@ def app_list(filter=None, raw=False, installed=False, with_backup=False): 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 app_installed = _is_installed(app_id) if installed and not app_installed: 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: 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 # 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) if raw: - ret = app_list(filter=app, raw=True)[app] + ret = app_list(raw=True)[app] ret['settings'] = _get_app_settings(app) # Determine upgradability