Mercurial > libervia-backend
diff frontends/src/tools/xmlui.py @ 2093:cbf3af02e941
frontends(xmlui): better handling of missing _xmluiAppend
author | Goffi <goffi@goffi.org> |
---|---|
date | Sun, 18 Dec 2016 10:15:57 +0100 |
parents | db3bbbd745e4 |
children | 5defafc8ede6 |
line wrap: on
line diff
--- a/frontends/src/tools/xmlui.py Tue Dec 13 22:27:49 2016 +0100 +++ b/frontends/src/tools/xmlui.py Sun Dec 18 10:15:57 2016 +0100 @@ -386,12 +386,14 @@ 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')