From 18b2c1784cb78b6e768b735ac29466fb2e190d91 Mon Sep 17 00:00:00 2001 From: Samuel Lazareanu <52662032+SamuraiPolix@users.noreply.github.com> Date: Wed, 19 Apr 2023 18:17:32 +0300 Subject: [PATCH] add an option to do all the quotes in the file --- main.py | 1 + post_handler.py | 3 +++ 2 files changed, 4 insertions(+) diff --git a/main.py b/main.py index 32a3496..b6876cf 100644 --- a/main.py +++ b/main.py @@ -8,6 +8,7 @@ project_dir = os.getcwd().replace("\\", "/") TOPIC = "christian" # Define the paths and values to everything +# If number of posts if set to -1, it will so as many posts as in the data file number_of_posts = 81 images_folder = f"{project_dir}/sources/images/{TOPIC}" images_folder_cropped = f"{images_folder}/cropped" diff --git a/post_handler.py b/post_handler.py index c795bbd..45babb1 100644 --- a/post_handler.py +++ b/post_handler.py @@ -47,6 +47,9 @@ def create_posts(images_folder, text_file, font_dir, output_folder, customer_nam # Creating folder for customer output_path = create_dirs(output_folder, customer_name) + # If number_of_posts is set to -1, it will do it for the amount of quotes there is in the data file + if number_of_posts == -1: + number_of_posts = len(quotes)-1 for i in range(number_of_posts): start_time = time.time() print(f"Creating Post #{i}")