[packages/python-pushover] - up to 0.4
arekm
arekm at pld-linux.org
Tue Mar 5 14:20:23 CET 2019
commit e5adc4d3d5e645b877dd8ac7ae9432fafcc9e690
Author: Arkadiusz Miśkiewicz <arekm at maven.pl>
Date: Tue Mar 5 14:20:15 2019 +0100
- up to 0.4
poll.patch | 80 ----------------------------------------------------
python-pushover.spec | 8 ++----
2 files changed, 3 insertions(+), 85 deletions(-)
---
diff --git a/python-pushover.spec b/python-pushover.spec
index 2b6cf6d..131116f 100644
--- a/python-pushover.spec
+++ b/python-pushover.spec
@@ -7,13 +7,12 @@
%define module pushover
Summary: Bindings for the Pushover notification service
Name: python-%{module}
-Version: 0.2
-Release: 3
+Version: 0.4
+Release: 1
License: GPL v3+
Group: Libraries/Python
Source0: https://github.com/Thibauth/python-pushover/archive/v%{version}.tar.gz
-# Source0-md5: 8cb91ab69e6c58a2e831e35f2c092001
-Patch0: poll.patch
+# Source0-md5: 306c1fea53917263f854cd63b17c7fa0
URL: https://github.com/Thibauth/python-pushover
BuildRequires: rpm-pythonprov
BuildRequires: rpmbuild(macros) >= 1.713
@@ -43,7 +42,6 @@ service.
%prep
%setup -q
-%patch0 -p1
%build
%if %{with python2}
diff --git a/poll.patch b/poll.patch
deleted file mode 100644
index a3d6bd3..0000000
--- a/poll.patch
+++ /dev/null
@@ -1,80 +0,0 @@
-From 8c9c32f9a72b0e49e67e4e5bd7cfcb3565c87597 Mon Sep 17 00:00:00 2001
-From: Filip Lundborg <filip at filipl.se>
-Date: Sun, 26 Oct 2014 19:52:29 +0100
-Subject: [PATCH] Fix consistency in MessageRequest.poll
-
-The help, example and actual code had different opinions on how the function
-should behave. This commit make them agree.
-
-poll() will return the base Request object until the receipt has expired, been
-acknowledged or called_back upon. Once one of those three things has occurred
-it returns None.
-
-The example now has expire=120 and retry=60 since without those arguments it is
-unable to send a message with priority=2.
-
-The expired_at does not exist, it is called expires_at in the Pushover API.
-This is fixed as well.
-
-The values of expires_at, acknowledged_at and called_back_at can be found as
-attributes in the MessageRequest object like before.
----
- AUTHORS.rst | 1 +
- pushover.py | 22 ++++++++++++----------
- 2 files changed, 13 insertions(+), 10 deletions(-)
-
-diff --git a/AUTHORS.rst b/AUTHORS.rst
-index ff143a0..704cb48 100644
---- a/AUTHORS.rst
-+++ b/AUTHORS.rst
-@@ -4,3 +4,4 @@ Contributors
- * Sam Birch <sam.m.birch at gmail.com>
- * Crupuk
- * Thibaut Horel <thibaut.horel at gmail.com>
-+* Filip Lundborg <filip at filipl.se>
-diff --git a/pushover.py b/pushover.py
-index a62609f..b670266 100644
---- a/pushover.py
-+++ b/pushover.py
-@@ -129,10 +129,12 @@ def __init__(self, payload):
- self.receipt = None
- if payload.get("priority", 0) == 2:
- self.receipt = self.answer["receipt"]
-- self.parameters = ["expired", "called_back", "acknowledged"]
-- for parameter in self.parameters:
-- setattr(self, parameter, False)
-- setattr(self, parameter + "_at", 0)
-+ self.parameters = {"expired": "expires_at",
-+ "called_back": "called_back_at",
-+ "acknowledged": "acknowledged_at"}
-+ for param, when in self.parameters.iteritems():
-+ setattr(self, param, False)
-+ setattr(self, when, 0)
-
- def poll(self):
- """If the message request has a priority of 2, Pushover will keep
-@@ -147,18 +149,18 @@ def poll(self):
- acknowledged, so that a typical handling of a priority-2 notification
- can look like this::
-
-- request = client.send_message("Urgent notification", priority=2)
-- while not request.poll():
-+ request = client.send_message("Urgent notification", priority=2,
-+ expire=120, retry=60)
-+ while request.poll():
- # do something
- time.sleep(5)
- """
- if (self.receipt and not any(getattr(self, parameter)
- for parameter in self.parameters)):
- request = Request("get", RECEIPT_URL + self.receipt + ".json", {})
-- for parameter in self.parameters:
-- setattr(self, parameter, request.answer[parameter])
-- setattr(self, parameter + "_at",
-- request.answer[parameter + "_at"])
-+ for param, when in self.parameters.iteritems():
-+ setattr(self, param, bool(request.answer[param]))
-+ setattr(self, when, request.answer[when])
- return request
-
-
================================================================
---- gitweb:
http://git.pld-linux.org/gitweb.cgi/packages/python-pushover.git/commitdiff/e5adc4d3d5e645b877dd8ac7ae9432fafcc9e690
More information about the pld-cvs-commit
mailing list