# HG changeset patch # User Paul Boddie # Date 1516496735 -3600 # Node ID be8ebc16d77506df82443aa9cc0745c9ad17ba93 # Parent 631922fcb0c1cb63b181d424e69beeeaaee09a4f Support the loading of recurrences that need to be separated from a parent. diff -r 631922fcb0c1 -r be8ebc16d775 imiptools/client.py --- a/imiptools/client.py Sun Jan 21 02:04:24 2018 +0100 +++ b/imiptools/client.py Sun Jan 21 02:05:35 2018 +0100 @@ -464,7 +464,26 @@ "Load the object with the given 'uid' and 'recurrenceid'." - self.set_object(self.get_stored_object(uid, recurrenceid)) + # Obtain any parent event or separate recurrence. + + obj = self.get_stored_object(uid, recurrenceid) + + # Without a separate recurrence, obtain the parent. + + if not obj and recurrenceid: + obj = self.get_stored_object(uid, None) + + # With a parent, obtain the period for the recurrence. + + if obj: + period = obj.has_recurrence_period(recurrenceid) + + # With a period, make a separate recurrence. + + if period: + obj = obj.make_recurrence(period) + + self.set_object(obj) return self.obj def set_identity(self, method):