1.1 --- a/imiptools/handlers/person.py Fri Oct 24 16:31:14 2014 +0200
1.2 +++ b/imiptools/handlers/person.py Sat Oct 25 17:53:34 2014 +0200
1.3 @@ -12,33 +12,6 @@
1.4
1.5 "An event handler."
1.6
1.7 - def add(self):
1.8 - pass
1.9 -
1.10 - def cancel(self):
1.11 - pass
1.12 -
1.13 - def counter(self):
1.14 -
1.15 - "Since this handler does not send requests, it will not handle replies."
1.16 -
1.17 - pass
1.18 -
1.19 - def declinecounter(self):
1.20 -
1.21 - """
1.22 - Since this handler does not send counter proposals, it will not handle
1.23 - replies to such proposals.
1.24 - """
1.25 -
1.26 - pass
1.27 -
1.28 - def publish(self):
1.29 - pass
1.30 -
1.31 - def refresh(self):
1.32 - pass
1.33 -
1.34 def _record_and_deliver(self, queue=False):
1.35
1.36 oa = self.require_organiser_and_attendees()
1.37 @@ -65,6 +38,54 @@
1.38
1.39 return True
1.40
1.41 + def add(self):
1.42 +
1.43 + # NOTE: Queue a suggested modification to any active event.
1.44 +
1.45 + # The message is now wrapped and passed on to the recipient.
1.46 +
1.47 + return "ADD", MIMEText("An addition to an event has been received.")
1.48 +
1.49 + def cancel(self):
1.50 +
1.51 + # NOTE: Queue a suggested modification to any active event.
1.52 +
1.53 + # The message is now wrapped and passed on to the recipient.
1.54 +
1.55 + return "CANCEL", MIMEText("A cancellation has been received.")
1.56 +
1.57 + def counter(self):
1.58 +
1.59 + # NOTE: Queue a suggested modification to any active event.
1.60 +
1.61 + # The message is now wrapped and passed on to the recipient.
1.62 +
1.63 + return "COUNTER", MIMEText("A counter proposal has been received.")
1.64 +
1.65 + def declinecounter(self):
1.66 +
1.67 + # NOTE: Queue a suggested modification to any active event.
1.68 +
1.69 + # The message is now wrapped and passed on to the recipient.
1.70 +
1.71 + return "DECLINECOUNTER", MIMEText("A declining counter proposal has been received.")
1.72 +
1.73 + def publish(self):
1.74 +
1.75 + # NOTE: Register details of any relevant event.
1.76 +
1.77 + # The message is now wrapped and passed on to the recipient.
1.78 +
1.79 + return "PUBLISH", MIMEText("Details of an event have been received.")
1.80 +
1.81 + def refresh(self):
1.82 +
1.83 + # NOTE: Update details of any active event.
1.84 +
1.85 + # The message is now wrapped and passed on to the recipient.
1.86 +
1.87 + return "REFRESH", MIMEText("An event update has been received.")
1.88 +
1.89 def reply(self):
1.90
1.91 "Record replies and notify the recipient."
1.92 @@ -90,13 +111,22 @@
1.93 "A free/busy handler."
1.94
1.95 def publish(self):
1.96 - pass
1.97 +
1.98 + # NOTE: Register free/busy information.
1.99 +
1.100 + # The message is now wrapped and passed on to the recipient.
1.101 +
1.102 + return "PUBLISH", MIMEText("Details of a contact's availability have been received.")
1.103
1.104 def reply(self):
1.105
1.106 - "Since this handler does not send requests, it will not handle replies."
1.107 + "Record replies and notify the recipient."
1.108 +
1.109 + self._record_and_deliver(False)
1.110
1.111 - pass
1.112 + # The message is now wrapped and passed on to the recipient.
1.113 +
1.114 + return "REPLY", MIMEText("A reply has been received.")
1.115
1.116 def request(self):
1.117
1.118 @@ -146,53 +176,100 @@
1.119 "A journal entry handler."
1.120
1.121 def add(self):
1.122 - pass
1.123 +
1.124 + # NOTE: Queue a suggested modification to any active entry.
1.125 +
1.126 + # The message is now wrapped and passed on to the recipient.
1.127 +
1.128 + return "ADD", MIMEText("An addition to a journal entry has been received.")
1.129
1.130 def cancel(self):
1.131 - pass
1.132 +
1.133 + # NOTE: Queue a suggested modification to any active entry.
1.134 +
1.135 + # The message is now wrapped and passed on to the recipient.
1.136 +
1.137 + return "CANCEL", MIMEText("A cancellation has been received.")
1.138
1.139 def publish(self):
1.140 - pass
1.141 +
1.142 + # NOTE: Register details of any relevant entry.
1.143 +
1.144 + # The message is now wrapped and passed on to the recipient.
1.145 +
1.146 + return "PUBLISH", MIMEText("Details of a journal entry have been received.")
1.147
1.148 class Todo(Handler):
1.149
1.150 "A to-do item handler."
1.151
1.152 def add(self):
1.153 - pass
1.154 +
1.155 + # NOTE: Queue a suggested modification to any active item.
1.156 +
1.157 + # The message is now wrapped and passed on to the recipient.
1.158 +
1.159 + return "ADD", MIMEText("An addition to an item has been received.")
1.160
1.161 def cancel(self):
1.162 - pass
1.163 +
1.164 + # NOTE: Queue a suggested modification to any active item.
1.165 +
1.166 + # The message is now wrapped and passed on to the recipient.
1.167 +
1.168 + return "CANCEL", MIMEText("A cancellation has been received.")
1.169
1.170 def counter(self):
1.171
1.172 - "Since this handler does not send requests, it will not handle replies."
1.173 + # NOTE: Queue a suggested modification to any active item.
1.174
1.175 - pass
1.176 + # The message is now wrapped and passed on to the recipient.
1.177 +
1.178 + return "COUNTER", MIMEText("A counter proposal has been received.")
1.179
1.180 def declinecounter(self):
1.181
1.182 - """
1.183 - Since this handler does not send counter proposals, it will not handle
1.184 - replies to such proposals.
1.185 - """
1.186 + # NOTE: Queue a suggested modification to any active item.
1.187
1.188 - pass
1.189 + # The message is now wrapped and passed on to the recipient.
1.190 +
1.191 + return "DECLINECOUNTER", MIMEText("A declining counter proposal has been received.")
1.192
1.193 def publish(self):
1.194 - pass
1.195 +
1.196 + # NOTE: Register details of any relevant item.
1.197 +
1.198 + # The message is now wrapped and passed on to the recipient.
1.199 +
1.200 + return "PUBLISH", MIMEText("Details of an item have been received.")
1.201
1.202 def refresh(self):
1.203 - pass
1.204 +
1.205 + # NOTE: Update details of any active item.
1.206 +
1.207 + # The message is now wrapped and passed on to the recipient.
1.208 +
1.209 + return "REFRESH", MIMEText("An item update has been received.")
1.210
1.211 def reply(self):
1.212
1.213 - "Since this handler does not send requests, it will not handle replies."
1.214 + "Record replies and notify the recipient."
1.215 +
1.216 + self._record_and_deliver(False)
1.217
1.218 - pass
1.219 + # The message is now wrapped and passed on to the recipient.
1.220 +
1.221 + return "REPLY", MIMEText("A reply has been received.")
1.222
1.223 def request(self):
1.224 - pass
1.225 +
1.226 + "Hold requests and notify the recipient."
1.227 +
1.228 + self._record_and_deliver(True)
1.229 +
1.230 + # The message is now wrapped and passed on to the recipient.
1.231 +
1.232 + return "REQUEST", MIMEText("A request has been queued.")
1.233
1.234 # Handler registry.
1.235