Merge pull request #2 from leovp/patch-1

Spelling errors and more PEP8.
This commit is contained in:
Sergey Petrov
2016-03-26 13:07:32 +04:00
3 changed files with 6 additions and 6 deletions
+2 -2
View File
@@ -21,11 +21,11 @@ class APNsClient(object):
ssl_context.load_cert_chain(cert_file) ssl_context.load_cert_chain(cert_file)
self.__connection = HTTP20Connection(server, port, ssl_context=ssl_context) 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') json_payload = dumps(notification.dict(), ensure_ascii=False, separators=(',', ':')).encode('utf-8')
headers = { headers = {
'apns-priority': prioriy.value 'apns-priority': priority.value
} }
if topic: if topic:
headers['apns-topic'] = topic headers['apns-topic'] = topic
+1 -1
View File
@@ -13,5 +13,5 @@ class APNsClient(object):
def send_notification(self, def send_notification(self,
token_hex: str, token_hex: str,
notification: Payload, notification: Payload,
prioriy: NotificationPriority = NotificationPriority.Immediate, priority: NotificationPriority = NotificationPriority.Immediate,
topic: Optional[str] = None) -> None: ... topic: Optional[str] = None) -> None: ...
+2 -2
View File
@@ -3,12 +3,12 @@ class APNsException(Exception):
class InternalException(APNsException): 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 pass
class BadPayloadException(APNsException): class BadPayloadException(APNsException):
"""Something bad with payload""" """Something bad with the payload."""
pass pass