# HG changeset patch # User Paul Boddie # Date 1391019621 -3600 # Node ID 22008b9978d63915bf0c4e5e17e5afea6b864e8e # Parent d35aea22f824804437fcb8bd227faa92e3d05643 Fixed the final time label in day views by adding the end times of periods to the coverage scale details. diff -r d35aea22f824 -r 22008b9978d6 EventAggregatorSupport/Filter.py --- a/EventAggregatorSupport/Filter.py Tue Jan 28 23:30:33 2014 +0100 +++ b/EventAggregatorSupport/Filter.py Wed Jan 29 19:20:21 2014 +0100 @@ -198,8 +198,8 @@ Return a scale for the given coverage so that the times involved are exposed. The scale consists of a list of non-overlapping timespans forming a contiguous period of time, where each timespan is accompanied in a tuple - by a limit and a list of original time details. Thus, the scale consists of - (timespan, limit, set-of-times) tuples. + by a limit and two sets of original time details. Thus, the scale consists + of (timespan, limit, set-of-start-times, set-of-end-times) tuples. """ times = {} @@ -241,7 +241,7 @@ for time, limit in keys: if not first: - scale.append((Timespan(start, time), limit, times[(start, start_limit)])) + scale.append((Timespan(start, time), limit, times[(start, start_limit)], times[(time, limit)])) else: first = 0 start, start_limit = time, limit diff -r d35aea22f824 -r 22008b9978d6 EventAggregatorSupport/View.py --- a/EventAggregatorSupport/View.py Tue Jan 28 23:30:33 2014 +0100 +++ b/EventAggregatorSupport/View.py Wed Jan 29 19:20:21 2014 +0100 @@ -1339,7 +1339,7 @@ day_rows = [] - for period, limit, times in scale: + for period, limit, start_times, end_times in scale: # Ignore timespans before this day. @@ -1363,7 +1363,7 @@ rowspans[event] += 1 day_row.append((location, event)) - day_rows.append((period, day_row, times)) + day_rows.append((period, day_row, start_times, end_times)) # Output the locations. @@ -1393,7 +1393,7 @@ last_period = period = None events_written = set() - for period, day_row, times in day_rows: + for period, day_row, start_times, end_times in day_rows: # Write a heading describing the time. @@ -1402,7 +1402,7 @@ # Show times only for distinct periods. if not last_period or period.start != last_period.start: - append(self.writeDayScaleHeading(times)) + append(self.writeDayScaleHeading(start_times)) else: append(self.writeDayScaleHeading([])) @@ -1432,7 +1432,7 @@ if period is not None: if period.end == date: append(fmt.table_row(on=1)) - append(self.writeDayScaleHeading(times)) + append(self.writeDayScaleHeading(end_times)) for slot in day_row: append(self.writeDaySpacer())