diff --git a/timetabling/README.md b/timetabling/README.md index 605c1ab610fdb0ca7fbf3b959d029a6271d6571d..22f82fb0f2eac61e20475bf48e5892c9ad2f14dc 100644 --- a/timetabling/README.md +++ b/timetabling/README.md @@ -4,6 +4,7 @@ * `timetable-ics.py` -- convert the Timetabling team spreadsheets into ICS format. This is a rough and ready script and will probably need tweaks to your particular spreadsheet. * `get-practical-groups.py` -- find out which lab groups your students belong to on the web timetable. * `scrape-timetable.py` -- pull ICS files from the timetabling system for departments/modules/rooms. Needs some config. Use "rooms" as a command line argument to get rooms, else gets modules. +* `find-empty-hour.py` -- after scraping all rooms, you can use this to search for a free room on a given day/hour. To view the generated .ics files, you might like [ttcal][ttcal] (or just import into your favouring calendar app/website). diff --git a/timetabling/timetable-ics.py b/timetabling/timetable-ics.py index ee7391bd2f242d1803003a930943fd2110e3e39b..256f85175ac743cff7a4372fd6fca66187664d14 100644 --- a/timetabling/timetable-ics.py +++ b/timetabling/timetable-ics.py @@ -124,8 +124,10 @@ for ttfile in timetable_files: location = "" if "PROVISIONAL Location Name" in row: location = row["PROVISIONAL Location Name"] + if "Required Location Names" in row: + location = row["Required Location Names"] if "Required Location Name" in row: - location = row["PROVISIONAL Location Name"] + location = row["Required Location Name"] if day is None: print("Could not find timetabled day column, aborting") @@ -138,6 +140,10 @@ for ttfile in timetable_files: if "TUT" in name: continue + annotated_name = name + if "online" in row["Activity Type Name"].lower(): + annotated_name = "🖥️ " + name + if expand_events: for week in weeks: offset = get_day_offset(day) @@ -150,7 +156,7 @@ for ttfile in timetable_files: continue end_time = get_end_time(start_time, duration_hours) event = Event() - event.add("summary", name) + event.add("summary", annotated_name) event.add("location", location) event.add("dtstart", start_time) event.add("dtend", end_time) @@ -188,7 +194,7 @@ for ttfile in timetable_files: )) event = Event() - event.add("summary", name) + event.add("summary", annotated_name) event.add("location", location) event.add("dtstart", start_time) event.add("dtend", end_time)