Skip to content

Commit

Permalink
Bump black-pre-commit-mirror from 24.10.0 to 25.1.0 (#3147)
Browse files Browse the repository at this point in the history
Bump black-pre-commit-mirror from 24.10.0 to 25.1.0
  • Loading branch information
brutusthebee authored Feb 3, 2025
1 parent 72a96bf commit b107c0c
Show file tree
Hide file tree
Showing 15 changed files with 18 additions and 16 deletions.
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ repos:
# isort for the rest of the repo
- id: isort
- repo: https://github.com/psf/black-pre-commit-mirror
rev: 24.10.0
rev: 25.1.0
hooks:
- id: black
language_version: python3
Expand Down
1 change: 1 addition & 0 deletions changes/3147.misc.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
The ``pre-commit`` hook for ``black-pre-commit-mirror`` was updated to its latest version.
2 changes: 1 addition & 1 deletion core/src/toga/widgets/button.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ def text(self) -> str:
@text.setter
def text(self, value: str | None) -> None:
# \u200B: zero-width space
if value is None or value == "\u200B":
if value is None or value == "\u200b":
value = ""
else:
# Button text can't include line breaks. Strip any content
Expand Down
2 changes: 1 addition & 1 deletion core/src/toga/widgets/label.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ def text(self) -> str:

@text.setter
def text(self, value: object) -> None:
if value is None or value == "\u200B":
if value is None or value == "\u200b":
text = ""
else:
text = str(value)
Expand Down
2 changes: 1 addition & 1 deletion core/src/toga/widgets/switch.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ def text(self) -> str:

@text.setter
def text(self, value: object) -> None:
if value is None or value == "\u200B":
if value is None or value == "\u200b":
value = ""
else:
# Switch text can't include line breaks. Strip any content
Expand Down
2 changes: 1 addition & 1 deletion core/tests/widgets/test_button.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ def sample_icon(app):
("New Text", "New Text"),
("", ""),
(None, ""),
("\u200B", ""),
("\u200b", ""),
(12345, "12345"),
("Contains\nnewline", "Contains"),
]
Expand Down
2 changes: 1 addition & 1 deletion core/tests/widgets/test_label.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ def test_label_create_with_values():
("New Text", "New Text"),
(12345, "12345"),
(None, ""),
("\u200B", ""),
("\u200b", ""),
("Contains\nsome\nnewlines", "Contains\nsome\nnewlines"),
],
)
Expand Down
2 changes: 1 addition & 1 deletion core/tests/widgets/test_switch.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ def change_handler(widget, *args, **kwargs):
("New Text", "New Text"),
("", ""),
(None, ""),
("\u200B", ""),
("\u200b", ""),
(12345, "12345"),
("Contains\nnewline", "Contains"),
],
Expand Down
4 changes: 2 additions & 2 deletions iOS/src/toga_iOS/widgets/label.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,13 +51,13 @@ def set_font(self, font):

def get_text(self):
value = str(self.native.text)
if value == "\u200B":
if value == "\u200b":
return ""
return value

def set_text(self, value):
if value == "":
value = "\u200B"
value = "\u200b"
self.native.text = value
# Tell the text layout algorithm how many lines are allowed
self.native.numberOfLines = len(self.interface.text.split("\n"))
Expand Down
2 changes: 1 addition & 1 deletion iOS/tests_backend/widgets/label.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ class LabelProbe(SimpleProbe):
@property
def text(self):
value = str(self.native.text)
if value == "\u200B":
if value == "\u200b":
return ""
return value

Expand Down
1 change: 1 addition & 0 deletions travertino/src/travertino/colors.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

class Color:
"A base class for all colorspace representations"

pass

def __eq__(self, other):
Expand Down
4 changes: 2 additions & 2 deletions winforms/src/toga_winforms/widgets/button.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,15 @@ def winforms_click(self, sender, event):
def get_text(self):
value = self.native.Text
# Normalize a standalone ZERO WIDTH SPACE to an empty string.
if value == "\u200B":
if value == "\u200b":
return ""
return value

def set_text(self, text):
if text == "":
# An empty label would cause the widget's height to collapse, so display a
# Unicode ZERO WIDTH SPACE instead.
text = "\u200B"
text = "\u200b"
self.native.Text = text

def get_icon(self):
Expand Down
4 changes: 2 additions & 2 deletions winforms/src/toga_winforms/widgets/switch.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,15 @@ def winforms_checked_changed(self, sender, event):
def get_text(self):
value = self.native.Text
# Normalize a standalone ZERO WIDTH SPACE to an empty string.
if value == "\u200B":
if value == "\u200b":
return ""
return value

def set_text(self, text):
if text == "":
# An empty label would cause the widget's height to collapse, so display a
# Unicode ZERO WIDTH SPACE instead.
text = "\u200B"
text = "\u200b"
self.native.Text = text

def get_value(self):
Expand Down
2 changes: 1 addition & 1 deletion winforms/tests_backend/widgets/button.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ class ButtonProbe(SimpleProbe):
@property
def text(self):
# Normalize the zero width space to the empty string.
if self.native.Text == "\u200B":
if self.native.Text == "\u200b":
return ""
return self.native.Text

Expand Down
2 changes: 1 addition & 1 deletion winforms/tests_backend/widgets/switch.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@ class SwitchProbe(SimpleProbe):
@property
def text(self):
# Normalize the zero width space to the empty string.
if self.native.Text == "\u200B":
if self.native.Text == "\u200b":
return ""
return self.native.Text

0 comments on commit b107c0c

Please sign in to comment.