Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions gooey/gui/components/options/options.py
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ def FilterableDropdown(placeholder=None,

def PrefixSearchStrategy(
choice_tokenizer=PrefixTokenizers.WORDS,
input_tokenizer=PrefixTokenizers.REGEX('\s'),
input_tokenizer=PrefixTokenizers.REGEX(r'\s'),
ignore_case=True,
operator='AND',
index_suffix=False):
Expand Down Expand Up @@ -300,9 +300,8 @@ def RegexValidator(test=None, message=None):
"""
Creates the data for a basic RegexValidator.

:param test: the regex expression. This should be the expression
directly (i.e. `test='\d+'`). Gooey will test
that the user's input satisfies this expression.
:param test: the regex expression. Gooey will test that the user's
input satisfies this expression.
:param message: The message to display if the input doesn't match
the regex
"""
Expand Down
2 changes: 1 addition & 1 deletion gooey/gui/components/options/validators.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ def is_three_channeled(value):
@lift
def is_hex_string(value: str):
"""Invalid hexadecimal format. Expected: "#FFFFFF" """
return isinstance(value, str) and bool(re.match('^#[\dABCDEF]{6}$', value, flags=2))
return isinstance(value, str) and bool(re.match(r'^#[\dABCDEF]{6}$', value, flags=2))


@lift
Expand Down
2 changes: 1 addition & 1 deletion gooey/gui/components/widgets/bases.py
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ def getUiState(self) -> t.FormField:
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:
Expand Down
4 changes: 2 additions & 2 deletions gooey/gui/components/widgets/checkbox.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ def syncUiState(self, state: t.Checkbox): # type: ignore
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'] != '')



Expand Down Expand Up @@ -125,4 +125,4 @@ def arrange(self, *args, **kwargs):
layout.Add(hsizer, 1, wx.EXPAND)
layout.AddSpacer(2)

return layout
return layout
2 changes: 1 addition & 1 deletion gooey/gui/components/widgets/dropdown.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ def syncUiState(self, state: FormField):
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
Expand Down
2 changes: 1 addition & 1 deletion gooey/gui/components/widgets/dropdown_filterable.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ def syncUiState(self, state: t.DropdownFilterable): # type: ignore
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]
Expand Down
2 changes: 1 addition & 1 deletion gooey/gui/components/widgets/listbox.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,4 +51,4 @@ def syncUiState(self, state: t.Listbox): # type: ignore
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'] != '')
2 changes: 1 addition & 1 deletion gooey/gui/components/widgets/textarea.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ def formatOutput(self, metatdata, value: str):
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(
Expand Down
2 changes: 1 addition & 1 deletion gooey/gui/components/widgets/textfield.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,5 @@ def syncUiState(self, state: t.TextField): # type: ignore
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()