Skip to content

Commit

Permalink
fix: linting
Browse files Browse the repository at this point in the history
  • Loading branch information
sgratzl committed Mar 21, 2023
1 parent 78b2018 commit c44048b
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
4 changes: 2 additions & 2 deletions .pylintrc
Original file line number Diff line number Diff line change
Expand Up @@ -414,7 +414,7 @@ max-attributes=20
max-bool-expr=5

# Maximum number of branch for function / method body
max-branches=12
max-branches=15

# Maximum number of locals for function / method body
max-locals=15
Expand Down Expand Up @@ -475,4 +475,4 @@ known-third-party=enchant

# Exceptions that will emit a warning when being caught. Defaults to
# "Exception"
overgeneral-exceptions=Exception
overgeneral-exceptions=builtins.Exception
2 changes: 1 addition & 1 deletion slack_cleaner2/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ def _delete_files(slack: SlackCleaner, args: Any):
condition = and_(pred)
total = 0

if args.channel or args.group or args.direct or args.mpdirect:
if args.channel or args.group or args.direct or args.mpdirect:
channels = _channels(slack, args)
for channel in channels:
with slack.log.group(channel.name):
Expand Down
14 changes: 7 additions & 7 deletions slack_cleaner2/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -726,8 +726,8 @@ def list(
:rtype: SlackFile
"""

after = _parse_time(after, slack.log, as_int = True)
before = _parse_time(before, slack.log, as_int = True)
after = _parse_time(after, slack.log, as_int=True)
before = _parse_time(before, slack.log, as_int=True)

if isinstance(user, SlackUser):
user = user.id
Expand Down Expand Up @@ -777,7 +777,7 @@ def download_response(self, **kwargs) -> Response:
:rtype: Response
"""
headers = {"Authorization": "Bearer " + self._slack.token}
return requests.get(self.json["url_private_download"], headers=headers, **kwargs)
return requests.get(self.json["url_private_download"], headers=headers, timeout=10, **kwargs)

def download_json(self) -> JSONDict:
"""
Expand Down Expand Up @@ -1322,8 +1322,8 @@ def safe_paging_api(self, fun: Callable, attr: str, scopes: Optional[List[str]]
def list_paging_page():
if not next_page:
# initial call
return fun(dict(count=limit))
return fun(dict(page=next_page, count=limit))
return fun({"count": limit})
return fun({"page": next_page, "count": limit})

while True:
page, meta = self.safe_api(list_paging_page, [attr, "paging"], [[], {}], scopes, method)
Expand Down Expand Up @@ -1356,8 +1356,8 @@ def safe_paginated_api(self, fun: Callable, attr: str, scopes: Optional[List[str
def list_cursor_page():
if not next_cursor:
# initial call
return fun(dict(limit=limit))
return fun(dict(cursor=next_cursor, limit=limit))
return fun({"limit": limit})
return fun({"cursor": next_cursor, "limit": limit})

while True:
page, meta = self.safe_api(list_cursor_page, [attr, "response_metadata"], [[], {}], scopes, method)
Expand Down

0 comments on commit c44048b

Please sign in to comment.