aboutsummaryrefslogtreecommitdiff
path: root/sjdbmk/twa.py
diff options
context:
space:
mode:
Diffstat (limited to 'sjdbmk/twa.py')
-rw-r--r--sjdbmk/twa.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/sjdbmk/twa.py b/sjdbmk/twa.py
index 34f00a5..371a01b 100644
--- a/sjdbmk/twa.py
+++ b/sjdbmk/twa.py
@@ -23,10 +23,11 @@ import os
import pptx
-import common
+from . import common
logger = logging.getLogger(__name__)
+
def download_or_report_the_week_ahead(token: str, datetime_target: datetime.datetime, the_week_ahead_url: str) -> None:
the_week_ahead_filename = "the_week_ahead-%s.pptx" % datetime_target.strftime("%Y%m%d")
if not os.path.isfile(the_week_ahead_filename):
@@ -36,6 +37,7 @@ def download_or_report_the_week_ahead(token: str, datetime_target: datetime.date
else:
logger.info("The Week Ahead already exists at %s" % the_week_ahead_filename)
+
def parse_the_week_ahead(datetime_target: datetime.datetime, the_week_ahead_community_time_page_number: int, the_week_ahead_aod_page_number: int) -> tuple[list[list[str]], list[str]]:
logger.info("Parsing The Week Ahead")
the_week_ahead_filename = "the_week_ahead-%s.pptx" % datetime_target.strftime("%Y%m%d")
@@ -47,6 +49,7 @@ def parse_the_week_ahead(datetime_target: datetime.datetime, the_week_ahead_comm
aods = extract_aods(the_week_ahead_presentation, the_week_ahead_aod_page_number)
return community_time, aods
+
def extract_community_time(prs: pptx.presentation.Presentation, community_time_page_number: int) -> list[list[str]]:
slide = prs.slides[community_time_page_number]
for shape in slide.shapes:
@@ -86,6 +89,7 @@ def extract_community_time(prs: pptx.presentation.Presentation, community_time_p
return [x[1:] for x in res[1:]]
+
def extract_aods(prs: pptx.presentation.Presentation, aod_page_number: int) -> list[str]:
slide = prs.slides[aod_page_number]
aods = ["", "", "", ""]