Added times

This commit is contained in:
Edgar P. Burkhart 2020-09-20 21:54:57 +02:00
parent 00be0b5ff4
commit b71c295eee
Signed by: edpibu
GPG key ID: 9833D3C5A25BD227

View file

@ -55,7 +55,7 @@ class GoogleSheetsCalParser(HTMLParser):
if not (self.row < 3 or (self.row - 2) % 12 < 2): if not (self.row < 3 or (self.row - 2) % 12 < 2):
self.inCell = True self.inCell = True
if 'rowspan' in dAttrs.keys(): if 'rowspan' in dAttrs.keys():
self.rowspan = dAttrs['rowspan'] self.rowspan = int(dAttrs['rowspan'])
else: self.rowspan = 1 else: self.rowspan = 1
elif (self.row - 2) % 12 == 1: elif (self.row - 2) % 12 == 1:
self.inDate = True self.inDate = True
@ -72,9 +72,10 @@ class GoogleSheetsCalParser(HTMLParser):
def handle_data(self, data): def handle_data(self, data):
if self.inDate: if self.inDate:
self.date = dt.strptime(data, '%d-%b-%y') self.date = dt.strptime(data, '%d-%b-%y')
print(self.date)
elif self.inCell and data not in ['', '-']: 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 # Getting the Google Sheet