Skip to content

Commit 5bfae81

Browse files
committed
Add parameters description in class documentation. pylint and Black checked
1 parent 7c0c136 commit 5bfae81

File tree

1 file changed

+8
-11
lines changed

1 file changed

+8
-11
lines changed

adafruit_display_text/label.py

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ def __init__(
8383
anchor_point=None,
8484
anchored_position=None,
8585
scale=1,
86-
**kwargs
86+
**kwargs,
8787
):
8888
if not max_glyphs and not text:
8989
raise RuntimeError("Please provide a max size, or initial text")
@@ -94,12 +94,10 @@ def __init__(
9494
# instance the Group
9595
# self Group will contain a single local_group which contains a Group (self.local_group)
9696
# which contains a TileGrid
97-
super().__init__(
98-
max_size=1, scale=1, **kwargs
99-
) # The self scale should always be 1
100-
self.local_group = displayio.Group(
101-
max_size=max_glyphs + 1, scale=scale
102-
) # local_group will set the scale
97+
# The self scale should always be 1
98+
super().__init__(max_size=1, scale=1, **kwargs)
99+
# local_group will set the scale
100+
self.local_group = displayio.Group(max_size=max_glyphs + 1, scale=scale)
103101
self.append(self.local_group)
104102

105103
self.width = max_glyphs
@@ -203,7 +201,7 @@ def _get_ascent(self):
203201
return self._get_ascent_descent()[0]
204202

205203
def _update_background_color(self, new_color):
206-
""" Private class function that allows updating the font box background color
204+
"""Private class function that allows updating the font box background color
207205
:param new_color: int color as an RGB hex number."""
208206

209207
if new_color is None:
@@ -230,9 +228,8 @@ def _update_background_color(self, new_color):
230228
self._boundingbox[3] + self._padding_top + self._padding_bottom > 0
231229
)
232230
):
233-
if (
234-
len(self.local_group) > 0
235-
): # This can be simplified in CP v6.0, when group.append(0) bug is corrected
231+
# This can be simplified in CP v6.0, when group.append(0) bug is corrected
232+
if len(self.local_group) > 0:
236233
self.local_group.insert(
237234
0, self._create_background_box(lines, y_offset)
238235
)

0 commit comments

Comments
 (0)