comparison src/memory/params.py @ 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 a5e0393a06cd
children 698d6755d62a
comparison
equal deleted inserted replaced
1585:846a39900fa6 1586:42285d993e68
700 prof_xml.unlink() 700 prof_xml.unlink()
701 return '\n'.join((line for line in return_xml.split('\n') if line)) 701 return '\n'.join((line for line in return_xml.split('\n') if line))
702 702
703 return self._constructProfileXml(security_limit, app, profile).addCallback(returnXML) 703 return self._constructProfileXml(security_limit, app, profile).addCallback(returnXML)
704 704
705 def getParamsForCategory(self, category, security_limit, app, profile_key):
706 """
707 @param category: the desired category
708 @param security_limit: NO_SECURITY_LIMIT (-1) to return all the params.
709 Otherwise sole the params which have a security level defined *and*
710 lower or equal to the specified value are returned.
711 @param app: name of the frontend requesting the parameters, or '' to get all parameters
712 @param profile_key: Profile key which can be either a magic (eg: @DEFAULT@) or the name of an existing profile.
713 @return: node's xml for selected category
714 """
715 #TODO: manage category of general type (without existant profile)
716 profile = self.getProfileName(profile_key)
717 if not profile:
718 log.error(_("Asking params for inexistant profile"))
719 return ""
720
721 def returnCategoryXml(prof_xml):
722 for node in prof_xml.getElementsByTagName("category"):
723 if node.nodeName == "category" and node.getAttribute("name") == category:
724 result = node.toxml()
725 prof_xml.unlink()
726 return result
727
728 prof_xml.unlink()
729 return "<category />"
730
731 d = self._constructProfileXml(security_limit, app, profile)
732 return d.addCallback(returnCategoryXml)
733
734 def _getParamNode(self, name, category, type_="@ALL@"): # FIXME: is type_ useful ? 705 def _getParamNode(self, name, category, type_="@ALL@"): # FIXME: is type_ useful ?
735 """Return a node from the param_xml 706 """Return a node from the param_xml
736 @param name: name of the node 707 @param name: name of the node
737 @param category: category of the node 708 @param category: category of the node
738 @param type_: keyword for search: 709 @param type_: keyword for search: