Changeset - 44d0ea6f2b8e
[Not reviewed]
0 1 0
Brian Rosner - 12 years ago 2012-08-30 07:02:49
brosner@gmail.com
Moved colspan to slot in TimeTable
1 file changed with 1 insertions and 1 deletions:
0 comments (0 inline, 0 general)
symposion/schedule/timetable.py
Show inline comments
...
 
@@ -20,14 +20,14 @@ class TimeTable(object):
 
        row = []
 
        for time, next_time in pairwise(times):
 
            row = {"time": time, "slots": []}
 
            for slot in slots:
 
                if slot.start == time:
 
                    slot.rowspan = TimeTable.rowspan(times, slot.start, slot.end)
 
                    slot.colspan = slot.rooms.consecutive_count()
 
                    row["slots"].append(slot)
 
            row["colspan"] = self.rooms.consecutive_count()
 
            if row["slots"] or next_time is None:
 
                yield row
 
    
 
    @staticmethod
 
    def rowspan(times, start, end):
 
        return times.index(end) - times.index(start)
0 comments (0 inline, 0 general)