Skip to content

Commit 5d9eeba

Browse files
committed
Linting files for CI
1 parent 70279ed commit 5d9eeba

File tree

4 files changed

+46
-32
lines changed

4 files changed

+46
-32
lines changed

examples/epd_bonnet.py

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -61,29 +61,29 @@
6161
draw.rectangle((1, 1, width - 2, height - 2), outline=BLACK, fill=WHITE)
6262
# Draw some shapes.
6363
# First define some constants to allow easy resizing of shapes.
64-
padding = 5
65-
shape_width = 30
66-
top = padding
67-
bottom = height - padding
64+
PADDING = 5
65+
SHAPE_WIDTH = 30
66+
TOP = PADDING
67+
bottom = height - PADDING
6868
# Move left to right keeping track of the current x position for drawing shapes.
69-
x = padding
69+
x = PADDING
7070
# Draw an ellipse.
71-
draw.ellipse((x, top, x + shape_width, bottom), outline=BLACK, fill=WHITE)
72-
x += shape_width + padding
71+
draw.ellipse((x, TOP, x + SHAPE_WIDTH, bottom), outline=BLACK, fill=WHITE)
72+
x += SHAPE_WIDTH + PADDING
7373
# Draw a rectangle.
74-
draw.rectangle((x, top, x + shape_width, bottom), outline=WHITE, fill=BLACK)
75-
x += shape_width + padding
74+
draw.rectangle((x, TOP, x + SHAPE_WIDTH, bottom), outline=WHITE, fill=BLACK)
75+
x += SHAPE_WIDTH + PADDING
7676
# Draw a triangle.
7777
draw.polygon(
78-
[(x, bottom), (x + shape_width / 2, top), (x + shape_width, bottom)],
78+
[(x, bottom), (x + SHAPE_WIDTH / 2, TOP), (x + SHAPE_WIDTH, bottom)],
7979
outline=BLACK,
8080
fill=WHITE,
8181
)
82-
x += shape_width + padding
82+
x += SHAPE_WIDTH + PADDING
8383
# Draw an X.
84-
draw.line((x, bottom, x + shape_width, top), fill=BLACK)
85-
draw.line((x, top, x + shape_width, bottom), fill=BLACK)
86-
x += shape_width + padding
84+
draw.line((x, bottom, x + SHAPE_WIDTH, TOP), fill=BLACK)
85+
draw.line((x, TOP, x + SHAPE_WIDTH, bottom), fill=BLACK)
86+
x += SHAPE_WIDTH + PADDING
8787

8888
# Load default font.
8989
font = ImageFont.truetype("/usr/share/fonts/truetype/dejavu/DejaVuSans.ttf", 20)
@@ -94,8 +94,8 @@
9494
# font = ImageFont.truetype('Minecraftia.ttf', 8)
9595

9696
# Write two lines of text.
97-
draw.text((x, top), "Hello", font=font, fill=BLACK)
98-
draw.text((x, top + 20), "World!", font=font, fill=BLACK)
97+
draw.text((x, TOP), "Hello", font=font, fill=BLACK)
98+
draw.text((x, TOP + 20), "World!", font=font, fill=BLACK)
9999

100100
while True:
101101
if not switch1.value:
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# SPDX-FileCopyrightText: 2021 ladyada for Adafruit Industries
2+
# SPDX-License-Identifier: MIT

examples/feather_epd_blinka.py

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,31 @@
11
# SPDX-FileCopyrightText: 2021 ladyada for Adafruit Industries
22
# SPDX-License-Identifier: MIT
33

4+
import time
45
import digitalio
56
import busio
67
import board
78
from adafruit_epd.epd import Adafruit_EPD
8-
import time
9+
from adafruit_epd.ssd1680 import Adafruit_SSD1680
910

1011
# create the spi device and pins we will need
1112
spi = busio.SPI(board.EPD_SCK, MOSI=board.EPD_MOSI, MISO=None)
1213
epd_cs = digitalio.DigitalInOut(board.EPD_CS)
1314
epd_dc = digitalio.DigitalInOut(board.EPD_DC)
1415
epd_reset = digitalio.DigitalInOut(board.EPD_RESET)
15-
epd_busy = digitalio.DigitalInOut(board.EPD_BUSY)
16+
epd_busy = digitalio.DigitalInOut(board.EPD_BUSY)
1617
srcs = None
1718

18-
from adafruit_epd.ssd1680 import Adafruit_SSD1680
19-
display = Adafruit_SSD1680(122, 250, spi, cs_pin=epd_cs, dc_pin=epd_dc,
20-
sramcs_pin=srcs, rst_pin=epd_reset,
21-
busy_pin=epd_busy)
19+
display = Adafruit_SSD1680(
20+
122,
21+
250,
22+
spi,
23+
cs_pin=epd_cs,
24+
dc_pin=epd_dc,
25+
sramcs_pin=srcs,
26+
rst_pin=epd_reset,
27+
busy_pin=epd_busy,
28+
)
2229

2330
display.rotation = 3
2431
display.fill(Adafruit_EPD.WHITE)

examples/feather_epd_blinka_pillow.py

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,34 @@
11
# SPDX-FileCopyrightText: 2021 ladyada for Adafruit Industries
22
# SPDX-License-Identifier: MIT
33

4+
import time
45
import digitalio
56
import busio
67
import board
7-
from adafruit_epd.epd import Adafruit_EPD
8-
import time
9-
108
from PIL import Image
119
from PIL import ImageDraw
1210
from PIL import ImageFont
11+
from adafruit_epd.epd import Adafruit_EPD
12+
from adafruit_epd.ssd1680 import Adafruit_SSD1680
1313

1414
# create the spi device and pins we will need
1515
spi = busio.SPI(board.EPD_SCK, MOSI=board.EPD_MOSI, MISO=None)
1616
epd_cs = digitalio.DigitalInOut(board.EPD_CS)
1717
epd_dc = digitalio.DigitalInOut(board.EPD_DC)
1818
epd_reset = digitalio.DigitalInOut(board.EPD_RESET)
19-
epd_busy = digitalio.DigitalInOut(board.EPD_BUSY)
19+
epd_busy = digitalio.DigitalInOut(board.EPD_BUSY)
2020
srcs = None
2121

22-
from adafruit_epd.ssd1680 import Adafruit_SSD1680
23-
display = Adafruit_SSD1680(122, 250, spi, cs_pin=epd_cs, dc_pin=epd_dc,
24-
sramcs_pin=srcs, rst_pin=epd_reset,
25-
busy_pin=epd_busy)
22+
display = Adafruit_SSD1680(
23+
122,
24+
250,
25+
spi,
26+
cs_pin=epd_cs,
27+
dc_pin=epd_dc,
28+
sramcs_pin=srcs,
29+
rst_pin=epd_reset,
30+
busy_pin=epd_busy,
31+
)
2632

2733
display.rotation = 3
2834
# Create blank image for drawing.
@@ -87,7 +93,6 @@
8793

8894
time.sleep(10)
8995

90-
blinkaimage = Image.open('examples/epd_bonnet_blinka_250x122.bmp')
96+
blinkaimage = Image.open("examples/epd_bonnet_blinka_250x122.bmp")
9197
display.image(blinkaimage)
9298
display.display()
93-

0 commit comments

Comments
 (0)