This commit is contained in:
Kload 2013-07-06 10:59:06 +00:00
parent 4311f3e7df
commit 6eb9dc436f
7 changed files with 50 additions and 26 deletions

View file

@ -106,10 +106,10 @@ def app_list(offset=None, limit=None, filter=None, raw=False):
List apps
Keyword argument:
raw -- Return the full app_dict
limit -- Maximum number of app fetched
offset -- Starting number for app fetching
filter -- Name filter of app_id or app_name
raw -- Return the full app_dict
"""
# TODO: List installed applications
@ -165,9 +165,9 @@ def app_info(app, instance=None, raw=False):
Get app informations
Keyword argument:
app -- App ID
instance -- App instance number
raw -- Return the full app_dict
app -- App ID
"""
try:
@ -233,10 +233,10 @@ def app_upgrade(app, instance=[], url=None, file=None):
Upgrade app
Keyword argument:
instance -- App instance number to upgrade
url -- Git url to fetch for upgrade
app -- App(s) to upgrade (default all)
file -- Folder or tarball for upgrade
instance -- App instance number to upgrade
"""
with YunoHostLDAP() as yldap:
@ -377,10 +377,10 @@ def app_install(app, domain, path='/', label=None, mode='private'):
Install apps
Keyword argument:
path
mode -- level of privacy of the app (public|protected|private)
domain
app -- App to install
path
label
"""
@ -598,8 +598,8 @@ def app_remove(app, instance=[]):
Remove app
Keyword argument:
instance -- App instance number to delete
app -- App(s) to delete
instance -- App instance number to delete
"""
lemon_conf_lines = {}
@ -662,8 +662,8 @@ def app_addaccess(apps, users):
Grant access right to users (everyone by default)
Keyword argument:
apps
users
apps
"""
if not isinstance(users, list): users = [users]
@ -711,8 +711,8 @@ def app_removeaccess(apps, users):
Revoke access right to users (everyone by default)
Keyword argument:
apps
users
apps
"""
if not isinstance(users, list): users = [users]

View file

@ -72,8 +72,8 @@ def domain_add(domains, raw=False, main=False):
Create a custom domain
Keyword argument:
raw -- Auto-configure Apache and LemonLDAP for the domain
domains -- Domain name to add
raw -- Auto-configure Apache and LemonLDAP for the domain
"""
with YunoHostLDAP() as yldap:

View file

@ -35,9 +35,9 @@ def dyndns_subscribe(subscribe_host="dyndns.yunohost.org", domain=None, key=None
Subscribe to a DynDNS service
Keyword argument:
key -- Public DNS key
subscribe_host -- Dynette HTTP API to subscribe to
domain -- Full domain to subscribe with
subscribe_host -- Dynette HTTP API to subscribe to
key -- Public DNS key
"""
if domain is None:
@ -75,9 +75,9 @@ def dyndns_update(dyn_host="dynhost.yunohost.org", domain=None, key=None, ip=Non
Keyword argument:
dyn_host -- Dynette DNS server to inform
domain -- Full domain to subscribe with
ip -- IP address to send
key -- Public DNS key
domain -- Full domain to subscribe with
"""
if domain is None:

View file

@ -45,9 +45,9 @@ 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
upnp -- upnp
port -- Port to open
"""
@ -76,9 +76,9 @@ def firewall_disallow(protocol=None, port=None, ipv6=None, upnp=False):
Disallow connection
Keyword argument:
upnp -- upnp
protocol -- Protocol associated with port
ipv6 -- ipv6
upnp -- upnp
port -- Port to open
"""

View file

@ -91,12 +91,12 @@ def monitor_info(memory=False, cpu=False, disk=False, ifconfig=False, uptime=Fal
Check System
Keyword argument:
public -- Show IP public
cpu -- Check CPU
uptime -- Show Uptime
disk -- Check Disk
ifconfig -- Show Ip and MAC Adress
public -- Show IP public
cpu -- Check CPU
memory -- Check Memory
ifconfig -- Show Ip and MAC Adress
"""
if memory:
@ -138,3 +138,27 @@ def monitor_info(memory=False, cpu=False, disk=False, ifconfig=False, uptime=Fal
raise YunoHostError(1, _('No arguments provided'))
def monitor_process(enable=None, disable=None, start=None, stop=None, check=None, info=False):
"""
Check Process
Keyword argument:
enable -- Enable process
disable -- Disable process
stop -- Stop process
check -- Check process
info -- Process info
start -- Start process
"""
if enable:
return process_enable(enable)
elif disable:
return process_disable(disable)
elif start:
return process_start(start)
elif stop:
return process_stop(stop)
elif check:
return process_check(check)
elif info:
return json.loads(s.getProcessCount())

View file

@ -176,9 +176,9 @@ def tools_postinstall(domain, password, dyndns=False):
YunoHost post-install
Keyword argument:
password -- YunoHost admin password
dyndns -- Subscribe domain to a DynDNS service
domain -- YunoHost main domain
password -- YunoHost admin password
"""
with YunoHostLDAP(password='yunohost') as yldap:

View file

@ -39,9 +39,9 @@ def user_list(fields=None, filter=None, limit=None, offset=None):
Keyword argument:
fields -- fields to fetch
limit -- Maximum number of user fetched
offset -- Starting number for user fetching
filter -- LDAP filter used to search
limit -- Maximum number of user fetched
"""
with YunoHostLDAP() as yldap:
@ -92,11 +92,11 @@ def user_create(username, firstname, lastname, mail, password):
Create user
Keyword argument:
password
firstname
mail -- Main mail address must be unique
lastname
username -- Must be unique
lastname
firstname
password
mail -- Main mail address must be unique
"""
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:
remove_mailalias -- Mail aliases to remove
change_password -- New password to set
username -- Username of user to update
remove_mailforward -- Mailforward addresses to remove
add_mailforward -- Mailforward addresses to add
firstname
add_mailalias -- Mail aliases to add
mail
lastname
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: