PEP 8 compliance.

This commit is contained in:
yrriban 2025-06-15 13:31:32 -04:00
parent 84b8c1b626
commit 2076e7341d

View file

@ -3,19 +3,20 @@ import sys
import wand.drawing import wand.drawing
import wand.image import wand.image
def draw_text(img, text, font_size=64): def draw_text(img, text, font_size=64):
with wand.drawing.Drawing() as draw: with wand.drawing.Drawing() as draw:
draw.font = dcc.config.FONT draw.font = dcc.config.FONT
draw.font_size=font_size draw.font_size = font_size
draw.fill_color=wand.color.Color(dcc.config.TEXT_FILL_COLOR) draw.fill_color = wand.color.Color(dcc.config.TEXT_FILL_COLOR)
draw.stroke_color=wand.color.Color(dcc.config.TEXT_STROKE_COLOR) draw.stroke_color = wand.color.Color(dcc.config.TEXT_STROKE_COLOR)
draw.stroke_width=font_size*5/32 draw.stroke_width = font_size * 5 / 32
draw.text_interline_spacing=-font_size/4 draw.text_interline_spacing = -font_size / 4
draw.text(5,int(draw.font_size)+5,text) draw.text(5, int(draw.font_size) + 5, text)
draw(img) draw(img)
draw.stroke_color=wand.color.Color("none") draw.stroke_color = wand.color.Color("none")
draw.stroke_width=0 draw.stroke_width = 0
draw.text(5,int(draw.font_size)+5,text) draw.text(5, int(draw.font_size)+5, text)
draw(img) draw(img)
@ -31,7 +32,10 @@ class Text(dcc.doom_base.WadMap):
if not parsed_args.nomap: if not parsed_args.nomap:
text = "MAP{}: {}".format(parsed_args.map, text) text = "MAP{}: {}".format(parsed_args.map, text)
text = "{}\n{}".format(text, parsed_args.demotype) text = "{}\n{}".format(text, parsed_args.demotype)
with wand.image.Image(height=dcc.config.THUMB_HEIGHT,width=dcc.config.THUMB_WIDTH) as img: with wand.image.Image(
height=dcc.config.THUMB_HEIGHT,
width=dcc.config.THUMB_WIDTH
) as img:
draw_text(img, text) draw_text(img, text)
img.trim() img.trim()
img.reset_coords() img.reset_coords()