mirror of
https://github.com/freedoom/freedoom.git
synced 2025-09-01 22:25:46 -04:00
Blacken all Python files
Using the black code reformatter, pass it over all our Python files. This allows for a consistent style across the code base. Exception: lumps/dmxgus/stats.py, for readability.
This commit is contained in:
parent
6b486b6332
commit
4701d8f351
30 changed files with 2528 additions and 2102 deletions
|
@ -7,13 +7,13 @@ from PIL import Image, ImageFont, ImageDraw
|
|||
import sys
|
||||
import os
|
||||
|
||||
#create_caption.py <background_image> <title?> <phase?> <outfile>
|
||||
# create_caption.py <background_image> <title?> <phase?> <outfile>
|
||||
|
||||
font = ImageFont.load_default()
|
||||
|
||||
|
||||
txt1= "© 2001-2019"
|
||||
txt2= os.environ['VERSION']
|
||||
txt1 = "© 2001-2019"
|
||||
txt2 = os.environ["VERSION"]
|
||||
background_image = Image.open(sys.argv[1])
|
||||
background_image.load()
|
||||
background_image = background_image.convert("RGBA")
|
||||
|
@ -21,17 +21,37 @@ image = Image.new("RGBA", background_image.size, (0, 0, 0, 0))
|
|||
draw = ImageDraw.Draw(image)
|
||||
txt1_size = draw.textsize(txt1, font=font)
|
||||
txt2_size = draw.textsize(txt2, font=font)
|
||||
draw.text((5, int(image.height - txt1_size[1] - 5)), txt1, font=font, fill=(255,165,0,255))
|
||||
draw.text((int(image.width - txt2_size[0] - 10), int(image.height - txt2_size[1] - 5)), txt2, font=font, fill=(255,165,0,255))
|
||||
|
||||
draw.text(
|
||||
(5, int(image.height - txt1_size[1] - 5)),
|
||||
txt1,
|
||||
font=font,
|
||||
fill=(255, 165, 0, 255),
|
||||
)
|
||||
draw.text(
|
||||
(
|
||||
int(image.width - txt2_size[0] - 10),
|
||||
int(image.height - txt2_size[1] - 5),
|
||||
),
|
||||
txt2,
|
||||
font=font,
|
||||
fill=(255, 165, 0, 255),
|
||||
)
|
||||
|
||||
if len(sys.argv) > 3:
|
||||
#paste the other stuff onto the thing.
|
||||
# paste the other stuff onto the thing.
|
||||
logo = Image.open(sys.argv[2])
|
||||
logo.load()
|
||||
phase = Image.open(sys.argv[3])
|
||||
phase.load
|
||||
image.paste(logo, ((int(image.width/2) - int(logo.width/2), 18)))
|
||||
image.paste(phase, ((int(image.width/2) - int(phase.width/2)), int(image.height - phase.height - 30)))
|
||||
image.paste(logo, ((int(image.width / 2) - int(logo.width / 2), 18)))
|
||||
image.paste(
|
||||
phase,
|
||||
(
|
||||
(int(image.width / 2) - int(phase.width / 2)),
|
||||
int(image.height - phase.height - 30),
|
||||
),
|
||||
)
|
||||
outfile_name = sys.argv[4]
|
||||
else:
|
||||
outfile_name = sys.argv[2]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue