Mercurial > libervia-backend
diff frontends/src/primitivus/xmlui.py @ 587:952322b1d490
Remove trailing whitespaces.
author | Emmanuel Gil Peyrot <linkmauve@linkmauve.fr> |
---|---|
date | Fri, 18 Jan 2013 17:55:34 +0100 |
parents | ca13633d3b6b |
children | c123dddaea6b |
line wrap: on
line diff
--- a/frontends/src/primitivus/xmlui.py Fri Jan 18 17:55:27 2013 +0100 +++ b/frontends/src/primitivus/xmlui.py Fri Jan 18 17:55:34 2013 +0100 @@ -44,12 +44,12 @@ pile.widget_list.append(widget) pile.item_types.append(('weight',getattr(self,'weight_'+str(self.idx)))) self.idx = (self.idx + 1) % 2 - + class InvalidXMLUI(Exception): pass class XMLUI(urwid.WidgetWrap): - + def __init__(self, host, xml_data, title = None, options = None, misc = None): self.host = host self.title = title @@ -72,7 +72,7 @@ type = elem.getAttribute("type") value = elem.getAttribute("value") if elem.hasAttribute('value') else u'' if type=="empty": - ctrl = urwid.Text('') + ctrl = urwid.Text('') elif type=="text": try: value = elem.childNodes[0].wholeText @@ -135,10 +135,10 @@ warning(_("Unknown layout, using default one")) self.__parseElems(node, current) elif node.nodeName == "category": - name = node.getAttribute('name') - label = node.getAttribute('label') + name = node.getAttribute('name') + label = node.getAttribute('label') if not name or not isinstance(data,sat_widgets.TabsContainer): - raise InvalidXMLUI + raise InvalidXMLUI if self.type == 'param': self._current_category = name #XXX: awful hack because params need category and we don't keep parent tab_cont = data @@ -150,9 +150,9 @@ raise NotImplementedError def constructUI(self, xml_data): - + ret_wid = urwid.ListBox(urwid.SimpleListWalker([])) - + cat_dom = minidom.parseString(xml_data.encode('utf-8')) top=cat_dom.documentElement self.type = top.getAttribute("type") @@ -166,11 +166,11 @@ self.__parseChilds(ret_wid.body, cat_dom.documentElement) assert ret_wid.body - + if isinstance(ret_wid.body[0],sat_widgets.TabsContainer): ret_wid = ret_wid.body[0] #xxx: awfull hack cause TabsContainer is a BoxWidget, can't be inside a ListBox - - + + if self.type == 'form': buttons = [] buttons.append(urwid.Button(_('Submit'),self.onFormSubmitted)) @@ -195,7 +195,7 @@ - popup - window""" self.__dest = "popup" - decorated = sat_widgets.LabelLine(self, sat_widgets.SurroundedText(self.title or '')) + decorated = sat_widgets.LabelLine(self, sat_widgets.SurroundedText(self.title or '')) if show_type == 'popup': self.host.showPopUp(decorated) elif show_type == 'window': @@ -244,7 +244,7 @@ else: warning (_("The form data is not sent back, the type is not managed properly")) self.host.removePopUp() - + def onFormCancelled(self, button): if self.__dest == 'window': self.host.removeWindow()