Blacken the code base.

This commit is contained in:
yrriban 2025-12-24 18:35:43 -05:00
parent d585c1529d
commit 07d079f204
19 changed files with 138 additions and 168 deletions

View file

@ -30,9 +30,7 @@ def draw_text(self, img, text, font_size=64, wrap_dist=0.75):
columns = len(wrapped_text)
while columns > 0:
columns -= 1
wrapped_text = '\n'.join(
textwrap.wrap(wrapped_text, columns)
)
wrapped_text = "\n".join(textwrap.wrap(wrapped_text, columns))
wrapped_width, _ = eval_metrics(wrapped_text)
if wrapped_width <= target_width:
break
@ -43,13 +41,13 @@ def draw_text(self, img, text, font_size=64, wrap_dist=0.75):
)
textlines[idx] = wrapped_text
wrapped_text = '\n'.join(textlines)
wrapped_text = "\n".join(textlines)
draw.text(5, int(draw.font_size) + 5, wrapped_text)
draw(img)
draw.stroke_color = wand.color.Color("none")
draw.stroke_width = 0
draw.text(5, int(draw.font_size)+5, wrapped_text)
draw.text(5, int(draw.font_size) + 5, wrapped_text)
draw(img)
@ -74,12 +72,9 @@ class Text(dcc.doom_base.WadMap):
text += "\n"
text = "{}{}".format(text, parsed_args.demotype)
with wand.image.Image(
height=self.thumbnail_height,
width=self.thumbnail_width
height=self.thumbnail_height, width=self.thumbnail_width
) as img:
self.draw_text(
img, text, wrap_dist=0.95
)
self.draw_text(img, text, wrap_dist=0.95)
img.trim()
img.reset_coords()
img.save(filename=self.text_thumb_path())