# HG changeset patch # User Paul Boddie # Date 1431694581 -7200 # Node ID b9c05d30449f1cdf9e1078d3fc599aa43873f6ef # Parent d5e36f09a34057a77af791fe2710cf5451463d5c Support the cancellation of previously unseparated recurrences. diff -r d5e36f09a340 -r b9c05d30449f imiptools/handlers/__init__.py --- a/imiptools/handlers/__init__.py Fri May 15 14:55:23 2015 +0200 +++ b/imiptools/handlers/__init__.py Fri May 15 14:56:21 2015 +0200 @@ -130,7 +130,8 @@ "Remove this event from the given 'freebusy' collection." - remove_period(freebusy, self.uid, self.recurrenceid) + if not remove_period(freebusy, self.uid, self.recurrenceid) and self.recurrenceid: + remove_affected_period(freebusy, self.uid, self.recurrenceid) def remove_freebusy_for_recurrences(self, freebusy, recurrenceids=None): diff -r d5e36f09a340 -r b9c05d30449f imiptools/period.py --- a/imiptools/period.py Fri May 15 14:55:23 2015 +0200 +++ b/imiptools/period.py Fri May 15 14:56:21 2015 +0200 @@ -128,14 +128,18 @@ (which if omitted causes the "parent" object's periods to be referenced). """ + removed = False i = 0 while i < len(freebusy): fb = freebusy[i] if fb.uid == uid and fb.recurrenceid == recurrenceid: del freebusy[i] + removed = True else: i += 1 + return removed + def remove_additional_periods(freebusy, uid, recurrenceids=None): """