change name general and add create_dir for new topics

This commit is contained in:
Samuel Lazareanu
2023-04-17 15:04:49 +03:00
parent 0d05b09897
commit d50a80ce73

View File

@@ -85,3 +85,12 @@ def cut_images(images_folder, output_folder):
# Save the cropped image
img.save(f"{output_folder}/{filename}")
def create_new_topic_dirs(topic, project_dir):
# /customers/___
if not os.path.exists(f"{project_dir}/customers/{topic}"):
os.makedirs(f"{project_dir}/customers/{topic}")
# /sources/images/___
if not os.path.exists(f"{project_dir}/sources/images/{topic}"):
os.makedirs(f"{project_dir}/sources/images/{topic}")