backend, bridge, frontends: actionNew has now a security_limit argument + added some docstring to explain data argument

This commit is contained in:
Goffi 2015-11-14 19:21:56 +01:00
commit fbbb081425
2 changed files with 30 additions and 14 deletions

View file

@ -211,6 +211,11 @@ class Const(object):
LOG_LEVELS = (LOG_LVL_DEBUG, LOG_LVL_INFO, LOG_LVL_WARNING, LOG_LVL_ERROR, LOG_LVL_CRITICAL)
## action constants ##
META_TYPE_FILE = "file"
META_TYPE_OVERWRITE = "overwrite"
## HARD-CODED ACTIONS IDS (generated with uuid.uuid4) ##
AUTHENTICATE_PROFILE_ID = u'b03bbfa8-a4ae-4734-a248-06ce6c7cf562'
CHANGE_XMPP_PASSWD_ID = u'878b9387-de2b-413b-950f-e424a147bcd0'

View file

@ -785,14 +785,15 @@ class SAT(service.Service):
del client._waiting_conf[conf_id]
cb(conf_id, accepted, data, profile)
def actionNew(self, action_data, profile):
def actionNew(self, action_data, security_limit=C.NO_SECURITY_LIMIT, profile=C.PROF_KEY_NONE):
"""Shortcut to bridge.actionNew which generate and id
@param action_data(dict): action data (see bridge documentation)
@param security_limit: %(doc_security_limit)s
@param profile: %(doc_profile)s
"""
id_ = unicode(uuid.uuid4())
self.bridge.actionNew(action_data, id_, profile)
self.bridge.actionNew(action_data, id_, security_limit, profile)
def registerProgressCb(self, progress_id, callback, profile):
"""Register a callback called when progress is requested for id"""