Mercurial > libervia-backend
diff src/tools/xml_tools.py @ 1475:7ac073d2e7e0
core(xmlui): removed useless parenthesis around assert
author | Goffi <goffi@goffi.org> |
---|---|
date | Tue, 18 Aug 2015 10:52:18 +0200 |
parents | 675e0e9f1653 |
children | 48706f4ff19c |
line wrap: on
line diff
--- a/src/tools/xml_tools.py Tue Aug 18 10:36:41 2015 +0200 +++ b/src/tools/xml_tools.py Tue Aug 18 10:52:18 2015 +0200 @@ -338,7 +338,7 @@ @param xmlui: XMLUI instance @parent: parent element """ - assert(self.type) is not None + assert self.type is not None if not hasattr(self, 'elem'): self.elem = parent.xmlui.doc.createElement(self.type) self.xmlui = xmlui @@ -377,7 +377,7 @@ type = 'field_back' def __init__(self, parent, name): - assert(isinstance(parent, ButtonWidget)) + assert isinstance(parent, ButtonWidget) super(FieldBackElement, self).__init__(parent.xmlui, parent) self.elem.setAttribute('name', name) @@ -397,7 +397,7 @@ def __init__(self, parent, children): super(InternalDataElement, self).__init__(parent.xmlui, parent) - assert(isinstance(children, list)) + assert isinstance(children, list) for child in children: self.elem.childNodes.append(child) @@ -413,7 +413,7 @@ @param option (string, tuple) @param selected (boolean) """ - assert(isinstance(parent, ListWidget)) + assert isinstance(parent, ListWidget) super(OptionElement, self).__init__(parent.xmlui, parent) if isinstance(option, basestring): value, label = option, option @@ -432,7 +432,7 @@ type = 'row' def __init__(self, parent): - assert(isinstance(parent, AdvancedListContainer)) + assert isinstance(parent, AdvancedListContainer) super(RowElement, self).__init__(parent.xmlui, parent) if parent.next_row_idx is not None: if parent.auto_index: @@ -452,7 +452,7 @@ @param label: label to be displayed in columns @param description: long descriptive text """ - assert(isinstance(parent, AdvancedListContainer)) + assert isinstance(parent, AdvancedListContainer) super(HeaderElement, self).__init__(parent.xmlui, parent) if name: self.elem.setAttribute('name', name) @@ -830,7 +830,7 @@ else: selected = [] for option in options: - assert(isinstance(option, basestring) or isinstance(option, tuple)) + assert isinstance(option, basestring) or isinstance(option, tuple) value = option if isinstance(option, basestring) else option[0] OptionElement(self, option, value in selected) @@ -1073,7 +1073,7 @@ self.current_container = self._createContainer(container, self.current_container.getParentContainer() or self.main_container, **kwargs) else: self.current_container = self.main_container if container is None else container - assert(isinstance(self.current_container, Container)) + assert isinstance(self.current_container, Container) return self.current_container def addWidget(self, type_, *args, **kwargs):