mirror of
https://github.com/YunoHost/yunohost.git
synced 2024-09-03 20:06:10 +02:00
Re-add 'app fetchlist', 'app list -i', 'app list' filter for backward compatibility...
This commit is contained in:
parent
54cc684a35
commit
69938c3feb
2 changed files with 32 additions and 1 deletions
|
@ -563,6 +563,9 @@ app:
|
|||
help: Also return a list of app categories
|
||||
action: store_true
|
||||
|
||||
fetchlist:
|
||||
deprecated: true
|
||||
|
||||
### app_list()
|
||||
list:
|
||||
action_help: List installed apps
|
||||
|
@ -572,6 +575,12 @@ app:
|
|||
full: --full
|
||||
help: Display all details, including the app manifest and various other infos
|
||||
action: store_true
|
||||
-i:
|
||||
full: --installed
|
||||
help: Dummy argument, does nothing anymore (still there only for backward compatibility)
|
||||
action: store_true
|
||||
filter:
|
||||
nargs: '?'
|
||||
|
||||
### app_info()
|
||||
info:
|
||||
|
|
|
@ -110,12 +110,34 @@ def app_catalog(full=False, with_categories=False):
|
|||
return {"apps": catalog["apps"], "categories": catalog["categories"]}
|
||||
|
||||
|
||||
def app_list(full=False):
|
||||
|
||||
# Old legacy function...
|
||||
def app_fetchlist():
|
||||
logger.warning("'yunohost app fetchlist' is deprecated. Please use 'yunohost tools update --apps' instead")
|
||||
from yunohost.tools import tools_update
|
||||
tools_update(apps=True)
|
||||
|
||||
|
||||
def app_list(full=False, installed=False, filter=None):
|
||||
"""
|
||||
List installed apps
|
||||
"""
|
||||
|
||||
# Old legacy argument ... app_list was a combination of app_list and
|
||||
# app_catalog before 3.8 ...
|
||||
if installed:
|
||||
logger.warning("Argument --installed ain't needed anymore when using 'yunohost app list'. It directly returns the list of installed apps..")
|
||||
|
||||
# Filter is a deprecated option...
|
||||
if filter:
|
||||
logger.warning("Using -f $appname in 'yunohost app list' is deprecated. Just use 'yunohost app list | grep -q 'id: $appname' to check a specific app is installed")
|
||||
|
||||
out = []
|
||||
for app_id in sorted(_installed_apps()):
|
||||
|
||||
if filter and not app_id.startswith(filter):
|
||||
continue
|
||||
|
||||
try:
|
||||
app_info_dict = app_info(app_id, full=full)
|
||||
except Exception as e:
|
||||
|
|
Loading…
Add table
Reference in a new issue