Generated doc

This commit is contained in:
Kload 2013-10-31 11:21:59 +01:00
parent aa2f87d70a
commit 65579bbeb8
8 changed files with 66 additions and 52 deletions

View file

@ -65,8 +65,8 @@ def app_fetchlist(url=None, name=None):
Fetch application list from app server
Keyword argument:
url -- URL of remote JSON list (default http://app.yunohost.org/list.json)
name -- Name of the list (default yunohost)
name -- Name of the list (default fapp)
url -- URL of remote JSON list (default http://fapp.yunohost.org/app/list/raw)
"""
# Create app path if not exists
@ -110,9 +110,9 @@ def app_list(offset=None, limit=None, filter=None, raw=False):
List apps
Keyword argument:
limit -- Maximum number of app fetched
offset -- Starting number for app fetching
filter -- Name filter of app_id or app_name
offset -- Starting number for app fetching
limit -- Maximum number of app fetched
raw -- Return the full app_dict
"""
@ -180,10 +180,10 @@ def app_list(offset=None, limit=None, filter=None, raw=False):
def app_info(app, raw=False):
"""
Get app informations
Get app info
Keyword argument:
app -- App ID
app -- Specific app ID
raw -- Return the full app_dict
"""
@ -211,9 +211,9 @@ def app_map(app=None, raw=False, user=None):
List apps by domain
Keyword argument:
app -- Specific app to map
user -- Allowed app map for a user
raw -- Return complete dict
user -- Only accessible app for user
app -- Specific app to map
"""
@ -253,9 +253,9 @@ def app_upgrade(app, url=None, file=None):
Upgrade app
Keyword argument:
url -- Git url to fetch for upgrade
app -- App(s) to upgrade (default all)
file -- Folder or tarball for upgrade
app -- App(s) to upgrade (default all)
url -- Git url to fetch for upgrade
"""
with YunoHostLDAP() as yldap:
@ -336,8 +336,8 @@ def app_install(app, label=None):
Install apps
Keyword argument:
app -- App ID to install
label
app -- App to install
"""
#TODO: Create tool for nginx (check path availability & stuff)
@ -521,6 +521,12 @@ def app_removeaccess(apps, users):
def app_setting(app, key, value=None):
"""
Set ou get an app setting value
Keyword argument:
value -- Value to set
app -- App ID
key -- Key to get/set
"""
settings_file = apps_setting_path + app +'/settings.yml'
@ -551,6 +557,10 @@ def app_setting(app, key, value=None):
def app_checkport(port):
"""
Check availability of a local port
Keyword argument:
port -- Port to check
"""
try:
@ -567,6 +577,11 @@ def app_checkport(port):
def app_checkurl(url, app=None):
"""
Check availability of a web path
Keyword argument:
url -- Url to check
app -- Write domain & path to app settings for further checks
"""
if "https://" == url[:8]:
@ -605,11 +620,11 @@ def app_initdb(user, password=None, db=None, sql=None):
"""
Create database and initialize it with optionnal attached script
Keyword arguments:
user -- Name of the DB user
password -- Password for the user
db -- Database name (optionnal)
sql -- Initial SQL file
Keyword argument:
db -- DB name (user unless set)
user -- Name of the DB user
password -- Password of the DB (generated unless set)
sql -- Initial SQL file
"""
if db is None:
@ -635,9 +650,8 @@ def app_initdb(user, password=None, db=None, sql=None):
def app_ssowatconf():
"""
Regenerate SSOwat conf from YunoHost settings
Regenerate SSOwat configuration file
Keyword argument:
"""

View file

@ -38,9 +38,9 @@ def domain_list(filter=None, limit=None, offset=None):
List domains
Keyword argument:
limit -- Maximum number of domain fetched
offset -- Starting number for domain fetching
filter -- LDAP filter used to search
offset -- Starting number for domain fetching
limit -- Maximum number of domain fetched
"""
with YunoHostLDAP() as yldap:

View file

@ -37,8 +37,8 @@ def dyndns_subscribe(subscribe_host="dyndns.yunohost.org", domain=None, key=None
Keyword argument:
domain -- Full domain to subscribe with
subscribe_host -- Dynette HTTP API to subscribe to
key -- Public DNS key
subscribe_host -- Dynette HTTP API to subscribe to
"""
if domain is None:
@ -77,10 +77,10 @@ def dyndns_update(dyn_host="dynhost.yunohost.org", domain=None, key=None, ip=Non
Update IP on DynDNS platform
Keyword argument:
dyn_host -- Dynette DNS server to inform
domain -- Full domain to subscribe with
ip -- IP address to send
dyn_host -- Dynette DNS server to inform
key -- Public DNS key
ip -- IP address to send
"""
if domain is None:

View file

@ -44,10 +44,10 @@ def firewall_allow(protocol=None, port=None, ipv6=None, upnp=False):
Allow connection port/protocol
Keyword argument:
upnp -- upnp
protocol -- Protocol associated with port
ipv6 -- ipv6
port -- Port to open
protocol -- Protocol associated with port
upnp -- upnp
ipv6 -- ipv6
"""
port = int(port)
@ -75,10 +75,10 @@ def firewall_disallow(protocol=None, port=None, ipv6=None, upnp=False):
Disallow connection
Keyword argument:
upnp -- upnp
protocol -- Protocol associated with port
ipv6 -- ipv6
port -- Port to open
protocol -- Protocol associated with port
upnp -- upnp
ipv6 -- ipv6
"""

View file

@ -33,11 +33,11 @@ hook_folder = '/user/share/yunohost/hooks/'
def hook_add(action, file):
"""
Store hook script to fs
Store hook script to filsystem
Keyword argument:
file -- Script to check
action -- Action folder to store into
file -- Script file to store
"""
try: os.listdir(hook_folder + action)

View file

@ -118,13 +118,13 @@ def monitor_info(memory=False, swap=False, cpu=False, disk=False, ifconfig=False
Check System
Keyword argument:
uptime -- Show Uptime
memory -- Check Memory
ifconfig -- Show Ip and MAC Adress
disk -- Check Disk
uptime -- Show Uptime
swap -- Check Swap
public -- Show IP public
cpu -- Check CPU
memory -- Check Memory
swap -- Check Swap
ifconfig -- Show Ip and MAC Adress
"""
if memory:
@ -177,12 +177,12 @@ def monitor_process(enable=None, disable=None, start=None, stop=None, check=Fals
Check Process
Keyword argument:
enable -- Enable process
disable -- Disable process
stop -- Stop process
check -- Check process
info -- Process info
disable -- Disable process
enable -- Enable process
start -- Start process
check -- Check process
stop -- Stop process
"""
if enable:

View file

@ -95,8 +95,8 @@ def tools_adminpw(old_password, new_password):
Change admin password
Keyword argument:
old_password
new_password
old_password
"""
# Validate password length
@ -131,8 +131,8 @@ def tools_maindomain(old_domain, new_domain, dyndns=False):
Main domain change tool
Keyword argument:
old_domain
new_domain
old_domain
"""
@ -203,8 +203,8 @@ def tools_postinstall(domain, password, dyndns=False):
YunoHost post-install
Keyword argument:
dyndns -- Subscribe domain to a DynDNS service
domain -- YunoHost main domain
dyndns -- Subscribe domain to a DynDNS service
password -- YunoHost admin password
"""

View file

@ -38,10 +38,10 @@ def user_list(fields=None, filter=None, limit=None, offset=None):
List users
Keyword argument:
fields -- fields to fetch
offset -- Starting number for user fetching
filter -- LDAP filter used to search
offset -- Starting number for user fetching
limit -- Maximum number of user fetched
fields -- fields to fetch
"""
with YunoHostLDAP() as yldap:
@ -91,11 +91,11 @@ def user_create(username, firstname, lastname, mail, password):
Create user
Keyword argument:
username -- Must be unique
lastname
firstname
password
lastname
username -- Must be unique
mail -- Main mail address must be unique
password
"""
with YunoHostLDAP() as yldap:
@ -160,15 +160,15 @@ def user_update(username, firstname=None, lastname=None, mail=None, change_passw
Update user informations
Keyword argument:
username -- Username of user to update
lastname
mail
firstname
add_mailalias -- Mail aliases to add
mail
lastname
remove_mailforward -- Mailforward addresses to remove
username -- Username of user to update
add_mailforward -- Mailforward addresses to add
change_password -- New password to set
remove_mailalias -- Mail aliases to remove
add_mailforward -- Mailforward addresses to add
remove_mailforward -- Mailforward addresses to remove
"""
with YunoHostLDAP() as yldap: