App functions with arguments in a namespace

This commit is contained in:
Alexis Gavoty 2012-11-29 14:48:58 +01:00
parent 4f3cf88623
commit b0411ab9e2

View file

@ -6,12 +6,12 @@ import json
from urllib import urlopen, urlretrieve from urllib import urlopen, urlretrieve
from yunohost import YunoHostError, YunoHostLDAP from yunohost import YunoHostError, YunoHostLDAP
def app_updatelist(args): def app_updatelist(url=None):
""" """
Fetch application list Fetch application list
Keyword arguments: Keyword arguments:
args['url'] -- Custom list URL url -- Custom list URL
Returns: Returns:
True | YunoHostError True | YunoHostError
@ -23,7 +23,7 @@ def app_updatelist(args):
try: os.listdir(app_path) try: os.listdir(app_path)
except OSError: os.makedirs(app_path) except OSError: os.makedirs(app_path)
if args['url']: list_url = args['url'] if url: list_url = url
else: list_url = 'http://fapp.yunohost.org/app/list/raw' else: list_url = 'http://fapp.yunohost.org/app/list/raw'
# Get list # Get list