Skip to content

Commit 2b57d31

Browse files
committed
Run pre-commit
1 parent 7b6352b commit 2b57d31

15 files changed

+2
-31
lines changed

adafruit_displayio_layout/layouts/grid_layout.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,6 @@ def _layout_cells(self) -> None:
153153
pass
154154

155155
if not hasattr(cell["content"], "anchor_point"):
156-
157156
cell["content"].x = (
158157
int(grid_position_x * self._width / grid_size_x)
159158
+ self.cell_padding

adafruit_displayio_layout/layouts/tab_layout.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,6 @@ def __init__(
8585
showing_tab_transparent_indexes: Optional[Union[int, Tuple[int, int]]] = None,
8686
tab_count: int = None,
8787
):
88-
8988
if display is None:
9089
# pylint: disable=import-outside-toplevel
9190
import board
@@ -283,7 +282,6 @@ def handle_touch_events(self, touch_event):
283282

284283
if touch_event:
285284
if 0 <= touch_event[1] <= self.tab_height:
286-
287285
touched_tab_index = touch_event[0] // (
288286
self.display.width // self.tab_count
289287
)

adafruit_displayio_layout/widgets/cartesian.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,6 @@ def __init__(
188188
verbose: bool = False,
189189
**kwargs: Any,
190190
) -> None:
191-
192191
super().__init__(**kwargs)
193192

194193
self._verbose = verbose
@@ -335,7 +334,6 @@ def _get_font_height(font: terminalio.FONT, scale: int) -> Tuple[int, int]:
335334
return font_width, font_height
336335

337336
def _draw_axes(self) -> None:
338-
339337
bitmaptools.fill_region(
340338
self._axesx_bitmap,
341339
0,
@@ -432,7 +430,6 @@ def _draw_ticks(self) -> None:
432430

433431
if self._subticks:
434432
if i in subticks:
435-
436433
bitmaptools.fill_region(
437434
self._axesy_bitmap,
438435
self._axesy_width
@@ -446,7 +443,6 @@ def _draw_ticks(self) -> None:
446443
)
447444

448445
def _draw_pointers(self, x: int, y: int) -> None:
449-
450446
self._circle_palette = displayio.Palette(1)
451447

452448
self._circle_palette[0] = self._pointer_color

adafruit_displayio_layout/widgets/flip_input.py

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -262,9 +262,7 @@ def __init__(
262262
# Add the two arrow triangles, if required
263263

264264
if (arrow_color is not None) or (arrow_outline is not None):
265-
266265
if horizontal: # horizontal orientation, add left and right arrows
267-
268266
if (
269267
(arrow_width is not None)
270268
and (arrow_height is not None)
@@ -304,7 +302,6 @@ def __init__(
304302
)
305303
)
306304
else: # vertical orientation, add upper and lower arrows
307-
308305
if (
309306
(arrow_height is not None)
310307
and (arrow_width is not None)
@@ -345,13 +342,11 @@ def __init__(
345342

346343
# Draw function to update the current value
347344
def _update_value(self, new_value: int, animate: bool = True) -> None:
348-
349345
if (
350346
(self._animation_time is not None)
351347
and (self._animation_time > 0) # If animation is required
352348
and (animate)
353349
):
354-
355350
if ((new_value - self.value) == 1) or (
356351
(self.value == (len(self.value_list) - 1)) and (new_value == 0)
357352
): # wrap around
@@ -553,7 +548,6 @@ def _draw_position(
553548
position: float = 0.0,
554549
horizontal: bool = True,
555550
) -> None:
556-
557551
x_offset1 = bitmap1_offset[0]
558552
y_offset1 = bitmap1_offset[1]
559553
x_offset2 = bitmap2_offset[0]
@@ -598,6 +592,7 @@ def _draw_position(
598592

599593
# pylint: disable=invalid-name
600594

595+
601596
# _blit_constrained: Copies bitmaps with constraints to the dimensions
602597
def _blit_constrained(
603598
target: displayio.Bitmap,
@@ -662,7 +657,6 @@ def _animate_bitmap(
662657
animation_time: float,
663658
horizontal: bool,
664659
) -> None:
665-
666660
start_time = time.monotonic()
667661

668662
if start_position > end_position: # direction is decreasing: "out"
@@ -686,7 +680,6 @@ def _animate_bitmap(
686680
display.auto_refresh = True
687681

688682
while True:
689-
690683
this_time = time.monotonic()
691684
target_position = (
692685
start_position
@@ -709,7 +702,6 @@ def _animate_bitmap(
709702
)
710703
display.auto_refresh = True
711704
else:
712-
713705
_draw_position(
714706
target_bitmap,
715707
bitmap1,

adafruit_displayio_layout/widgets/icon_animated.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,6 @@ def __init__(
152152
animation_time: float = 0.15,
153153
**kwargs: Any,
154154
) -> None:
155-
156155
if self.__class__.display is None:
157156
raise ValueError(
158157
"Must initialize class using\n"
@@ -206,7 +205,6 @@ def zoom_animation(self, touch_point: Tuple[int, int, Optional[int]]) -> None:
206205
)
207206

208207
if self._animation_time > 0:
209-
210208
animation_bitmap = self.__class__.bitmap_buffer
211209
animation_palette = self.__class__.palette_buffer
212210

adafruit_displayio_layout/widgets/icon_widget.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,6 @@ def __init__(
111111
def contains(
112112
self, touch_point: Tuple[int, int, Optional[int]]
113113
) -> bool: # overrides, then calls Control.contains(x,y)
114-
115114
"""Checks if the IconWidget was touched. Returns True if the touch_point is
116115
within the IconWidget's touch_boundary.
117116

adafruit_displayio_layout/widgets/switch_round.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -452,7 +452,6 @@ def __init__(
452452
value: bool = False, # initial value
453453
**kwargs: Any,
454454
) -> None:
455-
456455
self._radius = height // 2
457456

458457
# If width is not provided, then use the preferred aspect ratio
@@ -758,7 +757,6 @@ def _animate_switch(self) -> None:
758757
start_time = time.monotonic() # set the starting time for animation
759758

760759
while True:
761-
762760
# Determines the direction of movement, depending upon if the
763761
# switch is going from on->off or off->on
764762

adafruit_displayio_layout/widgets/widget.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,6 @@ def __init__(
180180
anchor_point: Optional[Tuple[float, float]] = None,
181181
anchored_position: Optional[Tuple[int, int]] = None,
182182
) -> None:
183-
184183
super().__init__(x=x, y=y, scale=scale)
185184
# send x,y and scale to Group
186185
#

examples/displayio_layout_flip_input_simpletest.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,6 @@
101101
display.auto_refresh = True
102102

103103
while True:
104-
105104
p = ts.touch_point
106105
# print("touch_point p: {}".format(p)) # print the touch point
107106

examples/displayio_layout_page_layout_simpletest.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,5 @@
5555

5656
main_group.append(test_page_layout)
5757
while True:
58-
5958
time.sleep(1)
6059
test_page_layout.next_page()

examples/displayio_layout_pygame_display_switch_round.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,6 @@
7272

7373
main_group.append(my_switch)
7474
while display.running:
75-
7675
# get mouse up events
7776
ev = pygame.event.get(eventtype=pygame.MOUSEBUTTONUP)
7877
# proceed events

examples/displayio_layout_switch_multiple.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,6 @@
107107

108108
# Start the main loop
109109
while True:
110-
111110
p = ts.touch_point # get any touches on the screen
112111

113112
if p: # Check each switch if the touch point is within the switch touch area

examples/displayio_layout_switch_simpletest.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@
3434

3535
# Start the main loop
3636
while True:
37-
3837
p = ts.touch_point # get any touches on the screen
3938

4039
if p: # Check each switch if the touch point is within the switch touch area

examples/hotplug_sensor_examples/displayio_layout_hotplug_rtc.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@
2727

2828
class gVars:
2929
def __init__(self):
30-
3130
self.gVarsDict = {
3231
0: "my_debug",
3332
1: "rtc",
@@ -524,7 +523,6 @@ def get_temp():
524523

525524

526525
def handle_dt(dt):
527-
528526
RetVal = False
529527
s = "Date/time: "
530528
sYY = str(dt[yy])
@@ -652,5 +650,4 @@ def main():
652650

653651

654652
if __name__ == "__main__":
655-
656653
main()

examples/hotplug_sensor_examples/displayio_layout_hotplug_temp_sensor.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@
3939

4040
class gVars:
4141
def __init__(self):
42-
4342
self.gVarsDict = {
4443
0: "my_debug",
4544
1: "rtc",
@@ -487,6 +486,7 @@ def refresh_from_NTP():
487486
From: https://learn.adafruit.com/making-a-pyportal-user-interface-displayio/the-full-code
488487
"""
489488

489+
490490
# This will handle switching Images and Icons
491491
def set_image(group, filename):
492492
"""Set the image file for a given goup for display.

0 commit comments

Comments
 (0)