Skip to content

Commit c16d476

Browse files
committed
reformat code using Black
1 parent 2f4d5d7 commit c16d476

17 files changed

Lines changed: 683 additions & 510 deletions

‎stream/__init__.py‎

Lines changed: 34 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,53 @@
11
import re
22
import os
33

4-
__author__ = 'Thierry Schellenbach'
5-
__copyright__ = 'Copyright 2014, Stream.io, Inc'
6-
__credits__ = ['Thierry Schellenbach, mellowmorning.com, @tschellenbach']
7-
__license__ = 'BSD-3-Clause'
8-
__version__ = '2.12.0'
9-
__maintainer__ = 'Thierry Schellenbach'
10-
__email__ = 'support@getstream.io'
11-
__status__ = 'Production'
4+
__author__ = "Thierry Schellenbach"
5+
__copyright__ = "Copyright 2014, Stream.io, Inc"
6+
__credits__ = ["Thierry Schellenbach, mellowmorning.com, @tschellenbach"]
7+
__license__ = "BSD-3-Clause"
8+
__version__ = "2.12.0"
9+
__maintainer__ = "Thierry Schellenbach"
10+
__email__ = "support@getstream.io"
11+
__status__ = "Production"
1212

1313

14-
def connect(api_key=None, api_secret=None, app_id=None, version='v1.0',
15-
timeout=3.0, location=None, base_url=None):
16-
'''
14+
def connect(
15+
api_key=None,
16+
api_secret=None,
17+
app_id=None,
18+
version="v1.0",
19+
timeout=3.0,
20+
location=None,
21+
base_url=None,
22+
):
23+
"""
1724
Returns a Client object
1825
1926
:param api_key: your api key or heroku url
2027
:param api_secret: the api secret
2128
:param app_id: the app id (used for listening to feed changes)
22-
'''
29+
"""
2330
from stream.client import StreamClient
24-
stream_url = os.environ.get('STREAM_URL')
31+
32+
stream_url = os.environ.get("STREAM_URL")
2533
# support for the heroku STREAM_URL syntax
2634
if stream_url and not api_key:
2735
pattern = re.compile(
28-
'https\:\/\/(\w+)\:(\w+)\@([\w-]*).*\?app_id=(\d+)', re.IGNORECASE)
36+
"https\:\/\/(\w+)\:(\w+)\@([\w-]*).*\?app_id=(\d+)", re.IGNORECASE
37+
)
2938
result = pattern.match(stream_url)
3039
if result and len(result.groups()) == 4:
3140
api_key, api_secret, location, app_id = result.groups()
32-
location = None if location in ('getstream', 'stream-io-api') else location
41+
location = None if location in ("getstream", "stream-io-api") else location
3342
else:
34-
raise ValueError('Invalid api key or heroku url')
43+
raise ValueError("Invalid api key or heroku url")
3544

36-
return StreamClient(api_key, api_secret, app_id, version, timeout,
37-
location=location, base_url=base_url)
45+
return StreamClient(
46+
api_key,
47+
api_secret,
48+
app_id,
49+
version,
50+
timeout,
51+
location=location,
52+
base_url=base_url,
53+
)

0 commit comments

Comments
 (0)