Browse Source

fix off-by-one error with note parsing

Justin Tracey 2 years ago
parent
commit
66ded43202
1 changed files with 5 additions and 5 deletions
  1. 5 5
      vice-speaker-rotator.py

+ 5 - 5
vice-speaker-rotator.py

@@ -27,8 +27,8 @@ class CryspCalendar:
         self.practice_talks.update(self.parse_practice_talks(half_practices,
                                                              half=True))
         self.notes      = self.parse_notes(notes)
-        self.notes.update(self.parse_notes(practice_talks))
-        self.notes.update(self.parse_notes(half_practices))
+        self.notes.update(self.parse_notes(map(lambda l:l[1:], practice_talks)))
+        self.notes.update(self.parse_notes(map(lambda l:l[1:], half_practices)))
         self.verify_constraints()
         self.no_repeat = no_repeat
 
@@ -86,11 +86,11 @@ class CryspCalendar:
     def parse_notes(self, notes):
         notes_dict = {}
         for note in notes:
-            day     = str_to_date(note[1])
-            message = note[2]
+            day     = str_to_date(note[0])
+            message = note[1]
             assert day not in notes_dict or notes_dict[day] == message,\
                 'conflicting notes: "%s" and "%s" on %s' %\
-                (notes_dict[day], message, note[1])
+                (notes_dict[day], message, note[0])
             notes_dict[day] = message
         return notes_dict