Mercurial > libervia-backend
diff src/tools/xml_tools.py @ 1599:e2ed8009e66e
backend, bridge, frontends: actionNew has now a security_limit argument + added some docstring to explain data argument
author | Goffi <goffi@goffi.org> |
---|---|
date | Sat, 14 Nov 2015 19:21:56 +0100 |
parents | 51dec65ec62c |
children | e0a152f2cf6d |
line wrap: on
line diff
--- a/src/tools/xml_tools.py Sat Nov 14 19:20:33 2015 +0100 +++ b/src/tools/xml_tools.py Sat Nov 14 19:21:56 2015 +0100 @@ -1249,12 +1249,13 @@ ) return note_xmlui -def deferXMLUI(host, xmlui, profile): +def deferXMLUI(host, xmlui, security_limit=C.NO_SECURITY_LIMIT, profile=C.PROF_KEY_NONE): """Create a deferred linked to XMLUI @param xmlui(XMLUI): instance of the XMLUI Must be an XMLUI that you can submit, with submit_id set to '' @param profile: %(doc_profile)s + @param security_limit: %(doc_security_limit)s @return (data): a deferred which fire the data """ assert xmlui.submit_id == '' @@ -1265,10 +1266,10 @@ return {} xmlui.submit_id = host.registerCallback(onSubmit, with_data=True, one_shot=True) - host.actionNew({'xmlui': xmlui.toXml()}, profile) + host.actionNew({'xmlui': xmlui.toXml()}, profile=profile) return xmlui_d -def deferDialog(host, message, title=u'Please confirm', type_=C.XMLUI_DIALOG_CONFIRM, options=None, profile=None): +def deferDialog(host, message, title=u'Please confirm', type_=C.XMLUI_DIALOG_CONFIRM, options=None, security_limit=C.NO_SECURITY_LIMIT, profile=C.PROF_KEY_NONE): """Create a submitable dialog and manage it with a deferred @param message(unicode): message to display @@ -1283,7 +1284,7 @@ if options is not None: dialog_opt.update(options) dialog = XMLUI(C.XMLUI_DIALOG, title=title, dialog_opt=dialog_opt, submit_id='') - return deferXMLUI(host, dialog, profile) + return deferXMLUI(host, dialog, security_limit, profile) def deferConfirm(*args, **kwargs): """call deferDialog and return a boolean instead of the whole data dict"""