Mercurial > libervia-backend
changeset 1586:42285d993e68
bridge, core(params): removed obsolete methods:
- getParams and getParamsForCategory are removed from bridge: XMLUI is now used in place of the old params XML
- getParamsForCategory has also been removed internaly, as it is now unused, getParams is still used to construct the XMLUI
author | Goffi <goffi@goffi.org> |
---|---|
date | Sat, 14 Nov 2015 19:18:07 +0100 |
parents | 846a39900fa6 |
children | 698d6755d62a |
files | frontends/src/bridge/DBus.py src/bridge/DBus.py src/bridge/bridge_constructor/bridge_template.ini src/core/sat_main.py src/memory/memory.py src/memory/params.py |
diffstat | 6 files changed, 0 insertions(+), 96 deletions(-) [+] |
line wrap: on
line diff
--- a/frontends/src/bridge/DBus.py Sat Nov 14 19:18:05 2015 +0100 +++ b/frontends/src/bridge/DBus.py Sat Nov 14 19:18:07 2015 +0100 @@ -367,15 +367,6 @@ kwargs['error_handler'] = error_handler return unicode(self.db_core_iface.getParamA(name, category, attribute, profile_key, **kwargs)) - def getParams(self, security_limit=-1, app='', profile_key="@DEFAULT@", callback=None, errback=None): - if callback is None: - error_handler = None - else: - if errback is None: - errback = log.error - error_handler = lambda err:errback(dbus_to_bridge_exception(err)) - return unicode(self.db_core_iface.getParams(security_limit, app, profile_key, timeout=const_TIMEOUT, reply_handler=callback, error_handler=error_handler)) - def getParamsCategories(self, callback=None, errback=None): if callback is None: error_handler = None @@ -390,15 +381,6 @@ kwargs['error_handler'] = error_handler return self.db_core_iface.getParamsCategories(**kwargs) - def getParamsForCategory(self, category, security_limit=-1, app='', profile_key="@DEFAULT@", callback=None, errback=None): - if callback is None: - error_handler = None - else: - if errback is None: - errback = log.error - error_handler = lambda err:errback(dbus_to_bridge_exception(err)) - return unicode(self.db_core_iface.getParamsForCategory(category, security_limit, app, profile_key, timeout=const_TIMEOUT, reply_handler=callback, error_handler=error_handler)) - def getParamsUI(self, security_limit=-1, app='', profile_key="@DEFAULT@", callback=None, errback=None): if callback is None: error_handler = None
--- a/src/bridge/DBus.py Sat Nov 14 19:18:05 2015 +0100 +++ b/src/bridge/DBus.py Sat Nov 14 19:18:07 2015 +0100 @@ -339,24 +339,12 @@ return self._callback("getParamA", unicode(name), unicode(category), unicode(attribute), unicode(profile_key)) @dbus.service.method(const_INT_PREFIX+const_CORE_SUFFIX, - in_signature='iss', out_signature='s', - async_callbacks=('callback', 'errback')) - def getParams(self, security_limit=-1, app='', profile_key="@DEFAULT@", callback=None, errback=None): - return self._callback("getParams", security_limit, unicode(app), unicode(profile_key), callback=callback, errback=errback) - - @dbus.service.method(const_INT_PREFIX+const_CORE_SUFFIX, in_signature='', out_signature='as', async_callbacks=None) def getParamsCategories(self, ): return self._callback("getParamsCategories", ) @dbus.service.method(const_INT_PREFIX+const_CORE_SUFFIX, - in_signature='siss', out_signature='s', - async_callbacks=('callback', 'errback')) - def getParamsForCategory(self, category, security_limit=-1, app='', profile_key="@DEFAULT@", callback=None, errback=None): - return self._callback("getParamsForCategory", unicode(category), security_limit, unicode(app), unicode(profile_key), callback=callback, errback=errback) - - @dbus.service.method(const_INT_PREFIX+const_CORE_SUFFIX, in_signature='iss', out_signature='s', async_callbacks=('callback', 'errback')) def getParamsUI(self, security_limit=-1, app='', profile_key="@DEFAULT@", callback=None, errback=None):
--- a/src/bridge/bridge_constructor/bridge_template.ini Sat Nov 14 19:18:05 2015 +0100 +++ b/src/bridge/bridge_constructor/bridge_template.ini Sat Nov 14 19:18:07 2015 +0100 @@ -493,35 +493,6 @@ doc_param_1=app: name of the frontend requesting the parameters, or '' to get all parameters doc_param_2=%(doc_profile_key)s -[getParams] -async= -type=method -category=core -sig_in=iss -sig_out=s -param_0_default=-1 -param_1_default='' -param_2_default="@DEFAULT@" -doc=Return XML of parameters, eventually restrict the result to the parameters concerning a given frontend -doc_param_0=%(doc_security_limit)s -doc_param_1=app: name of the frontend requesting the parameters, or '' to get all parameters -doc_param_2=%(doc_profile_key)s - -[getParamsForCategory] -async= -type=method -category=core -sig_in=siss -sig_out=s -param_1_default=-1 -param_2_default='' -param_3_default="@DEFAULT@" -doc=Return a xml of all params in a category, eventually restrict the result to the parameters concerning a given frontend -doc_param_0=category: Category to get -doc_param_1=%(doc_security_limit)s -doc_param_2=app: name of the frontend requesting the parameters, or '' to get all parameters -doc_param_3=%(doc_profile_key)s - [getParamsCategories] type=method category=core
--- a/src/core/sat_main.py Sat Nov 14 19:18:05 2015 +0100 +++ b/src/core/sat_main.py Sat Nov 14 19:18:07 2015 +0100 @@ -89,8 +89,6 @@ self.bridge.register("getParamA", self.memory.getStringParamA) self.bridge.register("asyncGetParamA", self.memory.asyncGetStringParamA) self.bridge.register("getParamsUI", self.memory.getParamsUI) - self.bridge.register("getParams", self.memory.getParams) - self.bridge.register("getParamsForCategory", self.memory.getParamsForCategory) self.bridge.register("getParamsCategories", self.memory.getParamsCategories) self.bridge.register("paramsRegisterApp", self.memory.paramsRegisterApp) self.bridge.register("getHistory", self.memory.getHistory)
--- a/src/memory/memory.py Sat Nov 14 19:18:05 2015 +0100 +++ b/src/memory/memory.py Sat Nov 14 19:18:07 2015 +0100 @@ -864,12 +864,6 @@ def getParamsUI(self, security_limit=C.NO_SECURITY_LIMIT, app='', profile_key=C.PROF_KEY_NONE): return self.params.getParamsUI(security_limit, app, profile_key) - def getParams(self, security_limit=C.NO_SECURITY_LIMIT, app='', profile_key=C.PROF_KEY_NONE): - return self.params.getParams(security_limit, app, profile_key) - - def getParamsForCategory(self, category, security_limit=C.NO_SECURITY_LIMIT, app='', profile_key=C.PROF_KEY_NONE): - return self.params.getParamsForCategory(category, security_limit, app, profile_key) - def getParamsCategories(self): return self.params.getParamsCategories()
--- a/src/memory/params.py Sat Nov 14 19:18:05 2015 +0100 +++ b/src/memory/params.py Sat Nov 14 19:18:07 2015 +0100 @@ -702,35 +702,6 @@ return self._constructProfileXml(security_limit, app, profile).addCallback(returnXML) - def getParamsForCategory(self, category, security_limit, app, profile_key): - """ - @param category: the desired category - @param security_limit: NO_SECURITY_LIMIT (-1) to return all the params. - Otherwise sole the params which have a security level defined *and* - lower or equal to the specified value are returned. - @param app: name of the frontend requesting the parameters, or '' to get all parameters - @param profile_key: Profile key which can be either a magic (eg: @DEFAULT@) or the name of an existing profile. - @return: node's xml for selected category - """ - #TODO: manage category of general type (without existant profile) - profile = self.getProfileName(profile_key) - if not profile: - log.error(_("Asking params for inexistant profile")) - return "" - - def returnCategoryXml(prof_xml): - for node in prof_xml.getElementsByTagName("category"): - if node.nodeName == "category" and node.getAttribute("name") == category: - result = node.toxml() - prof_xml.unlink() - return result - - prof_xml.unlink() - return "<category />" - - d = self._constructProfileXml(security_limit, app, profile) - return d.addCallback(returnCategoryXml) - def _getParamNode(self, name, category, type_="@ALL@"): # FIXME: is type_ useful ? """Return a node from the param_xml @param name: name of the node