Skip to content

Commit 5d299cc

Browse files
committed
ran black and pylint
1 parent 9ef676e commit 5d299cc

File tree

2 files changed

+19
-17
lines changed

2 files changed

+19
-17
lines changed

adafruit_display_text/bitmap_label.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ def __init__(
118118
# self Group will contain a single local_group which contains one TileGrid which contains
119119
# the text bitmap
120120
super().__init__(
121-
max_size=1, x=x, y=y,
121+
max_size=1, x=x, y=y,
122122
) # this will include any arguments, including scale
123123

124124
self.local_group = displayio.Group(

adafruit_display_text/label.py

Lines changed: 18 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ def __init__(
8787
max_glyphs = len(text)
8888
# add one to max_size for the background bitmap tileGrid
8989
super().__init__(max_size=1)
90-
self.local_group=displayio.Group(max_size=max_glyphs + 1, scale=scale)
90+
self.local_group = displayio.Group(max_size=max_glyphs + 1, scale=scale)
9191
self.append(self.local_group)
9292

9393
self.width = max_glyphs
@@ -119,15 +119,14 @@ def __init__(
119119
self._padding_bottom = padding_bottom
120120
self._padding_left = padding_left
121121
self._padding_right = padding_right
122-
123-
self._scale=scale
122+
123+
self._scale = scale
124124

125125
if text is not None:
126126
self._update_text(str(text))
127127
if (anchored_position is not None) and (anchor_point is not None):
128128
self.anchored_position = anchored_position
129129

130-
131130
def _create_background_box(self, lines, y_offset):
132131

133132
left = self._boundingbox[0]
@@ -173,8 +172,6 @@ def _create_background_box(self, lines, y_offset):
173172
y=y_box_offset,
174173
)
175174

176-
177-
178175
return tile_grid
179176

180177
def _update_background_color(self, new_color):
@@ -203,10 +200,16 @@ def _update_background_color(self, new_color):
203200
self._boundingbox[3] + self._padding_top + self._padding_bottom > 0
204201
)
205202
):
206-
if len(self.local_group) > 0: # This can be simplified in CP v6.0, when group.append(0) bug is corrected
207-
self.local_group.insert(0, self._create_background_box(lines, y_offset))
203+
if (
204+
len(self.local_group) > 0
205+
): # This can be simplified in CP v6.0, when group.append(0) bug is corrected
206+
self.local_group.insert(
207+
0, self._create_background_box(lines, y_offset)
208+
)
208209
else:
209-
self.local_group.append(self._create_background_box(lines, y_offset))
210+
self.local_group.append(
211+
self._create_background_box(lines, y_offset)
212+
)
210213
self._added_background_tilegrid = True
211214

212215
else: # a bitmap is present in the self Group
@@ -322,7 +325,7 @@ def line_spacing(self):
322325
@line_spacing.setter
323326
def line_spacing(self, spacing):
324327
self._line_spacing = spacing
325-
self.text=self._text # redraw the box
328+
self.text = self._text # redraw the box
326329

327330
@property
328331
def color(self):
@@ -364,16 +367,15 @@ def text(self, new_text):
364367

365368
@property
366369
def scale(self):
370+
"""Set the scaling of the label, in integer values"""
367371
return self._scale
368372

369373
@scale.setter
370374
def scale(self, new_scale):
371-
current_anchored_position=self.anchored_position
372-
self._scale=new_scale
373-
self.local_group.scale=new_scale
374-
self.anchored_position=current_anchored_position
375-
376-
375+
current_anchored_position = self.anchored_position
376+
self._scale = new_scale
377+
self.local_group.scale = new_scale
378+
self.anchored_position = current_anchored_position
377379

378380
@property
379381
def font(self):

0 commit comments

Comments
 (0)