diff --git a/tools/xml_tools.py b/tools/xml_tools.py index ad8afd02..3dd98eb2 100644 --- a/tools/xml_tools.py +++ b/tools/xml_tools.py @@ -55,7 +55,7 @@ def dataForm2xml(form): else: form_ui.addEmpty() - elem = form_ui.addElement(__field_type, field.var, None, field.value, [option.value for option in field.options]) + elem = form_ui.addElement(__field_type, field.var, field.value, [option.value for option in field.options]) return form_ui.toXml() def tupleList2dataForm(values): @@ -233,15 +233,16 @@ class XMLUI: - def addElement(self, type, name = None, content = None, value = None, options = None, callback_id = None): + def addElement(self, type, name = None, value = None, options = None, callback_id = None): """Convenience method to add element, the params correspond to the ones in addSomething methods""" if type == 'empty': self.addEmpty(name) elif type == 'text': - assert(content) - self.addText(content, name) + assert(value!=None) + self.addText(value, name) elif type == 'label': assert(value) + self.addLabel(value) elif type == 'string': self.addString(name, value) elif type == 'password':