From bfd143b1e4221e88601a710e05fb25346d16abd0 Mon Sep 17 00:00:00 2001 From: Goffi Date: Sat, 14 Nov 2015 19:18:07 +0100 Subject: [PATCH] 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 --- frontends/src/bridge/DBus.py | 18 ------------ src/bridge/DBus.py | 12 -------- .../bridge_constructor/bridge_template.ini | 29 ------------------- src/core/sat_main.py | 2 -- src/memory/memory.py | 6 ---- src/memory/params.py | 29 ------------------- 6 files changed, 96 deletions(-) diff --git a/frontends/src/bridge/DBus.py b/frontends/src/bridge/DBus.py index 2863ea15..17ca73d7 100644 --- a/frontends/src/bridge/DBus.py +++ b/frontends/src/bridge/DBus.py @@ -367,15 +367,6 @@ class DBusBridgeFrontend(BridgeFrontend): 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 @@ class DBusBridgeFrontend(BridgeFrontend): 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 diff --git a/src/bridge/DBus.py b/src/bridge/DBus.py index bd7a74e7..ed000bd7 100755 --- a/src/bridge/DBus.py +++ b/src/bridge/DBus.py @@ -338,24 +338,12 @@ class DbusObject(dbus.service.Object): def getParamA(self, name, category, attribute="value", profile_key="@DEFAULT@"): 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')) diff --git a/src/bridge/bridge_constructor/bridge_template.ini b/src/bridge/bridge_constructor/bridge_template.ini index 08ce68ed..0ee90735 100644 --- a/src/bridge/bridge_constructor/bridge_template.ini +++ b/src/bridge/bridge_constructor/bridge_template.ini @@ -493,35 +493,6 @@ 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 -[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 diff --git a/src/core/sat_main.py b/src/core/sat_main.py index 50d04ce8..4f081848 100644 --- a/src/core/sat_main.py +++ b/src/core/sat_main.py @@ -89,8 +89,6 @@ class SAT(service.Service): 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) diff --git a/src/memory/memory.py b/src/memory/memory.py index 00d39691..f3a9488b 100644 --- a/src/memory/memory.py +++ b/src/memory/memory.py @@ -864,12 +864,6 @@ class Memory(object): 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() diff --git a/src/memory/params.py b/src/memory/params.py index 0ba9d053..ba52900c 100644 --- a/src/memory/params.py +++ b/src/memory/params.py @@ -702,35 +702,6 @@ class Params(object): 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 "" - - 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