1.1 --- a/macros/EventAggregator.py Thu Apr 07 23:44:06 2011 +0200
1.2 +++ b/macros/EventAggregator.py Fri Apr 08 00:42:20 2011 +0200
1.3 @@ -478,7 +478,7 @@
1.4 event_details = event.getDetails()
1.5 event_summary = event.getSummary(self.parent_name)
1.6
1.7 - is_ambiguous = event_details["start"].ambiguous() or event_details["end"].ambiguous()
1.8 + is_ambiguous = event.as_timespan().ambiguous()
1.9 style = self.getEventStyle(event_summary)
1.10
1.11 # The event box contains the summary, alongside
1.12 @@ -851,6 +851,13 @@
1.13 return "".join(output)
1.14
1.15 def writeDaySlots(self, date, full_coverage, day_slots):
1.16 +
1.17 + """
1.18 + Given a 'date', non-empty 'full_coverage' for the day concerned, and a
1.19 + non-empty mapping of 'day_slots' (from locations to event collections),
1.20 + output the day slots for the day.
1.21 + """
1.22 +
1.23 page = self.page
1.24 fmt = page.formatter
1.25
1.26 @@ -899,6 +906,29 @@
1.27
1.28 day_rows.append((period, day_row))
1.29
1.30 + # Output the locations.
1.31 +
1.32 + output.append(fmt.table_row(on=1))
1.33 +
1.34 + # Add a spacer.
1.35 +
1.36 + output.append(self.writeDaySpacer(colspan=2, cls="location"))
1.37 +
1.38 + for location in locations:
1.39 +
1.40 + # Add spacers to the column spans.
1.41 +
1.42 + columns = len(day_slots[location]) * 2 - 1
1.43 + output.append(fmt.table_cell(on=1, attrs={"class" : "event-location-heading", "colspan" : str(columns)}))
1.44 + output.append(fmt.text(location))
1.45 + output.append(fmt.table_cell(on=0))
1.46 +
1.47 + # Add a trailing spacer.
1.48 +
1.49 + output.append(self.writeDaySpacer(cls="location"))
1.50 +
1.51 + output.append(fmt.table_row(on=0))
1.52 +
1.53 # Output the periods with event details.
1.54
1.55 period = None
1.56 @@ -919,14 +949,12 @@
1.57 output.append(fmt.table_row(on=1))
1.58 output.append(self.writeDayScaleHeading(period.start.time_string()))
1.59
1.60 + output.append(self.writeDaySpacer())
1.61 +
1.62 # Visit each slot corresponding to a location (or no location).
1.63
1.64 for location, event in day_row:
1.65
1.66 - # Add a spacer.
1.67 -
1.68 - output.append(self.writeDaySpacer())
1.69 -
1.70 # Output each location slot's contribution.
1.71
1.72 if event is None or event not in events_written:
1.73 @@ -934,6 +962,10 @@
1.74 if event is not None:
1.75 events_written.add(event)
1.76
1.77 + # Add a trailing spacer.
1.78 +
1.79 + output.append(self.writeDaySpacer())
1.80 +
1.81 output.append(fmt.table_row(on=0))
1.82
1.83 # Write a final time heading if the last period ends in the current day.
1.84 @@ -1004,13 +1036,13 @@
1.85
1.86 return "".join(output)
1.87
1.88 - def writeDaySpacer(self, colspan=1, full_day=0):
1.89 + def writeDaySpacer(self, colspan=1, cls="timespan"):
1.90 page = self.page
1.91 fmt = page.formatter
1.92
1.93 output = []
1.94 output.append(fmt.table_cell(on=1, attrs={
1.95 - "class" : "event-%s-spacer" % (full_day and "full-day" or "timespan"),
1.96 + "class" : "event-%s-spacer" % cls,
1.97 "colspan" : str(colspan)}))
1.98 output.append(fmt.table_cell(on=0))
1.99 return "".join(output)
1.100 @@ -1413,12 +1445,11 @@
1.101 getEventsInPeriod(all_shown_events, getCalendarPeriod(date, date)), "datetime")
1.102
1.103 # Work out how many columns the day title will need.
1.104 - # Include spacers before each event column.
1.105 + # Include spacers after the scale and each event column.
1.106
1.107 - colspan = sum(map(len, day_slots.values())) * 2 + 1
1.108 + colspan = sum(map(len, day_slots.values())) * 2 + 2
1.109
1.110 output.append(view.writeDayHeading(date, colspan))
1.111 - output.append(view.writeDaySpacer(colspan, full_day=1))
1.112
1.113 # Either generate empty days...
1.114