Browse Source
Change "is not" to "!=" when checking literals
pull/886/head
Kian Khadempour
1 year ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with
7 additions and
7 deletions
-
gooey/gui/components/widgets/bases.py
-
gooey/gui/components/widgets/checkbox.py
-
gooey/gui/components/widgets/dropdown.py
-
gooey/gui/components/widgets/dropdown_filterable.py
-
gooey/gui/components/widgets/listbox.py
-
gooey/gui/components/widgets/textarea.py
-
gooey/gui/components/widgets/textfield.py
|
|
@ -183,7 +183,7 @@ class TextContainer(BaseWidget): |
|
|
|
def syncUiState(self, state: FormField): # type: ignore |
|
|
|
self.widget.setValue(state['value']) # type: ignore |
|
|
|
self.error.SetLabel(state['error'] or '') |
|
|
|
self.error.Show(state['error'] is not None and state['error'] is not '') |
|
|
|
self.error.Show(state['error'] is not None and state['error'] != '') |
|
|
|
|
|
|
|
|
|
|
|
def getValue(self) -> t.FieldValue: |
|
|
|
|
|
@ -71,7 +71,7 @@ class CheckBox(TextContainer): |
|
|
|
checkbox.Enable(state['enabled']) |
|
|
|
self.Show(state['visible']) |
|
|
|
self.error.SetLabel(state['error'] or '') |
|
|
|
self.error.Show(state['error'] is not None and state['error'] is not '') |
|
|
|
self.error.Show(state['error'] is not None and state['error'] != '') |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -52,7 +52,7 @@ class Dropdown(TextContainer): |
|
|
|
if state['selected'] is not None: # type: ignore |
|
|
|
self.setValue(state['selected']) # type: ignore |
|
|
|
self.error.SetLabel(state['error'] or '') |
|
|
|
self.error.Show(state['error'] is not None and state['error'] is not '') |
|
|
|
self.error.Show(state['error'] is not None and state['error'] != '') |
|
|
|
|
|
|
|
def getUiState(self) -> t.FormField: |
|
|
|
widget: wx.ComboBox = self.widget |
|
|
|
|
|
@ -128,7 +128,7 @@ class FilterableDropdown(Dropdown): |
|
|
|
if state['value'] is not None: |
|
|
|
self.setValue(state['value']) |
|
|
|
self.error.SetLabel(state['error'] or '') |
|
|
|
self.error.Show(state['error'] is not None and state['error'] is not '') |
|
|
|
self.error.Show(state['error'] is not None and state['error'] != '') |
|
|
|
|
|
|
|
def OnGetItem(self, n): |
|
|
|
return self.model.suggestions[n] |
|
|
|
|
|
@ -51,4 +51,4 @@ class Listbox(TextContainer): |
|
|
|
for string in state['selected']: |
|
|
|
widget.SetStringSelection(string) |
|
|
|
self.error.SetLabel(state['error'] or '') |
|
|
|
self.error.Show(state['error'] is not None and state['error'] is not '') |
|
|
|
self.error.Show(state['error'] is not None and state['error'] != '') |
|
|
@ -41,7 +41,7 @@ class Textarea(TextContainer): |
|
|
|
def syncUiState(self, state: FormField): |
|
|
|
self.setValue(state['value']) # type: ignore |
|
|
|
self.error.SetLabel(state['error'] or '') |
|
|
|
self.error.Show(state['error'] is not None and state['error'] is not '') |
|
|
|
self.error.Show(state['error'] is not None and state['error'] != '') |
|
|
|
|
|
|
|
def getUiState(self) -> t.FormField: |
|
|
|
return t.TextField( |
|
|
|
|
|
@ -27,5 +27,5 @@ class TextField(TextContainer): |
|
|
|
textctr.Enable(state['enabled']) |
|
|
|
self.Show(state['visible']) |
|
|
|
self.error.SetLabel(state['error'] or '') |
|
|
|
self.error.Show(state['error'] is not None and state['error'] is not '') |
|
|
|
self.error.Show(state['error'] is not None and state['error'] != '') |
|
|
|
self.Layout() |