mirror of
https://github.com/Hestia-Homes/survey-extraction.git
synced 2026-06-30 13:10:56 +00:00
make output nicer
This commit is contained in:
parent
7c887d8531
commit
371d6cd3ed
3 changed files with 7 additions and 3 deletions
|
|
@ -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()
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue