From bea6f75fa6b16cedea2e89743dd90674bb49a8fa Mon Sep 17 00:00:00 2001 From: Kian Khadempour <43736613+BlueishTint@users.noreply.github.com> Date: Sat, 1 Jul 2023 11:26:55 -0700 Subject: [PATCH] Change "is not" to "!=" when checking literals --- gooey/gui/components/widgets/bases.py | 2 +- gooey/gui/components/widgets/checkbox.py | 2 +- gooey/gui/components/widgets/dropdown.py | 2 +- gooey/gui/components/widgets/dropdown_filterable.py | 2 +- gooey/gui/components/widgets/listbox.py | 2 +- gooey/gui/components/widgets/textarea.py | 2 +- gooey/gui/components/widgets/textfield.py | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/gooey/gui/components/widgets/bases.py b/gooey/gui/components/widgets/bases.py index 11a19bf..7259f98 100644 --- a/gooey/gui/components/widgets/bases.py +++ b/gooey/gui/components/widgets/bases.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: diff --git a/gooey/gui/components/widgets/checkbox.py b/gooey/gui/components/widgets/checkbox.py index 219db40..83c787a 100644 --- a/gooey/gui/components/widgets/checkbox.py +++ b/gooey/gui/components/widgets/checkbox.py @@ -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'] != '') diff --git a/gooey/gui/components/widgets/dropdown.py b/gooey/gui/components/widgets/dropdown.py index f43d4a2..6e30a4c 100644 --- a/gooey/gui/components/widgets/dropdown.py +++ b/gooey/gui/components/widgets/dropdown.py @@ -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 diff --git a/gooey/gui/components/widgets/dropdown_filterable.py b/gooey/gui/components/widgets/dropdown_filterable.py index 4babdf1..69bce15 100644 --- a/gooey/gui/components/widgets/dropdown_filterable.py +++ b/gooey/gui/components/widgets/dropdown_filterable.py @@ -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] diff --git a/gooey/gui/components/widgets/listbox.py b/gooey/gui/components/widgets/listbox.py index c3f4143..e70a5f2 100644 --- a/gooey/gui/components/widgets/listbox.py +++ b/gooey/gui/components/widgets/listbox.py @@ -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'] != '') diff --git a/gooey/gui/components/widgets/textarea.py b/gooey/gui/components/widgets/textarea.py index 27dc42a..21b913b 100644 --- a/gooey/gui/components/widgets/textarea.py +++ b/gooey/gui/components/widgets/textarea.py @@ -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( diff --git a/gooey/gui/components/widgets/textfield.py b/gooey/gui/components/widgets/textfield.py index 5b5955a..3e6cab4 100644 --- a/gooey/gui/components/widgets/textfield.py +++ b/gooey/gui/components/widgets/textfield.py @@ -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()