From cec78f0d5f2b3477488ac2055a9b086dabe988ca Mon Sep 17 00:00:00 2001 From: Stijn De Clercq Date: Mon, 26 Oct 2020 14:30:38 +0100 Subject: [PATCH] Schedule implementation --- data/les.py | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/data/les.py b/data/les.py index 5c495ae..3b067a2 100644 --- a/data/les.py +++ b/data/les.py @@ -4,8 +4,17 @@ from functions.timeFormatters import timeFromInt # A container class for schedules class Schedule: - pass -# TODO extra's & special classes + def __init__(self, schedule: dict): + self.courses = [Course(course) for course in schedule] + self.customs = [] # Courses that only the person that called the schedule has + self.extra = [] # Courses that need special attention (canceled, online, ...) + + def addCustom(self, course): + """ + Function that adds a course into the list of courses, + useful for adding a user's custom courses + """ + self.customs.append(Course(course)) # A container class for courses