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
This commit is contained in:
Goffi 2015-11-14 19:18:07 +01:00
commit bfd143b1e4
6 changed files with 0 additions and 96 deletions

View file

@ -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

View file

@ -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'))

View file

@ -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

View file

@ -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)

View file

@ -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()

View file

@ -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 "<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