diff --git a/action_map.yml b/action_map.yml index a76c56e3..c624dc77 100644 --- a/action_map.yml +++ b/action_map.yml @@ -224,6 +224,16 @@ app: listlists: action_help: List fetched lists + ### app_removelist() + removelist: + action_help: Remove list from the repositories + arguments: + -n: + full: --name + help: Name of the list to remove + ask: "List to remove" + pattern: '^[a-z0-9_]+$' + ### app_list() list: action_help: List apps diff --git a/yunohost_app.py b/yunohost_app.py index 70744b5a..39b6f97d 100644 --- a/yunohost_app.py +++ b/yunohost_app.py @@ -58,6 +58,22 @@ def app_listlists(): return { 'Lists' : list_list } +def app_removelist(name): + """ + Remove specified application list + + Keyword arguments: + name -- Name of the list to remove + + """ + try: + os.remove(repo_path +'/'+ name + '.json') + except OSError: + raise YunoHostError(22, _("Unknown list")) + + win_msg(_("List successfully removed")) + + def app_list(offset=None, limit=None, filter=None, raw=False): """ List available applications