1.1 --- a/imipweb/calendar.py Fri Mar 27 17:28:50 2015 +0100
1.2 +++ b/imipweb/calendar.py Fri Mar 27 17:35:05 2015 +0100
1.3 @@ -27,7 +27,8 @@
1.4 to_timezone
1.5 from imiptools.period import add_day_start_points, add_empty_days, add_slots, \
1.6 convert_periods, get_freebusy_details, \
1.7 - get_scale, get_slots, get_spans, partition_by_day
1.8 + get_scale, get_slots, get_spans, partition_by_day, \
1.9 + POINT
1.10 from imipweb.resource import Resource
1.11
1.12 class CalendarPage(Resource):
1.13 @@ -334,7 +335,7 @@
1.14 # Record the slots and all time points employed.
1.15
1.16 groups.append(slots)
1.17 - all_points.update([point for point, active in slots])
1.18 + all_points.update([point_details for point_details, active in slots])
1.19
1.20 # Partition the groups into days.
1.21
1.22 @@ -370,18 +371,15 @@
1.23
1.24 last = None
1.25
1.26 - for point, active in day_slots:
1.27 + for point_details, active in day_slots:
1.28 + point, indicator = point_details
1.29 columns = max(columns, len(active))
1.30 -
1.31 - # Qualify points in the day with an extra indicator to
1.32 - # handle repeated time points due to instant events.
1.33 -
1.34 - day_points[(point, last == point and 1 or 0)] = active
1.35 + day_points[point_details] = active
1.36
1.37 if last:
1.38 intervals.append((last, point))
1.39
1.40 - last = point
1.41 + last = point_details
1.42
1.43 if last:
1.44 intervals.append((last, None))
1.45 @@ -548,10 +546,7 @@
1.46
1.47 last = None
1.48
1.49 - for point, endpoint in intervals:
1.50 - indicator = point == last and 1 or 0
1.51 - last = point
1.52 -
1.53 + for (point, indicator), endpoint in intervals:
1.54 continuation = point == get_start_of_day(point, tzid)
1.55
1.56 # Some rows contain no period details and are marked as such.
1.57 @@ -577,7 +572,7 @@
1.58
1.59 page.tr(class_=css)
1.60 page.th(class_="timeslot")
1.61 - if indicator == 0:
1.62 + if indicator == POINT:
1.63 self._time_point(point, endpoint)
1.64 page.th.close()
1.65