fix ba3 schedule

pull/91/head
Stijn De Clercq 2021-09-20 01:42:13 +02:00
parent ad1175f6cd
commit 51811dd9f9
3 changed files with 185 additions and 88 deletions

View File

@ -42,9 +42,9 @@ class School(commands.Cog):
embed.set_footer(text="Omwille van de coronamaatregelen is er een beperkter aanbod, en kan je enkel nog eten afhalen. Ter plaatse eten is niet meer mogelijk.") embed.set_footer(text="Omwille van de coronamaatregelen is er een beperkter aanbod, en kan je enkel nog eten afhalen. Ter plaatse eten is niet meer mogelijk.")
await ctx.send(embed=embed) await ctx.send(embed=embed)
# @commands.command(name="Les", aliases=["Class", "Classes", "Sched", "Schedule"], usage="[Dag]*") @commands.command(name="Les", aliases=["Class", "Classes", "Sched", "Schedule"], usage="[Dag]*")
# @commands.check(checks.allowedChannels) # @commands.check(checks.allowedChannels)
# @help.Category(category=Category.School) @help.Category(category=Category.School)
async def les(self, ctx, day=None): async def les(self, ctx, day=None):
date = les.find_target_date(day) date = les.find_target_date(day)

View File

@ -143,6 +143,7 @@ class Schedule:
self.schedule_dict: Dict = self.load_schedule_file() self.schedule_dict: Dict = self.load_schedule_file()
self.start_date = fromArray(self.schedule_dict["semester_start"]) self.start_date = fromArray(self.schedule_dict["semester_start"])
self.end_date = fromArray(self.schedule_dict["semester_end"]) self.end_date = fromArray(self.schedule_dict["semester_end"])
self._forward_to_semester()
# Semester is over # Semester is over
if self.end_date < self.day: if self.end_date < self.day:
@ -167,6 +168,14 @@ class Schedule:
self.weekday_str = intToWeekday(self.day.weekday()) self.weekday_str = intToWeekday(self.day.weekday())
def _forward_to_semester(self):
"""
In case the semester hasn't started yet, fast forward the current date
by a week until it's no longer necessary
"""
while self.day < self.start_date:
self.day += timedelta(weeks=1)
def check_holidays(self): def check_holidays(self):
""" """
Do all holiday-related stuff here to avoid multiple loops Do all holiday-related stuff here to avoid multiple loops

View File

@ -1,58 +1,44 @@
{ {
"semester_start": [1, 7, 2021], "semester_start": [27, 9, 2021],
"semester_end": [1, 8, 2021], "semester_end": [23, 12, 2021],
"holidays": [ "holidays": [
{ {
"start_date": [2, 7, 2021, 23, 59, 59], "start_date": [1, 11, 2021, 0, 0, 0],
"end_date": [10, 8, 2021, 23, 59, 59] "end_date": [2, 11, 2021, 23, 59, 59]
},
{
"start_date": [11, 11, 2021, 0, 0, 0],
"end_date": [11, 11, 2021, 23, 59, 59]
} }
], ],
"minors": [
{
"name": "Beveiliging en parallelle systemen",
"online_links": {
"zoom": "https://ufora.ugent.be/d2l/ext/rp/439235/lti/framedlaunch/556e197e-e87b-4c27-be5d-53adc7a41826"
},
"schedule": [ "schedule": [
{ {
"course": "Computerarchitectuur", "course": "Modelleren en Simuleren",
"online_links": {
"zoom": "https://ufora.ugent.be/d2l/ext/rp/228912/lti/framedlaunch/556e197e-e87b-4c27-be5d-53adc7a41826",
"msteams": "https://teams.microsoft.com/l/team/19%3ad7295f0bc4634a61b461504d4a7134b3%40thread.tacv2/conversations?groupId=8755cb96-1ef5-4ea3-b806-eeebf8a85ae8&tenantId=d7811cde-ecef-496c-8f91-a1786241b99c"
},
"slots": [
]
},
{
"course": "Multimedia",
"online_links": {
"zoom": "https://ugent-be.zoom.us/j/94248831947?pwd=ZCt4UnBLSzViZnFEQmkzWE5SYnF2QT09"
},
"slots": [ "slots": [
{
"location": {
"campus": "Sterre",
"building": "S12",
"room": "0.1"
},
"time": {
"day": "maandag",
"start": 1000,
"end": 1300
}
},
{ {
"location": { "location": {
"campus": "Sterre", "campus": "Sterre",
"building": "S9", "building": "S9",
"room": "A3" "room": "3.1 Konrad Zuse"
}, },
"time": {
"day": "woensdag",
"start": 1130,
"end": 1330
}
},
{
"online": "zoom",
"time": {
"day": "vrijdag",
"start": 1300,
"end": 1530
}
}
]
},
{
"course": "Wetenschappelijk Rekenen",
"online_links": {
"zoom": "https://ufora.ugent.be/d2l/ext/rp/236404/lti/framedlaunch/556e197e-e87b-4c27-be5d-53adc7a41826"
},
"slots": [
{
"online": "zoom",
"time": { "time": {
"day": "dinsdag", "day": "dinsdag",
"start": 1130, "start": 1130,
@ -60,40 +46,43 @@
} }
}, },
{ {
"online": "zoom", "location": {
"time": { "campus": "Sterre",
"day": "woensdag", "building": "S9",
"start": 1500, "room": "3.1 Konrad Zuse"
"end": 1800
}
}, },
{
"online": "zoom",
"time": { "time": {
"day": "donderdag", "day": "donderdag",
"start": 830, "start": 1430,
"end": 1000 "end": 1600
} }
} }
] ]
}, },
{ {
"course": "Software Engineering Lab 1", "course": "Parallelle Computersystemen",
"online_links": { "online_links": {
"zoom": "https://ufora.ugent.be/d2l/ext/rp/235800/lti/framedlaunch/556e197e-e87b-4c27-be5d-53adc7a41826", "zoom": "https://ufora.ugent.be/d2l/ext/rp/449671/lti/framedlaunch/556e197e-e87b-4c27-be5d-53adc7a41826"
"msteams": "https://teams.microsoft.com/l/team/19%3a4dfd5b2fb1ae4aa9b72706aa3a0d6867%40thread.tacv2/conversations?groupId=256d5c58-5d53-43f5-9436-497b0c852c75&tenantId=d7811cde-ecef-496c-8f91-a1786241b99c"
}, },
"slots": [ "slots": [
{ {
"online": "msteams", "location": {
"campus": "Ardoyen",
"building": "iGent 126",
"room": "Auditorium 1"
},
"time": { "time": {
"day": "dinsdag", "day": "woensdag",
"start": 1430, "start": 1430,
"end": 1700 "end": 1730
} }
}, },
{ {
"online": "msteams", "location": {
"campus": "Ardoyen",
"building": "iGent 126",
"room": "Auditorium 1"
},
"time": { "time": {
"day": "vrijdag", "day": "vrijdag",
"start": 830, "start": 830,
@ -101,37 +90,136 @@
} }
} }
] ]
}
]
}, },
{ {
"course": "Webdevelopment", "name": "Elektrotechniek en telecommunicatie",
"schedule": []
},
{
"name": "Onderwijs",
"schedule": []
}
],
"schedule": [
{
"course": "Algoritmen en Datastructuren 3",
"online_links": { "online_links": {
"zoom": "https://ugent-be.zoom.us/j/93166767783?pwd=MWdvb1BnNnlPSnAyNk52QmRzdjcwdz09" "zoom": "https://ufora.ugent.be/d2l/ext/rp/437923/lti/framedlaunch/556e197e-e87b-4c27-be5d-53adc7a41826"
}, },
"slots": [ "slots": [
{ {
"weeks": {
"6": {
"canceled": true
}
},
"location": { "location": {
"campus": "Sterre", "campus": "Sterre",
"building": "S9", "building": "S9",
"room": "A3" "room": "3.1 Konrad Zuse"
}, },
"time": { "time": {
"day": "woensdag", "day": "dinsdag",
"start": 900, "start": 830,
"end": 1100 "end": 1000
} }
}, },
{ {
"online": "zoom", "location": {
"campus": "Sterre",
"building": "S9",
"room": "1.1 Alan Turing"
},
"time": { "time": {
"day": "donderdag", "day": "dinsdag",
"start": 1000, "start": 1000,
"end": 1130
}
},
{
"location": {
"campus": "Sterre",
"building": "S9",
"room": "1.1 Alan Turing"
},
"time": {
"day": "woensdag",
"start": 830,
"end": 1130
}
}
]
},
{
"course": "Artificiële Intelligentie",
"online_links": {
"zoom": "https://ufora.ugent.be/d2l/ext/rp/439739/lti/framedlaunch/556e197e-e87b-4c27-be5d-53adc7a41826"
},
"slots": [
{
"location": {
"campus": "Sterre",
"building": "S8",
"room": "0.1"
},
"time": {
"day": "maandag",
"start": 1430,
"end": 1730
}
},
{
"location": {
"campus": "Sterre",
"building": "S9",
"room": "1.1 Alan Turing"
},
"time": {
"day": "woensdag",
"start": 1130,
"end": 1300 "end": 1300
} }
},
{
"location": {
"campus": "Sterre",
"building": "S9",
"room": "3.1 Konrad Zuse"
},
"time": {
"day": "donderdag",
"start": 1300,
"end": 1430
}
}
]
},
{
"course": "Besturingssystemen",
"online_links": {
"zoom": "https://ufora.ugent.be/d2l/ext/rp/442814/lti/framedlaunch/556e197e-e87b-4c27-be5d-53adc7a41826"
},
"slots": [
{
"location": {
"campus": "Ardoyen",
"building": "iGent 126",
"room": "Auditorium 1"
},
"time": {
"day": "donderdag",
"start": 830,
"end": 1130
}
},
{
"location": {
"campus": "Ardoyen",
"building": "iGent 126",
"room": "Auditorium 1"
},
"time": {
"day": "vrijdag",
"start": 1300,
"end": 1600
}
} }
] ]
} }