Skip to content

Commit

Permalink
Merge pull request #63 from kastaid/dev
Browse files Browse the repository at this point in the history
update
  • Loading branch information
illvart authored Dec 20, 2023
2 parents d563b9e + fbe3b5a commit 1b3a77c
Show file tree
Hide file tree
Showing 5 changed files with 44 additions and 29 deletions.
3 changes: 0 additions & 3 deletions getter/core/base_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
AccessTokenExpiredError,
AccessTokenInvalidError,
)
from telethon.network.connection.tcpabridged import ConnectionTcpAbridged
from telethon.sessions.abstract import Session
from telethon.sessions.string import CURRENT_VERSION, StringSession
from telethon.tl import functions as fun, types as typ
Expand Down Expand Up @@ -62,8 +61,6 @@ def __init__(
kwargs["api_id"] = api_id
kwargs["api_hash"] = api_hash
kwargs["base_logger"] = TelethonLogger
kwargs["connection"] = ConnectionTcpAbridged
kwargs["connection_retries"] = None
kwargs["auto_reconnect"] = True
super().__init__(session, **kwargs)
self._event_builders = ReverseList()
Expand Down
4 changes: 2 additions & 2 deletions getter/core/patched/message.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ async def eor(
) -> typing.Optional[typing.Union[typ.Message, typing.Sequence[typ.messages.AffectedMessages]]]:
if self is None:
return
_ = args.get("reply_to", None)
_ = args.get("reply_to")
reply_to = _ if _ else (self.reply_to_msg_id or (self if force_reply else None))
is_file = "file" in args and args.get("file", "") and not self.media
for arg in (
Expand Down Expand Up @@ -198,7 +198,7 @@ async def sod(
if self is None:
return
chat_id = chat_id or self.chat_id
_ = args.get("reply_to", None)
_ = args.get("reply_to")
reply_to = _ if _ else (self.reply_to_msg_id or (self if force_reply else None))
is_file = "file" in args and args.get("file", "") and not self.media
for arg in (
Expand Down
12 changes: 6 additions & 6 deletions requirements-dev.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
black==23.1.0
black==23.11.0
isort==5.12.0
flake8==5.0.4
flake8-builtins==2.1.0
flake8-simplify==0.19.3
flake8-comprehensions==3.10.1
flake8-bugbear==23.3.12
flake8==6.1.0
flake8-builtins==2.2.0
flake8-simplify==0.21.0
flake8-comprehensions==3.14.0
flake8-bugbear==23.12.2
flake8-pie==0.16.0
8 changes: 4 additions & 4 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ python-dotenv==1.0.0
https://github.com/kastaid/Telethon/archive/main.tar.gz
cryptg==0.4.0
pytz==2022.7
psutil==5.9.6
psutil==5.9.7
heroku3==5.2.1
GitPython==3.1.40
psycopg2-binary==2.9.6
Expand All @@ -14,14 +14,14 @@ asyncache==0.3.1
aiofiles==23.2.1
aiocsv==1.2.5
async-timeout==4.0.3
aiohttp[speedups]==3.9.0
aiohttp[speedups]==3.9.1
Markdown==3.5.1
beautifulsoup4==4.12.2
emoji==2.8.0
emoji==2.9.0
validators==0.22.0
telegraph==2.2.0
requests==2.31.0
lottie==0.7.0
Pillow==10.1.0
CairoSVG==2.7.1
uvloop==0.17.0
uvloop==0.19.0
46 changes: 32 additions & 14 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -27,20 +27,38 @@ max-line-length = 120
select = E,F,W,B,C,I,T,S,A,N,P
ignore =
# https://flake8.pycqa.org/en/latest/user/error-codes.html
E201, # Whitespace after '('
E202, # Whitespace before ')'
E203, # Whitespace before ':'
E266, # Too many leading '#' for block comment
E501, # Line too long (82 > 79 characters)
W503, # Line break occurred before a binary operator
C901, # Function is too complex
E302, # Expected 2 blank lines, found 0
F403, # 'from module import *' used; unable to detect undefined names
SIM905, # Split string directly if only constants are used
PIE786, # precise-exception-handlers
PIE801, # prefer-simple-return
PIE803, # prefer-logging-interpolation
SIM105 # Use 'contextlib.suppress(BaseException)'
# Whitespace after '('
E201,
# Whitespace before ')'
E202,
# Whitespace before ':'
E203,
# Too many leading '#' for block comment
E266,
# Line too long (82 > 79 characters)
E501,
# Line break occurred before a binary operator
W503,
# Function is too complex
C901,
# Expected 2 blank lines, found 0
E302,
# 'from module import *' used; unable to detect undefined names
F403,
# Split string directly if only constants are used
SIM905,
# precise-exception-handlers
PIE786,
# prefer-simple-return
PIE801,
# prefer-logging-interpolation
PIE803,
# Use 'contextlib.suppress(BaseException)'
SIM105,
# Unnecessary dict comprehension - rewrite using dict()
C416,
# Star-arg unpacking after a keyword argument is strongly discouraged
B026
exclude =
.git,
__pycache__,
Expand Down

0 comments on commit 1b3a77c

Please sign in to comment.