frontends(xmlui): better handling of missing _xmluiAppend

This commit is contained in:
Goffi 2016-12-18 10:15:57 +01:00
commit 5768160d2d

View file

@ -386,12 +386,14 @@ class XMLUIPanel(XMLUIBase):
cont = self.widget_factory.createVerticalContainer(_xmlui_parent)
self._parseChilds(cont, node, ('widget', 'container'))
try:
_xmlui_parent._xmluiAppend(cont)
xmluiAppend = _xmlui_parent._xmluiAppend
except (AttributeError, TypeError): # XXX: TypeError is here because pyjamas raise a TypeError instead of an AttributeError
if _xmlui_parent is self:
self.main_cont = cont
else:
raise Exception(_("Internal Error, container has not _xmluiAppend method"))
else:
xmluiAppend(cont)
elif node.nodeName == 'tab':
name = node.getAttribute('name')