# HG changeset patch # User Paul Boddie # Date 1521816411 -3600 # Node ID 1ade59d71cb982187afc2af1f6f70f1421bad31a # Parent 97d22cc423b36e7368f561edf12aed447c294323 Distinguish between period cancellation and message cancellation commands. Added a message command that produces a cancellation message for the sender. diff -r 97d22cc423b3 -r 1ade59d71cb9 imip_text_client.py --- a/imip_text_client.py Fri Mar 23 15:45:31 2018 +0100 +++ b/imip_text_client.py Fri Mar 23 15:46:51 2018 +0100 @@ -45,7 +45,7 @@ ATTENDANCE_COMMANDS = ("A", "attend", "attendance") ATTENDEE_COMMANDS = ("a", "attendee") -CANCEL_COMMANDS = ("c", "cancel") +CANCEL_PERIOD_COMMANDS = ("c", "cancel") CHANGE_COMMANDS = ("C", "changes") CLASSIFICATION_COMMANDS = ("c", "class", "classification") FINISH_COMMANDS = ("f", "finish") @@ -63,6 +63,7 @@ UNCANCEL_COMMANDS = ("u", "uncancel", "restore") CANCEL_COMMANDS = ("R", "remove", "cancel") +CANCEL_PUBLISH_COMMANDS = ("RP", "remove-publish", "cancel-publish") PUBLISH_COMMANDS = ("P", "publish") SEND_COMMANDS = ("S", "send") UPDATE_COMMANDS = ("U", "update") @@ -780,6 +781,13 @@ if message: self.show_message(message, plain, filename) + def show_cancel_publish_message(self, plain=False, filename=None): + + "Show the cancel message for the current user." + + message = self.prepare_cancel_publish_message() + self.show_message(message, plain, filename) + def show_publish_message(self, plain=False, filename=None): "Show the publishing message for the updated event." @@ -1284,6 +1292,12 @@ Show cancellation message sent to uninvited/removed recipients, writing to if specified +RP [ ] +remove-publish [ ] +cancel-publish [ ] + Show cancellation message for use by the organiser, writing to if + specified + U [ ] update [ ] Show update message, writing to if specified @@ -1383,6 +1397,10 @@ filename = get_text_arg(s) cl.show_publish_message(plain=not filename, filename=filename) + elif cmd in CANCEL_PUBLISH_COMMANDS: + filename = get_text_arg(s) + cl.show_cancel_publish_message(plain=not filename, filename=filename) + elif cmd in CANCEL_COMMANDS: filename = get_text_arg(s) cl.show_cancel_message(plain=not filename, filename=filename) @@ -1557,7 +1575,7 @@ if not cmd: cmd = read_input("Period: (c)ancel, (e)dit, (u)ncancel (or return)> ") - if cmd in CANCEL_COMMANDS: + if cmd in CANCEL_PERIOD_COMMANDS: cl.cancel_periods([index]) elif cmd in EDIT_COMMANDS: cl.edit_period(index, args)