From 09685404ea882781da4b8030ab7dd0573b61a51c Mon Sep 17 00:00:00 2001 From: Leonid R Date: Fri, 25 Mar 2016 23:30:01 +0400 Subject: [PATCH 1/4] Fixed spelling in client.py --- apns2/client.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/apns2/client.py b/apns2/client.py index 8f8632f..7117c59 100644 --- a/apns2/client.py +++ b/apns2/client.py @@ -21,11 +21,11 @@ class APNsClient(object): ssl_context.load_cert_chain(cert_file) self.__connection = HTTP20Connection(server, port, ssl_context=ssl_context) - def send_notification(self, token_hex, notification, prioriy=NotificationPriority.Immediate, topic=None): + def send_notification(self, token_hex, notification, priority=NotificationPriority.Immediate, topic=None): json_payload = dumps(notification.dict(), ensure_ascii=False, separators=(',',':')).encode('utf-8') headers = { - 'apns-priority': prioriy.value + 'apns-priority': priority.value } if topic: headers['apns-topic'] = topic From 413957fa59ad5f88b5bba0a3a70b3786c8cb2002 Mon Sep 17 00:00:00 2001 From: Leonid R Date: Fri, 25 Mar 2016 23:33:26 +0400 Subject: [PATCH 2/4] Update client.py according to PEP8 --- apns2/client.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apns2/client.py b/apns2/client.py index 7117c59..7a869e5 100644 --- a/apns2/client.py +++ b/apns2/client.py @@ -22,7 +22,7 @@ class APNsClient(object): self.__connection = HTTP20Connection(server, port, ssl_context=ssl_context) def send_notification(self, token_hex, notification, priority=NotificationPriority.Immediate, topic=None): - json_payload = dumps(notification.dict(), ensure_ascii=False, separators=(',',':')).encode('utf-8') + json_payload = dumps(notification.dict(), ensure_ascii=False, separators=(',', ':')).encode('utf-8') headers = { 'apns-priority': priority.value From 9b5e57692b6316013c2ea64a3fee093e226642b3 Mon Sep 17 00:00:00 2001 From: Leonid R Date: Fri, 25 Mar 2016 23:38:37 +0400 Subject: [PATCH 3/4] Fixed spelling in errors.py --- apns2/errors.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/apns2/errors.py b/apns2/errors.py index 0cd6ec8..6caaca3 100644 --- a/apns2/errors.py +++ b/apns2/errors.py @@ -3,12 +3,12 @@ class APNsException(Exception): class InternalException(APNsException): - """This exception should not thrown. If it is, please report this bug""" + """This exception should not be raised. If it is, please report this as a bug.""" pass class BadPayloadException(APNsException): - """Something bad with payload""" + """Something bad with the payload.""" pass From aa2387811a5013623ac0e586dde8576e45b3ea5a Mon Sep 17 00:00:00 2001 From: Leonid R Date: Sat, 26 Mar 2016 01:46:07 +0400 Subject: [PATCH 4/4] Fixed spelling in client.pyi --- apns2/client.pyi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apns2/client.pyi b/apns2/client.pyi index c5e4c5d..d4d47c1 100644 --- a/apns2/client.pyi +++ b/apns2/client.pyi @@ -13,5 +13,5 @@ class APNsClient(object): def send_notification(self, token_hex: str, notification: Payload, - prioriy: NotificationPriority = NotificationPriority.Immediate, + priority: NotificationPriority = NotificationPriority.Immediate, topic: Optional[str] = None) -> None: ...