Merge pull request #2 from leovp/patch-1
Spelling errors and more PEP8.
This commit is contained in:
+2
-2
@@ -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
|
||||
|
||||
+1
-1
@@ -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: ...
|
||||
|
||||
+2
-2
@@ -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
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user