make output nicer

This commit is contained in:
Jun-te Kim 2025-03-17 21:25:17 +00:00
parent 7c887d8531
commit 371d6cd3ed
3 changed files with 7 additions and 3 deletions

View file

@ -201,7 +201,6 @@ class QuidosSiteNotesExtractor(SiteNotesExtractor):
door = self.get_door()
windows = self.get_windows()
print(windows["main_property"])
# Section 12
ventilationAndCooling = self.get_ventilation_and_cooling()

View file

@ -216,6 +216,7 @@ class SharePointScraper():
if any(file["name"].endswith(ext) for ext in only_pdf):
file_names_to_download.update({file["name"]: file['@microsoft.graph.downloadUrl']})
for file_name, url in file_names_to_download.items():
print(pformat(file_names_to_download))
content = self.get_file_content(url)
path = self.create_temp_file(content, f"{name}/{WEEK_COMMENCING}/{house_ass}/{address}/{file_name}")
if DomnaSharePointValidator.is_quidos_presite(path):
@ -224,6 +225,7 @@ class SharePointScraper():
else:
self.surveyor_work_completed.update({name: 1})
break
print("trololol")
return self.surveyor_work_completed

View file

@ -13,6 +13,8 @@ class DomnaSharePointValidator():
def __init__(self):
self.logger = Logger(name='DomnaSharePointValidator', level=logging.DEBUG).get_logger()
@staticmethod
def valid_dates(list_of_dates_to_check):
# Patten Nic wants: W.C. DD.MM.YYYY
# TODO: Ideally split the date and W.C. and use a datatime library so its more standardised
@ -23,14 +25,15 @@ class DomnaSharePointValidator():
if not re.match(pattern, date):
return False
return True
@staticmethod
def is_quidos_presite(file_path):
file = pdfReaderToText(file_path)
type = file.get_file_type()
print(type)
return type == ReportType.QUIDOS_PRESITE_NOTE
@staticmethod
def valid_social_housing_associations(list_):
"""
Nic gave me a list of housing association names, will most likely use in future so leaving it here