fixup: Format Python code with Black

pull/2080/head
github-actions 1 year ago
parent fc9a166d39
commit 9ed8c87b88

@ -4,7 +4,7 @@ import sys
from os import name from os import name
from pathlib import Path from pathlib import Path
from subprocess import Popen from subprocess import Popen
from typing import NoReturn, Dict from typing import Dict, NoReturn
from prawcore import ResponseException from prawcore import ResponseException
@ -45,6 +45,7 @@ checkversion(__VERSION__)
reddit_id: str reddit_id: str
reddit_object: Dict[str, str | list] reddit_object: Dict[str, str | list]
def main(POST_ID=None) -> None: def main(POST_ID=None) -> None:
global reddit_id, reddit_object global reddit_id, reddit_object
reddit_object = get_subreddit_threads(POST_ID) reddit_object = get_subreddit_threads(POST_ID)

@ -102,7 +102,7 @@ def handle_input(
user_input = input("").strip() user_input = input("").strip()
if check_type is not False: if check_type is not False:
try: try:
isinstance(eval(user_input), check_type) # fixme: remove eval isinstance(eval(user_input), check_type) # fixme: remove eval
return check_type(user_input) return check_type(user_input)
except: except:
console.print( console.print(

@ -64,9 +64,9 @@ def imagemaker(theme, reddit_obj: dict, txtclr, padding=5, transparent=False) ->
font = ImageFont.truetype(os.path.join("fonts", "Roboto-Bold.ttf"), 100) font = ImageFont.truetype(os.path.join("fonts", "Roboto-Bold.ttf"), 100)
else: else:
font = ImageFont.truetype(os.path.join("fonts", "Roboto-Regular.ttf"), 100) font = ImageFont.truetype(os.path.join("fonts", "Roboto-Regular.ttf"), 100)
size = (1920, 1080) size = (1920, 1080)
for idx, text in track(enumerate(texts), "Rendering Image"): for idx, text in track(enumerate(texts), "Rendering Image"):
image = Image.new("RGBA", size, theme) image = Image.new("RGBA", size, theme)
text = process_text(text, False) text = process_text(text, False)

@ -78,7 +78,7 @@ def check(value, checks, name):
+ str(name) + str(name)
+ "[#F7768E bold]=", + "[#F7768E bold]=",
extra_info=get_check_value("explanation", ""), extra_info=get_check_value("explanation", ""),
check_type=eval(get_check_value("type", "False")), # fixme remove eval check_type=eval(get_check_value("type", "False")), # fixme remove eval
default=get_check_value("default", NotImplemented), default=get_check_value("default", NotImplemented),
match=get_check_value("regex", ""), match=get_check_value("regex", ""),
err_message=get_check_value("input_error", "Incorrect input"), err_message=get_check_value("input_error", "Incorrect input"),

Loading…
Cancel
Save