Skip to content

Commit 9df71b9

Browse files
authored
where did all the errors come from?
1 parent 008dc9e commit 9df71b9

1 file changed

Lines changed: 9 additions & 9 deletions

File tree

EInk_Autostereograms/code.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1+
import os
2+
import time
3+
import json
14
import digitalio
25
import busio
36
import board
47
import displayio
58
import adafruit_imageload
6-
import time
7-
import json
8-
import os
99

1010
from analogio import AnalogIn
1111
from adafruit_epd.epd import Adafruit_EPD
@@ -114,7 +114,7 @@ def display_bitmap(epd, filename):
114114
# epd.pixel(col*8 + b, row, Adafruit_EPD.WHITE)
115115
except OSError:
116116
display_message("Error: couldn't read file " + filename)
117-
except BMPError as e:
117+
except BMPError:
118118
display_message("Error: unsupported BMP file " + filename)
119119
finally:
120120
f.close()
@@ -133,7 +133,7 @@ class BMPError(Exception):
133133

134134
# alternate bitmap display method using imageload library
135135
def display_bitmap_alternate(epd, filename):
136-
image, palette = adafruit_imageload.load(filename,
136+
image, _ = adafruit_imageload.load(filename,
137137
bitmap=displayio.Bitmap,
138138
palette=displayio.Palette)
139139
for y in range(display.height):
@@ -185,9 +185,9 @@ def show_files():
185185
def run_job(jobfile):
186186
try:
187187
print("running job " + jobfile)
188-
fp = open(config["jobfolder"] + "/" + jobfile, mode='r')
189-
job = json.load(fp)
190-
fp.close()
188+
fpr = open(config["jobfolder"] + "/" + jobfile, mode='r')
189+
job = json.load(fpr)
190+
fpr.close()
191191
print("image: ", job["image"])
192192

193193
starttime = time.monotonic()
@@ -219,7 +219,7 @@ def run_job(jobfile):
219219
except (OSError, Exception) as e:
220220
# readonly filesystem, do not create file
221221
createfile = False
222-
if createfile == True:
222+
if createfile: # == True
223223
# BMP files are all the same dimensions, just different bitmaps, writing hardcoded headers here
224224
# write file header (14 bytes)
225225
out.write(bytearray([0x42,0x4d,0xfe,0x18,0,0,0,0,0,0,0x3e,0,0,0]))

0 commit comments

Comments
 (0)