Skip to content

Commit 2dd2d8b

Browse files
committed
Formatting corrections for button_base.py
Correct formatting to avoid ruff errors.
1 parent b2759a2 commit 2dd2d8b

File tree

1 file changed

+11
-9
lines changed

1 file changed

+11
-9
lines changed

adafruit_button/button_base.py

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -49,11 +49,13 @@ class ButtonBase(Group):
4949
:param int height: The height of the button in tiles.
5050
:param Optional[str] name: A name, or miscellaneous string that is stored on the button.
5151
:param Optional[str] label: The text that appears inside the button.
52-
:param Optional[FontProtocol] label_font: The button label font. Defaults to ''terminalio.FONT''
53-
:param Optional[Union[int, Tuple[int, int, int]]] label_color: The color of the button label text. Defaults to 0x0.
54-
Accepts an int or a tuple of 3 integers representing RGB values. Defaults to an inverse of label_color.
55-
:param Optional[Union[int, Tuple[int, int, int]]] selected_label: The color of button label text when the button is selected.
56-
Accepts an int or a tuple of 3 integers representing RGB values. Defaults to an inverse of label_color.
52+
:param Optional[FontProtocol] label_font: The button label font.
53+
Defaults to ''terminalio.FONT''
54+
:param Optional[Union[int, Tuple[int, int, int]]] label_color: The color of the label text.
55+
Defaults to 0x0. Accepts an int or a tuple of 3 integers representing RGB values.
56+
:param Optional[Union[int, Tuple[int, int, int]]] selected_label: The color of the label text
57+
when the button is selected. Accepts an int or a tuple of 3 integers representing RGB values.
58+
Defaults to an inverse of label_color.
5759
:param Optional[int] label_scale: The scale factor used for the label. Defaults to 1.
5860
"""
5961

@@ -67,8 +69,8 @@ def __init__(
6769
name: Optional[str] = None,
6870
label: Optional[str] = None,
6971
label_font: Optional[FontProtocol] = None,
70-
label_color: Optional[Union[int, tuple[int, int, int]]] = 0x0,
71-
selected_label: Optional[Union[int, tuple[int, int, int]]] = None,
72+
label_color: Optional[Union[int, Tuple[int, int, int]]] = 0x0,
73+
selected_label: Optional[Union[int, Tuple[int, int, int]]] = None,
7274
label_scale: Optional[int] = 1,
7375
) -> None:
7476
super().__init__(x=x, y=y)
@@ -156,7 +158,7 @@ def selected_label(self) -> int:
156158
return self._selected_label
157159

158160
@selected_label.setter
159-
def selected_label(self, new_color: Union[int, tuple[int, int, int]]) -> None:
161+
def selected_label(self, new_color: Union[int, Tuple[int, int, int]]) -> None:
160162
self._selected_label = _check_color(new_color)
161163

162164
@property
@@ -165,6 +167,6 @@ def label_color(self) -> int:
165167
return self._label_color
166168

167169
@label_color.setter
168-
def label_color(self, new_color: Union[int, tuple[int, int, int]]) -> None:
170+
def label_color(self, new_color: Union[int, Tuple[int, int, int]]) -> None:
169171
self._label_color = _check_color(new_color)
170172
self._label.color = self._label_color

0 commit comments

Comments
 (0)