Skip to content

Commit a6c71e0

Browse files
committed
more cleaning
1 parent 6658d74 commit a6c71e0

File tree

2 files changed

+26
-13
lines changed

2 files changed

+26
-13
lines changed

pusher/notification_client.py

Lines changed: 25 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,15 @@
1-
from .client import Client
2-
from .http import POST, Request, request_method
3-
from .util import ensure_text
1+
# -*- coding: utf-8 -*-
2+
3+
from __future__ import (
4+
print_function,
5+
unicode_literals,
6+
absolute_import,
7+
division)
8+
9+
from pusher.client import Client
10+
from pusher.http import POST, Request, request_method
11+
from pusher.util import ensure_text
12+
413

514
DEFAULT_HOST = "nativepush-cluster1.pusher.com"
615
RESTRICTED_GCM_KEYS = ['to', 'registration_ids']
@@ -9,17 +18,19 @@
918
GCM_TTL = 241920
1019
WEBHOOK_LEVELS = ['INFO', 'DEBUG', '']
1120

21+
1222
class NotificationClient(Client):
13-
def __init__(self, app_id, key, secret, ssl=True, host=None, port=None, timeout=5, cluster=None,
14-
json_encoder=None, json_decoder=None, backend=None, **backend_options):
23+
def __init__(
24+
self, app_id, key, secret, ssl=True, host=None, port=None,
25+
timeout=5, cluster=None, json_encoder=None, json_decoder=None,
26+
backend=None, **backend_options):
1527
super(NotificationClient, self).__init__(
16-
app_id, key, secret, ssl,
17-
host, port, timeout, cluster,
18-
json_encoder, json_decoder, backend,
19-
**backend_options)
28+
app_id, key, secret, ssl, host, port, timeout, cluster,
29+
json_encoder, json_decoder, backend, **backend_options)
2030

2131
if host:
2232
self._host = ensure_text(host, "host")
33+
2334
else:
2435
self._host = DEFAULT_HOST
2536

@@ -36,8 +47,10 @@ def notify(self, interests, notification):
3647
raise TypeError("Notification must be a dictionary")
3748

3849
params = {
39-
'interests': interests,
40-
}
50+
'interests': interests}
51+
4152
params.update(notification)
42-
path = "/%s/%s/apps/%s/notifications" % (API_PREFIX, API_VERSION, self.app_id)
53+
path = "/%s/%s/apps/%s/notifications" %
54+
(API_PREFIX, API_VERSION, self.app_id)
55+
4356
return Request(self, POST, path, params)

pusher/pusher_client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@
1313
join_attributes,
1414
data_to_string)
1515

16-
from pusher.http import GET, POST, Request, request_method
1716
from pusher.client import Client
17+
from pusher.http import GET, POST, Request, request_method
1818

1919
import collections
2020
import hashlib

0 commit comments

Comments
 (0)