# HG changeset patch # User Goffi # Date 1391528960 -3600 # Node ID c01397d18026cb30c231f3041763ec56331ec67b # Parent 6abd099c70077f95fbb34411a94db6b37ab795f7 server side: paramsXml2xmlUI is now parasXML2XMLUI + improved lisibility in getParamsUI diff -r 6abd099c7007 -r c01397d18026 libervia_server/__init__.py --- a/libervia_server/__init__.py Tue Feb 04 16:49:20 2014 +0100 +++ b/libervia_server/__init__.py Tue Feb 04 16:49:20 2014 +0100 @@ -45,6 +45,7 @@ from libervia_server.blog import MicroBlog from sat_frontends.bridge.DBus import DBusBridgeFrontend, BridgeExceptionNoService from sat.core.i18n import _, D_ +from sat.tools.xml_tools import paramsXML2XMLUI class ISATSession(Interface): @@ -446,22 +447,21 @@ profile = ISATSession(self.session).profile d = self.asyncBridgeCall("getParams", Const.SECURITY_LIMIT, Const.APP_NAME, profile) - def setAuthorizedParams(d): + def setAuthorizedParams(params_xml): if self.authorized_params is None: self.authorized_params = {} - for cat in minidom.parseString(d.encode('utf-8')).getElementsByTagName("category"): + for cat in minidom.parseString(params_xml.encode('utf-8')).getElementsByTagName("category"): params = cat.getElementsByTagName("param") params_list = [param.getAttribute("name") for param in params] self.authorized_params[cat.getAttribute("name")] = params_list if self.authorized_params: - return d + return params_xml else: return None d.addCallback(setAuthorizedParams) - from sat.tools.xml_tools import paramsXml2xmlUI - d.addCallback(lambda d: paramsXml2xmlUI(d) if d else "") + d.addCallback(lambda params_xml: paramsXML2XMLUI(params_xml) if params_xml else "") return d