Skip to content

Commit 9649584

Browse files
committed
pep8
1 parent 8aec4a5 commit 9649584

5 files changed

Lines changed: 13 additions & 10 deletions

File tree

stream/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ def connect(api_key=None, api_secret=None, app_id=None, version='v1.0', timeout=
1717
1818
:param api_key: your api key or heroku url
1919
:param api_secret: the api secret
20-
:param app_id: the site id (used for listening to feed changes)
20+
:param app_id: the app id (used for listening to feed changes)
2121
'''
2222
from stream.client import StreamClient
2323
stream_url = os.environ.get('STREAM_URL')

stream/client.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -69,11 +69,11 @@ def get_default_params(self):
6969
'''
7070
params = dict(api_key=self.api_key)
7171
return params
72-
72+
7373
def get_full_url(self, relative_url):
7474
url = self.base_url + self.version + '/' + relative_url
7575
return url
76-
76+
7777
def get_user_agent(self):
7878
from stream import __version__
7979
agent = 'stream-javascript-client-%s' % __version__
@@ -108,7 +108,7 @@ def raise_exception(self, result, status_code):
108108
if exception_fields is not None:
109109
errors = []
110110
for field, errors in exception_fields.items():
111-
errors.append('Field "%s" errors: %s' %
111+
errors.append('Field "%s" errors: %s' %
112112
(field, repr(errors)))
113113
error_message = '\n'.join(errors)
114114
error_code = result.get('code')

stream/feed.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ def __init__(self, client, feed_slug, user_id, token):
1717
self.user_id = user_id
1818
self.id = '%s:%s' % (feed_slug, user_id)
1919
self.token = token
20-
20+
2121
self.feed_url = 'feed/%s/' % self.id.replace(':', '/')
2222
self.feed_together = self.id.replace(':', '')
2323
self.signature = self.feed_together + ' ' + self.token
@@ -83,7 +83,7 @@ def remove_activity(self, activity_id=None, foreign_id=None):
8383
result = self.client.delete(
8484
url, signature=self.signature, params=params)
8585
return result
86-
86+
8787
def get(self, **params):
8888
'''
8989
Get the activities in this feed
@@ -119,7 +119,7 @@ def follow(self, target_feed_slug, target_user_id):
119119
response = self.client.post(
120120
url, data=data, signature=self.signature)
121121
return response
122-
122+
123123
def unfollow(self, target_feed_slug, target_user_id):
124124
'''
125125
Unfollow the given feed

stream/signing.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,11 @@
22
import hashlib
33
import base64
44

5+
56
def b64_encode(s):
67
return base64.urlsafe_b64encode(s).strip(b'=')
78

9+
810
def sign(api_secret, feed_id):
911
'''
1012
Base64 encoded sha1 signature

stream/tests.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,13 +44,14 @@ def test_heroku(self):
4444
self.assertEqual(client.api_key, 'thierry')
4545
self.assertEqual(client.api_secret, 'pass')
4646
self.assertEqual(client.site_id, '1')
47-
47+
4848
def test_heroku_real(self):
4949
url = 'https://bvt88g4kvc63:twc5ywfste5bm2ngqkzs7ukxk3pn96yweghjrxcmcrarnt3j4dqj3tucbhym5wfd@getstream.io/?app=669'
5050
os.environ['STREAM_URL'] = url
5151
client = stream.connect()
5252
self.assertEqual(client.api_key, 'bvt88g4kvc63')
53-
self.assertEqual(client.api_secret, 'twc5ywfste5bm2ngqkzs7ukxk3pn96yweghjrxcmcrarnt3j4dqj3tucbhym5wfd')
53+
self.assertEqual(
54+
client.api_secret, 'twc5ywfste5bm2ngqkzs7ukxk3pn96yweghjrxcmcrarnt3j4dqj3tucbhym5wfd')
5455
self.assertEqual(client.site_id, '669')
5556

5657
def test_heroku_overwrite(self):
@@ -386,7 +387,7 @@ def test_uniqueness_foreign_id(self):
386387
self.assertEqual(activities[0]['foreign_id'], 'tweet:11')
387388
self.assertDatetimeAlmostEqual(activities[0]['time'], utcnow)
388389
self.assertNotEqual(activities[1]['foreign_id'], 'tweet:11')
389-
390+
390391
def test_time_ordering(self):
391392
'''
392393
datetime.datetime.utcnow() is our recommended approach

0 commit comments

Comments
 (0)