[mod] remove offset/limit from app_list, they aren't used anymore

This commit is contained in:
Laurent Peuch 2017-03-13 23:51:35 +01:00
parent 02c974e8ca
commit 50cc3536ac
2 changed files with 1 additions and 23 deletions

View file

@ -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

View file

@ -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