imip-agent

Changeset

1457:1ade59d71cb9
2018-03-23 Paul Boddie raw files shortlog changelog graph Distinguish between period cancellation and message cancellation commands. Added a message command that produces a cancellation message for the sender. client-editing-simplification
imip_text_client.py (file)
     1.1 --- a/imip_text_client.py	Fri Mar 23 15:45:31 2018 +0100
     1.2 +++ b/imip_text_client.py	Fri Mar 23 15:46:51 2018 +0100
     1.3 @@ -45,7 +45,7 @@
     1.4  
     1.5  ATTENDANCE_COMMANDS         = ("A", "attend", "attendance")
     1.6  ATTENDEE_COMMANDS           = ("a", "attendee")
     1.7 -CANCEL_COMMANDS             = ("c", "cancel")
     1.8 +CANCEL_PERIOD_COMMANDS      = ("c", "cancel")
     1.9  CHANGE_COMMANDS             = ("C", "changes")
    1.10  CLASSIFICATION_COMMANDS     = ("c", "class", "classification")
    1.11  FINISH_COMMANDS             = ("f", "finish")
    1.12 @@ -63,6 +63,7 @@
    1.13  UNCANCEL_COMMANDS           = ("u", "uncancel", "restore")
    1.14  
    1.15  CANCEL_COMMANDS             = ("R", "remove", "cancel")
    1.16 +CANCEL_PUBLISH_COMMANDS     = ("RP", "remove-publish", "cancel-publish")
    1.17  PUBLISH_COMMANDS            = ("P", "publish")
    1.18  SEND_COMMANDS               = ("S", "send")
    1.19  UPDATE_COMMANDS             = ("U", "update")
    1.20 @@ -780,6 +781,13 @@
    1.21          if message:
    1.22              self.show_message(message, plain, filename)
    1.23  
    1.24 +    def show_cancel_publish_message(self, plain=False, filename=None):
    1.25 +
    1.26 +        "Show the cancel message for the current user."
    1.27 +
    1.28 +        message = self.prepare_cancel_publish_message()
    1.29 +        self.show_message(message, plain, filename)
    1.30 +
    1.31      def show_publish_message(self, plain=False, filename=None):
    1.32  
    1.33          "Show the publishing message for the updated event."
    1.34 @@ -1284,6 +1292,12 @@
    1.35     Show cancellation message sent to uninvited/removed recipients, writing to
    1.36     <filename> if specified
    1.37  
    1.38 +RP [ <filename> ]
    1.39 +remove-publish [ <filename> ]
    1.40 +cancel-publish [ <filename> ]
    1.41 +   Show cancellation message for use by the organiser, writing to <filename> if
    1.42 +   specified
    1.43 +
    1.44  U [ <filename> ]
    1.45  update [ <filename> ]
    1.46     Show update message, writing to <filename> if specified
    1.47 @@ -1383,6 +1397,10 @@
    1.48                      filename = get_text_arg(s)
    1.49                      cl.show_publish_message(plain=not filename, filename=filename)
    1.50  
    1.51 +                elif cmd in CANCEL_PUBLISH_COMMANDS:
    1.52 +                    filename = get_text_arg(s)
    1.53 +                    cl.show_cancel_publish_message(plain=not filename, filename=filename)
    1.54 +
    1.55                  elif cmd in CANCEL_COMMANDS:
    1.56                      filename = get_text_arg(s)
    1.57                      cl.show_cancel_message(plain=not filename, filename=filename)
    1.58 @@ -1557,7 +1575,7 @@
    1.59                                  if not cmd:
    1.60                                      cmd = read_input("Period: (c)ancel, (e)dit, (u)ncancel (or return)> ")
    1.61  
    1.62 -                                if cmd in CANCEL_COMMANDS:
    1.63 +                                if cmd in CANCEL_PERIOD_COMMANDS:
    1.64                                      cl.cancel_periods([index])
    1.65                                  elif cmd in EDIT_COMMANDS:
    1.66                                      cl.edit_period(index, args)