Skip to content

Commit

Permalink
Fix for #63
Browse files Browse the repository at this point in the history
- Fixed an issue that Python tuples are not recognized in logic comparisons. Replacing with lists resolved the logic.
  • Loading branch information
macarooni-man committed Jun 24, 2024
1 parent d04dcad commit 33e14c5
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions source/menu.py
Original file line number Diff line number Diff line change
Expand Up @@ -163,11 +163,11 @@ def __setattr__(self, key, value):
if constants.locale != 'en':
if key == 'font_size' and not self.__o_size__:
self.__o_size__ = value
if key in ('text') and isinstance(value, str) and not value.isnumeric() and value.strip() and self.__translate__:
if key in ['text'] and isinstance(value, str) and not value.isnumeric() and value.strip() and self.__translate__:
o = value
value = constants.translate(value)
Clock.schedule_once(functools.partial(scale_size, self, o, value), 0)
elif constants.locale == 'en' and key in ('text'):
elif constants.locale == 'en' and key in ['text']:
value = filter_text(value)
super().__setattr__(key, value)
class Button(Button):
Expand All @@ -180,11 +180,11 @@ def __setattr__(self, key, value):
if constants.locale != 'en':
if key == 'font_size' and not self.__o_size__:
self.__o_size__ = value
if key in ('text') and isinstance(value, str) and not value.isnumeric() and value.strip() and self.__translate__:
if key in ['text'] and isinstance(value, str) and not value.isnumeric() and value.strip() and self.__translate__:
o = value
value = constants.translate(value)
Clock.schedule_once(functools.partial(scale_size, self, o, value), 0)
elif constants.locale == 'en' and key in ('text'):
elif constants.locale == 'en' and key in ['text']:
value = filter_text(value)
super().__setattr__(key, value)
class TextInput(TextInput):
Expand All @@ -197,11 +197,11 @@ def __setattr__(self, key, value):
if constants.locale != 'en':
if key == 'font_size' and not self.__o_size__:
self.__o_size__ = value
if key in ('hint_text') and isinstance(value, str) and not value.isnumeric() and value.strip() and self.__translate__:
if key in ['hint_text'] and isinstance(value, str) and not value.isnumeric() and value.strip() and self.__translate__:
o = value
value = constants.translate(value)
Clock.schedule_once(functools.partial(scale_size, self, o, value), 0)
elif constants.locale == 'en' and key in ('hint_text'):
elif constants.locale == 'en' and key in ['hint_text']:
value = filter_text(value)
super().__setattr__(key, value)

Expand Down

0 comments on commit 33e14c5

Please sign in to comment.