mirror of
https://github.com/YunoHost/moulinette.git
synced 2024-09-03 20:06:31 +02:00
fixes
This commit is contained in:
parent
e34f6e0b4f
commit
d30ef19b80
2 changed files with 31 additions and 20 deletions
|
@ -6,6 +6,7 @@ import ldap
|
||||||
import ldap.modlist as modlist
|
import ldap.modlist as modlist
|
||||||
import re
|
import re
|
||||||
import getpass
|
import getpass
|
||||||
|
sys.path.append('./') # Local temporary hack
|
||||||
|
|
||||||
|
|
||||||
def colorize(astr, color):
|
def colorize(astr, color):
|
||||||
|
@ -59,7 +60,7 @@ def str_to_func(astr):
|
||||||
|
|
||||||
try:
|
try:
|
||||||
func = getattr(mod, function)
|
func = getattr(mod, function)
|
||||||
except NameError:
|
except AttributeError:
|
||||||
raise YunoHostError(168, _('Function is not defined'))
|
raise YunoHostError(168, _('Function is not defined'))
|
||||||
else:
|
else:
|
||||||
return func
|
return func
|
||||||
|
|
48
yunohost
48
yunohost
|
@ -33,33 +33,43 @@ gettext.install('YunoHost')
|
||||||
|
|
||||||
from yunohost import YunoHostError, str_to_func, colorize
|
from yunohost import YunoHostError, str_to_func, colorize
|
||||||
|
|
||||||
|
|
||||||
|
"""
|
||||||
|
Category/actions dictionnary
|
||||||
|
|
||||||
|
Usage:
|
||||||
|
Add your "'action' : 'help'" to a category of this dictionnary,
|
||||||
|
and make sure the file yunohost_my-category.py exists in ./lib
|
||||||
|
|
||||||
|
Then create the function called category_action(args).
|
||||||
|
|
||||||
|
You can add some arguments with the function parse_args() below.
|
||||||
|
|
||||||
|
Example:
|
||||||
|
'add' : 'Add user' refers to :
|
||||||
|
user_add(args) function in lib/yunohost_user.py
|
||||||
|
|
||||||
|
"""
|
||||||
action_dict = {
|
action_dict = {
|
||||||
"""
|
'user' : {
|
||||||
Category/actions dictionnary
|
|
||||||
|
|
||||||
Usage:
|
|
||||||
Add your "'action' : 'help'" to a category of this dictionnary,
|
|
||||||
and make sure the file yunohost_my-category.py exists in ./lib
|
|
||||||
|
|
||||||
Then create the function called category_action(args).
|
|
||||||
|
|
||||||
You can add some arguments with the function parse_args() below.
|
|
||||||
|
|
||||||
Example:
|
|
||||||
'add' : 'Add user' refers to :
|
|
||||||
user_add(args) function in lib/yunohost_user.py
|
|
||||||
|
|
||||||
"""
|
|
||||||
'user' : {
|
|
||||||
'help' : 'Manage users',
|
'help' : 'Manage users',
|
||||||
'actions' : {
|
'actions' : {
|
||||||
'list' : 'List users',
|
'list' : 'List users',
|
||||||
'add' : 'Add user'
|
'add' : 'Create user',
|
||||||
|
#'update' : 'Update user informations',
|
||||||
|
#'delete' : 'Delete user',
|
||||||
|
#'info' : 'Show user informations'
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
'domain' : {
|
'domain' : {
|
||||||
'help' : 'Manage domains',
|
'help' : 'Manage domains',
|
||||||
'actions' : {}
|
'actions' : {
|
||||||
|
#'list' : 'List domains',
|
||||||
|
#'add' : 'Add domain',
|
||||||
|
#'remove' : 'Remove domain',
|
||||||
|
#'info' : 'Show domain informations',
|
||||||
|
#'renewcert' : 'Renew certificate for a domain'
|
||||||
|
}
|
||||||
},
|
},
|
||||||
'app' : {
|
'app' : {
|
||||||
'help' : 'Manage apps',
|
'help' : 'Manage apps',
|
||||||
|
|
Loading…
Add table
Reference in a new issue