removing raising of exception at end of function

This commit is contained in:
Khalim Conn-Kowlessar 2024-10-28 14:28:27 +00:00
parent 4e9acdeb8e
commit 1db4c4319e

View file

@ -128,8 +128,8 @@ def extract_retrofit_pdfs(data_folder_path):
pdf_path = os.path.join(data_folder_path, pdf_file)
return detect_and_parse_report(pdf_path, pdf_file)
# If no relevant PDF is found, raise an exception
raise FileNotFoundError("No valid report (EPR or Summary) found in the retrofit assessment folder.")
# If no relevant PDF is found, exit
return None
def is_energy_report(text):
@ -199,6 +199,10 @@ def main():
}
extracted_data.append(summary_data)
continue
else:
# Then we have an empty Retrofit Assessment folder
continue
# If no retrofit folder or it was empty, check files in survey_folder
summary_data = extract_retrofit_pdfs(survey_folder_path)
if summary_data: