Skip to content

Commit 8f8b207

Browse files
committed
Apply the latest black in Python 3.8.5
1 parent 5a20dea commit 8f8b207

File tree

10 files changed

+38
-12
lines changed

10 files changed

+38
-12
lines changed

slack/errors.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ def __init__(self, message, response):
3535

3636
class SlackClientNotConnectedError(SlackClientError):
3737
"""Error raised when attempting to send messages over the websocket when the
38-
connection is closed. """
38+
connection is closed."""
3939

4040

4141
class SlackObjectFormationError(SlackClientError):

slack/rtm/client.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -578,7 +578,8 @@ def _close_websocket(self) -> List[Future]:
578578
close_method = getattr(self._websocket, "close", None)
579579
if callable(close_method):
580580
future = asyncio.ensure_future(
581-
close_method(), loop=self._event_loop, # skipcq: PYL-E1102
581+
close_method(),
582+
loop=self._event_loop, # skipcq: PYL-E1102
582583
)
583584
futures.append(future)
584585
self._websocket = None

slack/signature/verifier.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,9 @@ def __init__(self, signing_secret: str, clock: Clock = Clock()):
2323
self.clock = clock
2424

2525
def is_valid_request(
26-
self, body: Union[str, bytes], headers: Dict[str, str],
26+
self,
27+
body: Union[str, bytes],
28+
headers: Dict[str, str],
2729
) -> bool:
2830
"""Verifies if the given signature is valid"""
2931
if headers is None:
@@ -36,7 +38,10 @@ def is_valid_request(
3638
)
3739

3840
def is_valid(
39-
self, body: Union[str, bytes], timestamp: str, signature: str,
41+
self,
42+
body: Union[str, bytes],
43+
timestamp: str,
44+
signature: str,
4045
) -> bool:
4146
"""Verifies if the given signature is valid"""
4247
if timestamp is None or signature is None:

slack/web/async_base_client.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,9 @@ async def api_call( # skipcq: PYL-R1710
111111
show_2020_01_deprecation(api_method)
112112

113113
return await self._send(
114-
http_verb=http_verb, api_url=api_url, req_args=req_args,
114+
http_verb=http_verb,
115+
api_url=api_url,
116+
req_args=req_args,
115117
)
116118

117119
async def _send(

slack/web/async_slack_response.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,9 @@ async def __anext__(self):
133133
self.req_args.update({"params": params})
134134

135135
response = await self._client._request( # skipcq: PYL-W0212
136-
http_verb=self.http_verb, api_url=self.api_url, req_args=self.req_args,
136+
http_verb=self.http_verb,
137+
api_url=self.api_url,
138+
req_args=self.req_args,
137139
)
138140

139141
self.data = response["data"]

slack/web/classes/blocks.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,10 @@ class DividerBlock(Block):
159159
type = "divider"
160160

161161
def __init__(
162-
self, *, block_id: Optional[str] = None, **others: dict,
162+
self,
163+
*,
164+
block_id: Optional[str] = None,
165+
**others: dict,
163166
):
164167
"""A content divider, like an <hr>, to split up different blocks inside of a message.
165168
https://api.slack.com/reference/block-kit/blocks#divider

slack/web/classes/views.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,9 @@ def _show_warning_about_unknown(cls, value):
159159
)
160160

161161
def __init__(
162-
self, *, values: Dict[str, Dict[str, Union[dict, "ViewStateValue"]]],
162+
self,
163+
*,
164+
values: Dict[str, Dict[str, Union[dict, "ViewStateValue"]]],
163165
):
164166
value_objects: Dict[str, Dict[str, ViewStateValue]] = {}
165167
new_state_values = copy.copy(values)

slack/webhook/client.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,9 @@ def _perform_http_request(
119119

120120
# NOTE: BAN-B310 is already checked above
121121
resp: HTTPResponse = urlopen( # skipcq: BAN-B310
122-
req, context=self.ssl, timeout=self.timeout,
122+
req,
123+
context=self.ssl,
124+
timeout=self.timeout,
123125
)
124126
charset: str = resp.headers.get_content_charset() or "utf-8"
125127
response_body: str = resp.read().decode(charset)
@@ -136,7 +138,10 @@ def _perform_http_request(
136138
charset = e.headers.get_content_charset()
137139
body: str = e.read().decode(charset) # read the response body here
138140
resp = WebhookResponse(
139-
url=url, status_code=e.code, body=body, headers=e.headers,
141+
url=url,
142+
status_code=e.code,
143+
body=body,
144+
headers=e.headers,
140145
)
141146
if e.code == 429:
142147
# for backward-compatibility with WebClient (v.2.5.0 or older)

slack/webhook/internal_utils.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@ def _build_body(original_body: Dict[str, any]) -> Dict[str, any]:
1414

1515

1616
def _build_request_headers(
17-
default_headers: Dict[str, str], additional_headers: Optional[Dict[str, str]],
17+
default_headers: Dict[str, str],
18+
additional_headers: Optional[Dict[str, str]],
1819
) -> Dict[str, str]:
1920
if default_headers is None and additional_headers is None:
2021
return {}

slack/webhook/webhook_response.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
class WebhookResponse:
22
def __init__(
3-
self, *, url: str, status_code: int, body: str, headers: dict,
3+
self,
4+
*,
5+
url: str,
6+
status_code: int,
7+
body: str,
8+
headers: dict,
49
):
510
self.api_url = url
611
self.status_code = status_code

0 commit comments

Comments
 (0)