DM: fix pylint stuff
This commit is contained in:
parent
cf15aa7da1
commit
6f0914a46e
2 changed files with 12 additions and 10 deletions
|
|
@ -183,15 +183,15 @@ class Adafruit_IL0373(Adafruit_EPD):
|
|||
for x in iter(range(image.size[0])):
|
||||
if x == 0:
|
||||
x = 1
|
||||
p = pix[x, y]
|
||||
pixel = pix[x, y]
|
||||
|
||||
addr = int(((self.width - x) * self.height + y)/8)
|
||||
|
||||
if p == (0xFF, 0, 0):
|
||||
if pixel == (0xFF, 0, 0):
|
||||
addr = addr + self.bw_bufsize
|
||||
current = self.sram.read8(addr)
|
||||
|
||||
if p in ((0xFF, 0, 0), (0, 0, 0)):
|
||||
if pixel in ((0xFF, 0, 0), (0, 0, 0)):
|
||||
current = current & ~(1 << (7 - y%8))
|
||||
else:
|
||||
current = current | (1 << (7 - y%8))
|
||||
|
|
|
|||
|
|
@ -1,10 +1,10 @@
|
|||
from PIL import Image
|
||||
from PIL import ImageDraw
|
||||
from PIL import ImageFont
|
||||
|
||||
import digitalio
|
||||
import busio
|
||||
import board
|
||||
|
||||
from PIL import Image
|
||||
from PIL import ImageDraw
|
||||
from PIL import ImageFont
|
||||
from adafruit_epd.epd import Adafruit_EPD
|
||||
from adafruit_epd.il0373 import Adafruit_IL0373
|
||||
|
||||
|
|
@ -58,7 +58,8 @@ x += shape_width+padding
|
|||
draw.rectangle((x, top, x+shape_width, bottom), outline=RED, fill=BLACK)
|
||||
x += shape_width+padding
|
||||
# Draw a triangle.
|
||||
draw.polygon([(x, bottom), (x+shape_width/2, top), (x+shape_width, bottom)], outline=BLACK, fill=RED)
|
||||
draw.polygon([(x, bottom), (x+shape_width/2, top), (x+shape_width, bottom)],
|
||||
outline=BLACK, fill=RED)
|
||||
x += shape_width+padding
|
||||
# Draw an X.
|
||||
draw.line((x, bottom, x+shape_width, top), fill=RED)
|
||||
|
|
@ -68,7 +69,8 @@ x += shape_width+padding
|
|||
# Load default font.
|
||||
font = ImageFont.load_default()
|
||||
|
||||
# Alternatively load a TTF font. Make sure the .ttf font file is in the same directory as the python script!
|
||||
# Alternatively load a TTF font. Make sure the .ttf font
|
||||
# file is in the same directory as the python script!
|
||||
# Some other nice fonts to try: http://www.dafont.com/bitmap.php
|
||||
#font = ImageFont.truetype('Minecraftia.ttf', 8)
|
||||
|
||||
|
|
@ -79,4 +81,4 @@ draw.text((x, top+20), 'World!', font=font, fill=RED)
|
|||
# Display image.
|
||||
display.image(image)
|
||||
|
||||
display.display()
|
||||
display.display()
|
||||
|
|
|
|||
Loading…
Reference in a new issue