From 50cc3536acf2e2dee0dce70d0f81c97e47748d7a Mon Sep 17 00:00:00 2001 From: Laurent Peuch Date: Mon, 13 Mar 2017 23:51:35 +0100 Subject: [PATCH] [mod] remove offset/limit from app_list, they aren't used anymore --- data/actionsmap/yunohost.yml | 6 ------ src/yunohost/app.py | 18 +----------------- 2 files changed, 1 insertion(+), 23 deletions(-) diff --git a/data/actionsmap/yunohost.yml b/data/actionsmap/yunohost.yml index 25eb6cf6d..ef951496c 100644 --- a/data/actionsmap/yunohost.yml +++ b/data/actionsmap/yunohost.yml @@ -426,12 +426,6 @@ app: action_help: List apps api: GET /apps arguments: - -l: - full: --limit - help: Maximum number of app fetched - -o: - full: --offset - help: Starting number for app fetching -f: full: --filter help: Name filter of app_id or app_name diff --git a/src/yunohost/app.py b/src/yunohost/app.py index 8e67e5030..45579c22e 100644 --- a/src/yunohost/app.py +++ b/src/yunohost/app.py @@ -144,7 +144,7 @@ def app_removelist(name): logger.success(m18n.n('appslist_removed')) -def app_list(offset=None, limit=None, filter=None, raw=False, installed=False, with_backup=False): +def app_list(filter=None, raw=False, installed=False, with_backup=False): """ List apps @@ -157,8 +157,6 @@ def app_list(offset=None, limit=None, filter=None, raw=False, installed=False, w with_backup -- Return only apps with backup feature (force --installed filter) """ - offset = int(offset) if offset else 0 - limit = int(limit) if limit else 1000 installed = with_backup or installed app_dict = {} @@ -197,17 +195,9 @@ def app_list(offset=None, limit=None, filter=None, raw=False, installed=False, w app_dict[app]['repository'] = None - # ??? - if not (len(app_dict) > offset and limit > 0): - return {'apps': list_dict} if not raw else list_dict - # Sort app list sorted_app_list = sorted(app_dict.keys()) - # Take into account offset - sorted_app_list = sorted_app_list[offset:] - - i = 0 for app_id in sorted_app_list: app_info_dict = app_dict[app_id] @@ -258,12 +248,6 @@ def app_list(offset=None, limit=None, filter=None, raw=False, installed=False, w 'installed': app_installed }) - # Count listed apps and apply limit - i += 1 - if i >= limit: - break - - return {'apps': list_dict} if not raw else list_dict