style: reformatted
This commit is contained in:
1 parent
0d63fb60c0
commit
fc414b57b7
13 files changed
+42
-91
No files matched your search
+1
-3
@@ -10,9 +10,7 @@ def cleanup() -> int:
|
||||
"""
|
||||
if exists("./assets/temp"):
|
||||
count = 0
|
||||
files = [
|
||||
f for f in os.listdir(".") if f.endswith(".mp4") and "temp" in f.lower()
|
||||
]
|
||||
files = [f for f in os.listdir(".") if f.endswith(".mp4") and "temp" in f.lower()]
|
||||
count += len(files)
|
||||
for f in files:
|
||||
os.remove(f)
|
||||
|
||||
+3
-14
@@ -49,10 +49,7 @@ def handle_input(
|
||||
optional=False,
|
||||
):
|
||||
if optional:
|
||||
console.print(
|
||||
message
|
||||
+ "\n[green]This is an optional value. Do you want to skip it? (y/n)"
|
||||
)
|
||||
console.print(message + "\n[green]This is an optional value. Do you want to skip it? (y/n)")
|
||||
if input().casefold().startswith("y"):
|
||||
return default if default is not NotImplemented else ""
|
||||
if default is not NotImplemented:
|
||||
@@ -86,11 +83,7 @@ def handle_input(
|
||||
console.print("[red]" + err_message)
|
||||
continue
|
||||
elif match != "" and re.match(match, user_input) is None:
|
||||
console.print(
|
||||
"[red]"
|
||||
+ err_message
|
||||
+ "\nAre you absolutely sure it's correct?(y/n)"
|
||||
)
|
||||
console.print("[red]" + err_message + "\nAre you absolutely sure it's correct?(y/n)")
|
||||
if input().casefold().startswith("y"):
|
||||
break
|
||||
continue
|
||||
@@ -123,9 +116,5 @@ def handle_input(
|
||||
if user_input in options:
|
||||
return user_input
|
||||
console.print(
|
||||
"[red bold]"
|
||||
+ err_message
|
||||
+ "\nValid options are: "
|
||||
+ ", ".join(map(str, options))
|
||||
+ "."
|
||||
"[red bold]" + err_message + "\nValid options are: " + ", ".join(map(str, options)) + "."
|
||||
)
|
||||
+1
-3
@@ -15,9 +15,7 @@ def get_subreddit_undone(submissions: list, subreddit):
|
||||
"""
|
||||
# recursively checks if the top submission in the list was already done.
|
||||
|
||||
with open(
|
||||
"./video_creation/data/videos.json", "r", encoding="utf-8"
|
||||
) as done_vids_raw:
|
||||
with open("./video_creation/data/videos.json", "r", encoding="utf-8") as done_vids_raw:
|
||||
done_videos = json.load(done_vids_raw)
|
||||
for submission in submissions:
|
||||
if already_done(done_videos, submission):
|
||||
|
||||
+1
-3
@@ -20,9 +20,7 @@ def check_done(
|
||||
Returns:
|
||||
Submission|None: Reddit object in args
|
||||
"""
|
||||
with open(
|
||||
"./video_creation/data/videos.json", "r", encoding="utf-8"
|
||||
) as done_vids_raw:
|
||||
with open("./video_creation/data/videos.json", "r", encoding="utf-8") as done_vids_raw:
|
||||
done_videos = json.load(done_vids_raw)
|
||||
for video in done_videos:
|
||||
if video["id"] == str(redditobj):
|
||||
|
||||
Reference in new issue
Block a user