handle invalid lecture file format with invalid title
This commit is contained in:
parent
12b1632f8e
commit
4e71f12254
1 changed files with 9 additions and 4 deletions
|
@ -30,12 +30,17 @@ class Lecture:
|
||||||
break
|
break
|
||||||
|
|
||||||
# number = int(lecture_match.group(1))
|
# number = int(lecture_match.group(1))
|
||||||
|
if lecture_match:
|
||||||
|
date_str = lecture_match.group(2)
|
||||||
|
date = datetime.strptime(date_str, DATE_FORMAT)
|
||||||
|
week = get_week(date)
|
||||||
|
|
||||||
date_str = lecture_match.group(2)
|
title = lecture_match.group(3)
|
||||||
date = datetime.strptime(date_str, DATE_FORMAT)
|
else:
|
||||||
week = get_week(date)
|
date = datetime.min
|
||||||
|
week = get_week(date)
|
||||||
|
|
||||||
title = lecture_match.group(3)
|
title = 'Error while parsing lecture file'
|
||||||
|
|
||||||
self.file_path = file_path
|
self.file_path = file_path
|
||||||
self.date = date
|
self.date = date
|
||||||
|
|
Loading…
Reference in a new issue