aboutsummaryrefslogtreecommitdiffstats
path: root/pushover.py
diff options
context:
space:
mode:
Diffstat (limited to 'pushover.py')
-rw-r--r--pushover.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/pushover.py b/pushover.py
index 156afcd..aee53bf 100644
--- a/pushover.py
+++ b/pushover.py
@@ -163,6 +163,17 @@ class MessageRequest(Request):
setattr(self, when, request.answer[when])
return request
+ def cancel(self):
+ """If the message request has a priority of 2, Pushover will keep
+ sending the same notification until it either reaches its ``expire`` value
+ or is aknowledged by the client. Calling the :func:`cancel` function will
+ cancel the notification early.
+ """
+ if (self.receipt and not any(getattr(self, parameter)
+ for parameter in self.parameters)):
+ request = Request("post", RECEIPT_URL + self.receipt + "/cancel.json", {})
+ return request
+
class Client:
"""This is the main class of the module. It represents a specific Pushover