Skip to content

Commit c68fa1e

Browse files
authored
Merge pull request #18 from adafruit/linting
Linted
2 parents 6ee0caa + 2ee306f commit c68fa1e

File tree

1 file changed

+12
-13
lines changed

1 file changed

+12
-13
lines changed

examples/gizmo_eink_simpletest.py

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -13,19 +13,18 @@
1313
display_group = displayio.Group()
1414

1515
# Display a ruler graphic from the root directory of the CIRCUITPY drive
16-
file = open("/display-ruler.bmp", "rb")
16+
with open("/display-ruler.bmp", "rb") as file:
17+
picture = displayio.OnDiskBitmap(file)
18+
# Create a Tilegrid with the bitmap and put in the displayio group
19+
sprite = displayio.TileGrid(picture, pixel_shader=displayio.ColorConverter())
20+
display_group.append(sprite)
1721

18-
picture = displayio.OnDiskBitmap(file)
19-
# Create a Tilegrid with the bitmap and put in the displayio group
20-
sprite = displayio.TileGrid(picture, pixel_shader=displayio.ColorConverter())
21-
display_group.append(sprite)
22+
# Place the display group on the screen
23+
display.show(display_group)
2224

23-
# Place the display group on the screen
24-
display.show(display_group)
25+
# Refresh the display to have it actually show the image
26+
# NOTE: Do not refresh eInk displays sooner than 180 seconds
27+
display.refresh()
28+
print("refreshed")
2529

26-
# Refresh the display to have it actually show the image
27-
# NOTE: Do not refresh eInk displays sooner than 180 seconds
28-
display.refresh()
29-
print("refreshed")
30-
31-
time.sleep(180)
30+
time.sleep(180)

0 commit comments

Comments
 (0)