From b71c295eee3ef24e27b1af73bf1a5b7902d50022 Mon Sep 17 00:00:00 2001 From: edpibu Date: Sun, 20 Sep 2020 21:54:57 +0200 Subject: [PATCH] Added times --- parser.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/parser.py b/parser.py index 0b79251..256bbd7 100755 --- a/parser.py +++ b/parser.py @@ -55,7 +55,7 @@ class GoogleSheetsCalParser(HTMLParser): if not (self.row < 3 or (self.row - 2) % 12 < 2): self.inCell = True if 'rowspan' in dAttrs.keys(): - self.rowspan = dAttrs['rowspan'] + self.rowspan = int(dAttrs['rowspan']) else: self.rowspan = 1 elif (self.row - 2) % 12 == 1: self.inDate = True @@ -72,9 +72,10 @@ class GoogleSheetsCalParser(HTMLParser): def handle_data(self, data): if self.inDate: self.date = dt.strptime(data, '%d-%b-%y') - print(self.date) elif self.inCell and data not in ['', '-']: - print(data, self.row, self.column, self.rowspan) + times = [TIMETABLE[(self.row - 2) % 12 - 2][1], + TIMETABLE[(self.row - 2) % 12 - 2 + self.rowspan][0]] + print(data, self.date, times) # Getting the Google Sheet