Fix bug in Les for 1ba classes, update schedule

pull/7/head
Stijn De Clercq 2020-10-25 23:40:04 +01:00
parent 0db835bba0
commit d63fb8bf39
2 changed files with 13 additions and 20 deletions

View File

@ -1,7 +1,6 @@
[ [
{ {
"course": "Programmeren", "course": "Programmeren",
"icon": "laptop-code",
"slots": [ "slots": [
{ {
"campus": "Sterre", "campus": "Sterre",
@ -32,7 +31,6 @@
}, },
{ {
"course": "Databanken", "course": "Databanken",
"icon": "database",
"slots": [ "slots": [
{ {
"campus": "Sterre", "campus": "Sterre",
@ -40,8 +38,8 @@
"room": "A3", "room": "A3",
"time": [ "time": [
"donderdag", "donderdag",
1000, 1130,
1100 1245
] ]
}, },
{ {
@ -50,8 +48,8 @@
"room": "A3", "room": "A3",
"time": [ "time": [
"vrijdag", "vrijdag",
1430, 1300,
1530 1415
] ]
}, },
{ {
@ -96,8 +94,6 @@
}, },
{ {
"course": "Computergebruik", "course": "Computergebruik",
"icon": "linux",
"icon_type": "fab",
"slots": [ "slots": [
{ {
"campus": "Sterre", "campus": "Sterre",
@ -142,7 +138,6 @@
}, },
{ {
"course": "RAF", "course": "RAF",
"icon": "brain",
"slots": [ "slots": [
{ {
"campus": "Sterre", "campus": "Sterre",
@ -178,12 +173,10 @@
}, },
{ {
"course": "Discrete Wiskunde", "course": "Discrete Wiskunde",
"icon": "square-root-alt", "zoom": "https://ufora.ugent.be/d2l/ext/rp/232374/lti/framedlaunch/556e197e-e87b-4c27-be5d-53adc7a41826",
"slots": [ "slots": [
{ {
"campus": "Sterre", "online": "ZOOM",
"building": "S9",
"room": "A3",
"time": [ "time": [
"maandag", "maandag",
1000, 1000,

View File

@ -97,11 +97,11 @@ def getCourses(schedule, day, week):
# Add online links for those at home # Add online links for those at home
# Check if link hasn't been added yet # Check if link hasn't been added yet
if not any(el["course"] == course["course"] and if "online" in slot and not any(el["course"] == course["course"] and
# Avoid KeyErrors: if either of these don't have an online link yet, # Avoid KeyErrors: if either of these don't have an online link yet,
# add it as well # add it as well
("online" not in el or "online" not in slot or el["online"] == slot["online"]) ("online" not in el or el["online"] == slot["online"])
for el in onlineLinks): for el in onlineLinks):
# Some courses have multiple links on the same day, # Some courses have multiple links on the same day,
# add all of them # add all of them
if "bongo" in slot["online"].lower(): if "bongo" in slot["online"].lower():
@ -317,16 +317,16 @@ def parseArgs(day):
# elif: calling a weekday is automatically handled below, # elif: calling a weekday is automatically handled below,
# so checking is obsolete # so checking is obsolete
else: else:
# TODO check other direction (di 1) in else
# Both were passed # Both were passed
if day[0].isdigit(): if day[0].isdigit():
if 0 < int(day[0]) < years_counter + 1: if 0 < int(day[0]) < years_counter + 1:
year = int(day[0]) year = int(day[0])
day = [] # day = []
else: else:
return [False, "Dit is geen geldige jaargang."] return [False, "Dit is geen geldige jaargang."]
# Cut the schedule from the string # Cut the schedule from the string
day = day[1:] day = day[1:]
day = getWeekDay(None if len(day) == 0 else day)[1] day = getWeekDay(None if len(day) == 0 else day)[1]
dayDatetime = findDate(timeFormatters.weekdayToInt(day)) dayDatetime = findDate(timeFormatters.weekdayToInt(day))