diff options
| author | drachenminister <martin.schneider@kabelnet.at> | 2016-06-23 12:36:11 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2016-06-23 12:36:11 +0200 |
| commit | 646e22d37303c248038e1850f879dd96a7b02eb3 (patch) | |
| tree | a3bc7154ac45fe6bd1366da9ef5f790bbc242501 | |
| parent | 38fdcc7c6650a93406cc3fb9f3e477137c9bc34d (diff) | |
| download | python-pushover-646e22d37303c248038e1850f879dd96a7b02eb3.tar.gz | |
Implement canceling emergency-priority retries
see API description at https://pushover.net/api
| -rw-r--r-- | pushover.py | 11 |
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 |
