sharepoint warmfront to get csv but installer will be different

This commit is contained in:
Jun-te Kim 2025-04-14 14:06:31 +00:00
parent aa232621b8
commit eca7779b44
2 changed files with 7 additions and 5 deletions

View file

@ -11,4 +11,6 @@ from etl.surveyPrice.surveyPrice import SurveyPrice
sp = SurveyPrice()
sp.get_cavity_pricing_table("JJC_EMPTIES")
sp.get_cavity_pricing_table("JJC - EMPTIES")
df = sp.get_all_surveys_from_hubspot()
df

View file

@ -8,7 +8,7 @@ class SurveyPrice():
A class to work out all prices and uploads to sharepoint for review
"""
def __init__(self):
self.sharepoint_client = SharePointScraper(SharePointInstaller.WARMFRONT)
self.warmfront_sharepoint_client = SharePointScraper(SharePointInstaller.WARMFRONT)
self.master_rate_card_path = None
self.all_hubspot_submissions = None
self.download_price_card()
@ -27,14 +27,14 @@ class SurveyPrice():
def download_price_card(self):
url = None
for files in self.sharepoint_client.get_folders_in_path("/Commercials/Rate Cards")['value']:
for files in self.warmfront_sharepoint_client.get_folders_in_path("/Commercials/Rate Cards")['value']:
if files['name'] == "MASTER RATE CARD.xlsx":
url = files['@microsoft.graph.downloadUrl']
break
if url:
content = self.sharepoint_client.get_file_content(url)
self.master_rate_card_path = self.sharepoint_client.create_temp_file(content, "rate_card/rate_card_all.xlsx")
content = self.warmfront_sharepoint_client.get_file_content(url)
self.master_rate_card_path = self.warmfront_sharepoint_client.create_temp_file(content, "rate_card/rate_card_all.xlsx")
return self.master_rate_card_path