From 2e426346ad523ec9af6dbf75a1d74be30d3908ca Mon Sep 17 00:00:00 2001 From: Hemanth Date: Tue, 22 Oct 2024 13:39:51 -0400 Subject: [PATCH] #272 creates Processed folder (#287) --- run_first.py | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/run_first.py b/run_first.py index 776dca5..9a198cb 100644 --- a/run_first.py +++ b/run_first.py @@ -37,8 +37,12 @@ def remove_old_files(files_path): logging.info("Started to read from Data/Resumes") try: # Check if there are resumes present or not. - # If present then parse it. - remove_old_files(PROCESSED_RESUMES_PATH) + if not os.path.exists(PROCESSED_RESUMES_PATH): + # If not present then create one. + os.makedirs(PROCESSED_RESUMES_PATH) + else: + # If present then parse it. + remove_old_files(PROCESSED_RESUMES_PATH) file_names = get_filenames_from_dir("Data/Resumes") logging.info("Reading from Data/Resumes is now complete.") @@ -59,8 +63,12 @@ def remove_old_files(files_path): logging.info("Started to read from Data/JobDescription") try: # Check if there are resumes present or not. + if not os.path.exists(PROCESSED_JOB_DESCRIPTIONS_PATH): + # If not present then create one. + os.makedirs(PROCESSED_JOB_DESCRIPTIONS_PATH) + else: # If present then parse it. - remove_old_files(PROCESSED_JOB_DESCRIPTIONS_PATH) + remove_old_files(PROCESSED_JOB_DESCRIPTIONS_PATH) file_names = get_filenames_from_dir("Data/JobDescription") logging.info("Reading from Data/JobDescription is now complete.")