1.1 --- a/imiptools/client.py Sat Jan 20 17:41:23 2018 +0100
1.2 +++ b/imiptools/client.py Sat Jan 20 18:18:12 2018 +0100
1.3 @@ -440,6 +440,8 @@
1.4
1.5 "Set the current object to 'obj', obtaining metadata details."
1.6
1.7 + # Set convenience attributes to null values if the object is null.
1.8 +
1.9 self.obj = obj
1.10 self.uid = obj and self.obj.get_uid()
1.11 self.recurrenceid = obj and self.obj.get_recurrenceid()
1.12 @@ -496,12 +498,15 @@
1.13
1.14 return self.obj.get_uri("ORGANIZER") == self.user
1.15
1.16 - def is_recurrence(self):
1.17 + def describes_recurrence_period(self):
1.18
1.19 - "Return whether the current object is a recurrence of its parent."
1.20 + """
1.21 + Return whether the current object describes a recurrence period defined
1.22 + in its parent.
1.23 + """
1.24
1.25 parent = self.get_parent_object()
1.26 - return parent and parent.has_recurrence(self.obj.get_recurrenceid())
1.27 + return parent and parent.has_recurrence_period(self.obj.get_recurrenceid())
1.28
1.29 def get_recurrences(self, uid=None):
1.30
2.1 --- a/imiptools/data.py Sat Jan 20 17:41:23 2018 +0100
2.2 +++ b/imiptools/data.py Sat Jan 20 18:18:12 2018 +0100
2.3 @@ -402,20 +402,21 @@
2.4
2.5 return period in self.get_periods(end=period.get_start_point(), inclusive=True)
2.6
2.7 - def has_recurrence(self, recurrenceid):
2.8 + def has_recurrence_period(self, recurrenceid):
2.9
2.10 """
2.11 Return whether this object, employing the fallback time zone where no
2.12 - time zone information is defined, has the given 'recurrenceid'.
2.13 + time zone information is defined, has the given 'recurrenceid'. Any
2.14 + found period will be returned, None otherwise.
2.15 """
2.16
2.17 start_point = self.get_recurrence_start_point(recurrenceid)
2.18
2.19 for p in self.get_periods(end=start_point, inclusive=True):
2.20 if p.get_start_point() == start_point:
2.21 - return True
2.22 + return p
2.23
2.24 - return False
2.25 + return None
2.26
2.27 def get_updated_periods(self, start=None, end=None):
2.28
3.1 --- a/imiptools/editing.py Sat Jan 20 17:41:23 2018 +0100
3.2 +++ b/imiptools/editing.py Sat Jan 20 18:18:12 2018 +0100
3.3 @@ -1521,8 +1521,7 @@
3.4 # Main period changes can only be sensibly expressed as a counter-
3.5 # proposal by expressing the entire event as such.
3.6
3.7 - if new or removed or is_changed or main_modified or reinstated or \
3.8 - reinstated_attendance:
3.9 + if new or removed or is_changed or main_modified or reinstated:
3.10
3.11 # The event is defined in terms of new periods and exceptions for
3.12 # removed periods or obsolete rule periods.
3.13 @@ -1539,7 +1538,7 @@
3.14 else:
3.15 to_set = []
3.16 to_exclude = []
3.17 - to_reschedule = list(chain(replaced_modified, replaced_modified_attendance))
3.18 + to_reschedule = replaced_modified
3.19 all_unscheduled = cancelled_unmodified
3.20 all_rescheduled = list(chain(replaced_unmodified, to_reschedule))
3.21
4.1 --- a/imiptools/handlers/common.py Sat Jan 20 17:41:23 2018 +0100
4.2 +++ b/imiptools/handlers/common.py Sat Jan 20 18:18:12 2018 +0100
4.3 @@ -153,7 +153,7 @@
4.4
4.5 # Handle any newly-separated, valid occurrence.
4.6
4.7 - return not obj and self.is_recurrence()
4.8 + return not obj and self.describes_recurrence_period()
4.9
4.10 def make_separate_occurrence(self):
4.11