From 2e83b5936ac6e563a091d0dca32e79e74658b740 Mon Sep 17 00:00:00 2001 From: David Schlachter Date: Thu, 9 May 2019 07:10:48 -0400 Subject: [PATCH] Shorten locations server-side instead of requiring clients to update --- course-download/updateDatabase.py | 3 +++ schedule-generator/ca/uottawa/ui/ClientGUI.java | 2 -- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/course-download/updateDatabase.py b/course-download/updateDatabase.py index b8ef1df..d2af23a 100755 --- a/course-download/updateDatabase.py +++ b/course-download/updateDatabase.py @@ -254,6 +254,9 @@ def main(): if times[0] == times[1] : continue # an activity with a zero duration activityTypes.append(activityType) + locationRows[j] = re.sub("^[^(]+\\(", "(", locationRows[j]) + locationRows[j] = re.sub("[()]", "", locationRows[j]) + if args.verbose: print(" ", sectionNumber, activityType, str(activityNumber), fullDay, times[0], times[1]) activities.append( convertActivityCode(activityType) + "," + diff --git a/schedule-generator/ca/uottawa/ui/ClientGUI.java b/schedule-generator/ca/uottawa/ui/ClientGUI.java index c7996e1..5e1f590 100644 --- a/schedule-generator/ca/uottawa/ui/ClientGUI.java +++ b/schedule-generator/ca/uottawa/ui/ClientGUI.java @@ -984,8 +984,6 @@ private void drawSchedule() { String actType = a.getType(); String strAct = actType + " " + a.getNumber(); String strLoc = a.getPlace(); - - strLoc = strLoc.replaceAll("^[^(]+\\(", "(").replaceAll("[()]", ""); //We should find out what color this activity will be drawn in. switch (actType) {