1.1 --- a/imiptools/handlers/__init__.py Tue Apr 07 22:28:52 2015 +0200
1.2 +++ b/imiptools/handlers/__init__.py Tue Apr 07 22:30:06 2015 +0200
1.3 @@ -26,7 +26,7 @@
1.4 from imiptools.data import Object, \
1.5 get_address, get_uri, get_value, \
1.6 is_new_object, uri_dict, uri_item, uri_values
1.7 -from imiptools.dates import format_datetime, to_timezone
1.8 +from imiptools.dates import format_datetime, to_recurrence_start, to_timezone
1.9 from imiptools.period import can_schedule, remove_period, \
1.10 remove_additional_periods, remove_affected_period, \
1.11 update_freebusy
1.12 @@ -120,6 +120,12 @@
1.13
1.14 # Convenience methods for modifying free/busy collections.
1.15
1.16 + def to_recurrence_start(self, recurrenceid):
1.17 +
1.18 + "Get 'recurrenceid' in a form suitable for matching free/busy entries."
1.19 +
1.20 + return to_recurrence_start(recurrenceid, self.get_tzid())
1.21 +
1.22 def remove_from_freebusy(self, freebusy):
1.23
1.24 "Remove this event from the given 'freebusy' collection."
1.25 @@ -137,7 +143,8 @@
1.26 """
1.27
1.28 if self.recurrenceid:
1.29 - remove_affected_period(freebusy, self.uid, self.recurrenceid)
1.30 + recurrenceid = self.to_recurrence_start(self.recurrenceid)
1.31 + remove_affected_period(freebusy, self.uid, recurrenceid)
1.32 else:
1.33 # Remove obsolete recurrence periods.
1.34
1.35 @@ -147,6 +154,7 @@
1.36
1.37 if recurrenceids:
1.38 for recurrenceid in recurrenceids:
1.39 + recurrenceid = self.to_recurrence_start(recurrenceid)
1.40 remove_affected_period(freebusy, self.uid, recurrenceid)
1.41
1.42 def _update_freebusy(self, freebusy, periods, recurrenceid, transp=None):
1.43 @@ -480,8 +488,6 @@
1.44 # Set the complete event if not an additional occurrence.
1.45
1.46 event = obj.to_node()
1.47 - recurrenceid = format_datetime(obj.get_utc_datetime("RECURRENCE-ID"))
1.48 -
1.49 self.store.set_event(self.user, self.uid, self.recurrenceid, event)
1.50
1.51 return True