Skip to content

Commit e13777f

Browse files
authored
pylint fixes
1 parent 7507def commit e13777f

1 file changed

Lines changed: 50 additions & 50 deletions

File tree

EInk_Autostereograms/code.py

Lines changed: 50 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ def display_bitmap(epd, filename):
110110
for b in range(8):
111111
if (rowdata[col] & (0x80 >> b) != 0 and blkpixel == 0) or (
112112
rowdata[col] & (0x80 >> b) == 0 and blkpixel == 1):
113-
epd.pixel(col * 8 + b, row, Adafruit_EPD.BLACK)
113+
epd.pixel(col * 8 + b, row, Adafruit_EPD.BLACK)
114114
except OSError:
115115
display_message("Error: couldn't read file " + filename)
116116
except BMPError:
@@ -249,55 +249,55 @@ def run_job(jobfile):
249249
with open(
250250
config["bkfolder"] + "/background-" + str(whitepct)
251251
+ "-" + str(pixelsize) + ".dat", "rb") as fp:
252-
bkdata = fp.read()
253-
canvas = list(bkdata)
254-
for y in range(0, display.height):
255-
# blink the LED
256-
if y % 2 == 0:
257-
led.value = True
258-
else:
259-
led.value = False
260-
tcanvas = [0 for i in range(display.width + panelwidth)]
261-
tpanel = [0 for i in range(panelwidth)]
262-
for x in range(panelwidth):
263-
bytepos = ((x % panelwidth) // 8) + (
264-
y // pixelsize * (panelwidth + 7) // 8
265-
)
266-
bitpos = x % 8
267-
pixel = canvas[bytepos] & 1 << (bitpos)
268-
if pixel != 0:
269-
tpanel[x] = 1
270-
for x in range(display.width + panelwidth):
271-
pixel = tpanel[x % panelwidth]
272-
if pixel != 0:
273-
tcanvas[x] = 1
274-
for x in range(0, display.width):
275-
if (x % panelwidth) == 0 and x > 0:
276-
for x2 in range(x, x + panelwidth):
277-
tcanvas[x2] = tcanvas[x2 - panelwidth]
278-
for x2 in range(panelwidth):
279-
tpanel[x2] = tcanvas[x + x2 - panelwidth]
280-
offset = 0
281-
if x >= 22 and (
282-
x < (image.width + panelwidth // 2)
283-
and y < image.height
284-
and (
285-
(image[x - panelwidth // 2, y] != 0 and not inv
286-
) or (
287-
image[x - panelwidth // 2, y] == 0 and inv)
288-
)):
289-
# offset = 4
290-
if job["imagegrayscale"] == 0:
291-
offset = job["imageheight"]
292-
else:
293-
offset = (
294-
image[x - panelwidth // 2, y]
295-
* job["grayscalecolors"]
296-
// 255
297-
)
298-
if offset != 0:
299-
for x2 in range(x, display.width, panelwidth):
300-
tcanvas[x2] = tcanvas[x2 + offset]
252+
bkdata = fp.read()
253+
canvas = list(bkdata)
254+
for y in range(0, display.height):
255+
# blink the LED
256+
if y % 2 == 0:
257+
led.value = True
258+
else:
259+
led.value = False
260+
tcanvas = [0 for i in range(display.width + panelwidth)]
261+
tpanel = [0 for i in range(panelwidth)]
262+
for x in range(panelwidth):
263+
bytepos = ((x % panelwidth) // 8) + (
264+
y // pixelsize * (panelwidth + 7) // 8
265+
)
266+
bitpos = x % 8
267+
pixel = canvas[bytepos] & 1 << (bitpos)
268+
if pixel != 0:
269+
tpanel[x] = 1
270+
for x in range(display.width + panelwidth):
271+
pixel = tpanel[x % panelwidth]
272+
if pixel != 0:
273+
tcanvas[x] = 1
274+
for x in range(0, display.width):
275+
if (x % panelwidth) == 0 and x > 0:
276+
for x2 in range(x, x + panelwidth):
277+
tcanvas[x2] = tcanvas[x2 - panelwidth]
278+
for x2 in range(panelwidth):
279+
tpanel[x2] = tcanvas[x + x2 - panelwidth]
280+
offset = 0
281+
if x >= 22 and (
282+
x < (image.width + panelwidth // 2)
283+
and y < image.height
284+
and (
285+
(image[x - panelwidth // 2, y] != 0 and not inv
286+
) or (
287+
image[x - panelwidth // 2, y] == 0 and inv)
288+
)):
289+
# offset = 4
290+
if job["imagegrayscale"] == 0:
291+
offset = job["imageheight"]
292+
else:
293+
offset = (
294+
image[x - panelwidth // 2, y]
295+
* job["grayscalecolors"]
296+
// 255
297+
)
298+
if offset != 0:
299+
for x2 in range(x, display.width, panelwidth):
300+
tcanvas[x2] = tcanvas[x2 + offset]
301301
for x in range(0, display.width):
302302
# write line to eink display
303303
if tcanvas[x] != 0:

0 commit comments

Comments
 (0)