1.1 --- a/imip_text_client.py Tue Dec 12 00:05:22 2017 +0100
1.2 +++ b/imip_text_client.py Tue Dec 12 00:10:43 2017 +0100
1.3 @@ -205,18 +205,16 @@
1.4 "Show period 'p' at 'index' with any indicated 'errors'."
1.5
1.6 errors = errors and errors.get(index)
1.7 - if p.replacement:
1.8 - if p.cancelled:
1.9 - label = "Cancelled"
1.10 - else:
1.11 - label = "Replaced"
1.12 + if p.cancelled:
1.13 + label = "Cancelled"
1.14 + elif p.replacement:
1.15 + label = "Replaced"
1.16 + elif p.new_replacement:
1.17 + label = "To replace"
1.18 + elif p.recurrenceid:
1.19 + label = "Retained"
1.20 else:
1.21 - if p.new_replacement:
1.22 - label = "To replace"
1.23 - elif p.recurrenceid:
1.24 - label = "Retained"
1.25 - else:
1.26 - label = "New"
1.27 + label = "New"
1.28
1.29 error_label = errors and " (errors: %s)" % ", ".join(errors) or ""
1.30 print "(%d) %s%s:" % (index, label, error_label), p.get_start(), p.get_end(), p.origin
1.31 @@ -442,7 +440,11 @@
1.32 if period:
1.33 edit_period(period, args)
1.34 period.cancelled = False
1.35 - period.origin = "DTSTART-RECUR"
1.36 +
1.37 + # Change the origin of modified rule periods.
1.38 +
1.39 + if period.origin == "RRULE":
1.40 + period.origin = "RDATE"
1.41
1.42 # Sort the periods after this change.
1.43