params to XMLUI tools
- xml_tools: new paramsXml2xmlUI method, for conversion from params xml to User Interface XML - xml_tools: new addButton method - bridge: new method getParamsUI
This commit is contained in:
parent
a443a156f3
commit
923d2cd145
1 changed files with 80 additions and 12 deletions
|
|
@ -29,6 +29,7 @@ from logging import debug, info, error
|
|||
import pdb
|
||||
from twisted.internet import defer
|
||||
from twisted.words.protocols.jabber import jid
|
||||
from tools.xml_tools import paramsXml2xmlUI
|
||||
|
||||
SAVEFILE_PARAM_XML="/param" #xml parameters template
|
||||
SAVEFILE_PARAM_DATA="/param" #individual & general parameters; _ind and _gen suffixes will be added
|
||||
|
|
@ -281,6 +282,14 @@ class Param():
|
|||
return prof_xml
|
||||
|
||||
|
||||
def getParamsUI(self, profile_key='@DEFAULT'):
|
||||
"""Return a SàT XMLUI for parameters, with given profile"""
|
||||
profile = self.getProfileName(profile_key)
|
||||
if not profile:
|
||||
error(_("Asking params for inexistant profile"))
|
||||
return ""
|
||||
param_xml = self.getParams(profile)
|
||||
return paramsXml2xmlUI(param_xml)
|
||||
|
||||
def getParams(self, profile_key='@DEFAULT@'):
|
||||
"""Construct xml for asked profile
|
||||
|
|
@ -618,8 +627,11 @@ class Memory:
|
|||
def getParamA(self, name, category, attr="value", profile_key="@DEFAULT@"):
|
||||
return self.params.getParamA(name, category, attr, profile_key)
|
||||
|
||||
def getParams(self):
|
||||
return self.params.getParams()
|
||||
def getParamsUI(self, profile_key='@DEFAULT@'):
|
||||
return self.params.getParamsUI(profile_key)
|
||||
|
||||
def getParams(self, profile_key='@DEFAULT@'):
|
||||
return self.params.getParams(profile_key)
|
||||
|
||||
def getParamsForCategory(self, category, profile_key='@DEFAULT@'):
|
||||
return self.params.getParamsForCategory(category, profile_key)
|
||||
|
|
|
|||
Loading…
Reference in a new issue