Skip to content

Commit ae7e39e

Browse files
committed
Apply the latest black formatter
1 parent 6636b39 commit ae7e39e

File tree

10 files changed

+38
-12
lines changed

10 files changed

+38
-12
lines changed

slack/rtm/client.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -569,7 +569,7 @@ async def _wait_exponentially(self, exception, max_wait_time=300):
569569
"""
570570
wait_time = exception.response.get("headers", {}).get(
571571
"Retry-After",
572-
min((2 ** self._connection_attempts) + random.random(), max_wait_time),
572+
min((2**self._connection_attempts) + random.random(), max_wait_time),
573573
)
574574
self._logger.debug("Waiting %s seconds before reconnecting.", wait_time)
575575
await asyncio.sleep(float(wait_time))
@@ -580,7 +580,8 @@ def _close_websocket(self) -> List[Future]:
580580
close_method = getattr(self._websocket, "close", None)
581581
if callable(close_method):
582582
future = asyncio.ensure_future(
583-
close_method(), loop=self._event_loop, # skipcq: PYL-E1102
583+
close_method(),
584+
loop=self._event_loop, # skipcq: PYL-E1102
584585
)
585586
futures.append(future)
586587
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/objects.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -558,7 +558,9 @@ def parse(cls, config: Union["DispatchActionConfig", dict]):
558558
return None
559559

560560
def __init__(
561-
self, *, trigger_actions_on: Optional[list] = None,
561+
self,
562+
*,
563+
trigger_actions_on: Optional[list] = None,
562564
):
563565
"""
564566
Determines when a plain-text input element will return a block_actions interaction payload.

slack/web/classes/views.py

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

154154
def __init__(
155-
self, *, values: Dict[str, Dict[str, Union[dict, "ViewStateValue"]]],
155+
self,
156+
*,
157+
values: Dict[str, Dict[str, Union[dict, "ViewStateValue"]]],
156158
):
157159
value_objects: Dict[str, Dict[str, ViewStateValue]] = {}
158160
new_state_values = copy.copy(values)

slack/webhook/client.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,10 @@ def _perform_http_request(
147147
charset = e.headers.get_content_charset() or "utf-8"
148148
body: str = e.read().decode(charset) # read the response body here
149149
resp = WebhookResponse(
150-
url=url, status_code=e.code, body=body, headers=e.headers,
150+
url=url,
151+
status_code=e.code,
152+
body=body,
153+
headers=e.headers,
151154
)
152155
if e.code == 429:
153156
# 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)