diff --git a/.landscape.yml b/.landscape.yml new file mode 100644 index 0000000..d3799b4 --- /dev/null +++ b/.landscape.yml @@ -0,0 +1,8 @@ +python-targets: + - 2 + - 3 +ignore-paths: + - setup.py +strictness: veryhigh +pep8: + full: true diff --git a/.pylintrc b/.pylintrc new file mode 100644 index 0000000..8547b44 --- /dev/null +++ b/.pylintrc @@ -0,0 +1,13 @@ +[DESIGN] +max-args = 10 +max-attributes = 10 + +[FORMAT] +max-line-length=120 + +[MESSAGES CONTROL] +disable = + # Missing docstring + C0111, + # Too few public methods + R0903 diff --git a/apns2/__init__.py b/apns2/__init__.py index 8b13789..e69de29 100644 --- a/apns2/__init__.py +++ b/apns2/__init__.py @@ -1 +0,0 @@ - diff --git a/apns2/client.py b/apns2/client.py index 98f8961..a1e3bc5 100644 --- a/apns2/client.py +++ b/apns2/client.py @@ -22,8 +22,10 @@ class APNsClient(object): self.__connection = HTTP20Connection(server, port, ssl_context=ssl_context, force_proto=proto or 'h2') self.__json_encoder = json_encoder - def send_notification(self, token_hex, notification, priority=NotificationPriority.Immediate, topic=None, expiration=None): - json_payload = dumps(notification.dict(), cls=self.__json_encoder, ensure_ascii=False, separators=(',', ':')).encode('utf-8') + def send_notification(self, token_hex, notification, priority=NotificationPriority.Immediate, topic=None, + expiration=None): + json_str = dumps(notification.dict(), cls=self.__json_encoder, ensure_ascii=False, separators=(',', ':')) + json_payload = json_str.encode('utf-8') headers = { 'apns-priority': priority.value diff --git a/apns2/payload.py b/apns2/payload.py index 052e5f0..6c92105 100644 --- a/apns2/payload.py +++ b/apns2/payload.py @@ -5,8 +5,7 @@ class PayloadAlert(object): def __init__(self, title=None, title_localized_key=None, title_localized_args=None, body=None, body_localized_key=None, body_localized_args=None, action_localized_key=None, - launch_image=None - ): + launch_image=None): self.title = title self.title_localized_key = title_localized_key self.title_localized_args = title_localized_args diff --git a/setup.cfg b/setup.cfg new file mode 100644 index 0000000..4879cb6 --- /dev/null +++ b/setup.cfg @@ -0,0 +1,2 @@ +[pep8] +max-line-length = 160