comparison frontends/src/tools/xmlui.py @ 2424:467ddb437a71

frontends (xmlui): fixed crash on advanced_list use: the data variable was set to None but kept for other nodes, resulting in a crash in a later test where a dict was expected.
author Goffi <goffi@goffi.org>
date Wed, 08 Nov 2017 08:31:21 +0100
parents c38c54c47e16
children 0046283a285d
comparison
equal deleted inserted replaced
2423:e3edbccd26d7 2424:467ddb437a71
375 @param _xmlui_parent: widget container with '_xmluiAppend' method 375 @param _xmlui_parent: widget container with '_xmluiAppend' method
376 @param current_node: element from which childs will be parsed 376 @param current_node: element from which childs will be parsed
377 @param wanted: list of tag names that can be present in the childs to be SàT XMLUI compliant 377 @param wanted: list of tag names that can be present in the childs to be SàT XMLUI compliant
378 @param data(None, dict): additionnal data which are needed in some cases 378 @param data(None, dict): additionnal data which are needed in some cases
379 """ 379 """
380 if data is None:
381 data = {}
382 for node in current_node.childNodes: 380 for node in current_node.childNodes:
381 if data is None:
382 data = {}
383 if wanted and not node.nodeName in wanted: 383 if wanted and not node.nodeName in wanted:
384 raise InvalidXMLUI('Unexpected node: [%s]' % node.nodeName) 384 raise InvalidXMLUI('Unexpected node: [%s]' % node.nodeName)
385 385
386 if node.nodeName == "container": 386 if node.nodeName == "container":
387 type_ = node.getAttribute('type') 387 type_ = node.getAttribute('type')