Skip to content

Commit 829427f

Browse files
committed
feat: fix missing theory timeslot
1 parent e7bdebf commit 829427f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/parsers/timetable_parser.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
'Sunday': [],
1010
'Monday': [],
1111
}
12-
theory_timings=['DAY','TYPE','08:00 - 08:50', '09:00 - 09:50', '10:00 - 10:50', '10:00 - 10:50', '11:00 - 11:50', '11:00 - 11:50', '12:00 - 12:50','12:00 - 12:50', '13:00 - 13:50', 'Lunch', '14:00 - 14:50', '14:00 - 14:50', '15:00 - 15:50', '15:00 - 15:50', '16:00 - 16:50', '16:00 - 16:50', '17:00 - 17:50', '17:00 - 17:50', '18:00 - 18:50', '19:00 - 19:50']
12+
theory_timings=['DAY','TYPE','08:00 - 08:50', '09:00 - 09:50','09:00 - 09:50', '10:00 - 10:50', '10:00 - 10:50', '11:00 - 11:50', '11:00 - 11:50', '12:00 - 12:50','12:00 - 12:50', '13:00 - 13:50', 'Lunch', '14:00 - 14:50', '14:00 - 14:50', '15:00 - 15:50', '15:00 - 15:50', '16:00 - 16:50', '16:00 - 16:50', '17:00 - 17:50', '17:00 - 17:50', '18:00 - 18:50','18:00 - 18:50', '19:00 - 19:50']
1313
lab_timings=['TYPE','08:00 - 08:50','09:00 - 09:50','09:00 - 09:50', '09:50 - 10:40','09:50 - 10:40', '11:00 - 11:50', '11:00 - 11:50', '11:50 - 12:40', '11:50 - 12:40', '12:50 - 13:30', 'Lunch', '14:00 - 14:50', '14:00 - 14:50', '14:50 - 15:40','14:50 - 15:40', '16:00 - 16:50','16:00 - 16:50', '16:50 - 17:40', '16:50 - 17:40', '18:00 - 18:50','18:00 - 18:50', '18:50 - 19:30']
1414
lst_table=[]
1515

@@ -100,7 +100,7 @@ def parse_time_table(html : str) -> dict[str, list]:
100100
#To access theory classes
101101
for day,line in zip(['Tuesday','Wednesday','Thursday','Friday','Saturday'],lst_table[::2]):
102102
for j in range(min(len(line), len(theory_timings))):
103-
if len(line[j])>8 and line[j] != 'CLUBS/ECS':
103+
if len(line[j])>8 and line[j] not in {'CLUBS/ECS', 'ECS/CLUBS'}:
104104
time_table_data[day].append({theory_timings[j] : line[j]})
105105
#Labs
106106
for day, line in zip(['Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'], lst_table[1::2]):

0 commit comments

Comments
 (0)