зеркало из
https://github.com/viginum-datalab/twscrape.git
synced 2025-10-28 20:54:24 +02:00
fix lint
Этот коммит содержится в:
родитель
489e362e8c
Коммит
8acfe41bba
@ -28,7 +28,7 @@ dependencies = [
|
||||
|
||||
[project.optional-dependencies]
|
||||
dev = [
|
||||
"pyright>=1.1.359",
|
||||
"pyright>=1.1.369",
|
||||
"pytest-asyncio>=0.23.3",
|
||||
"pytest-cov>=4.1.0",
|
||||
"pytest-httpx>=0.28.0",
|
||||
|
||||
@ -7,8 +7,15 @@ from datetime import datetime
|
||||
|
||||
from .logger import logger
|
||||
|
||||
TWS_WAIT_EMAIL_CODE = [os.getenv("TWS_WAIT_EMAIL_CODE"), os.getenv("LOGIN_CODE_TIMEOUT"), 30]
|
||||
TWS_WAIT_EMAIL_CODE = [int(x) for x in TWS_WAIT_EMAIL_CODE if x is not None][0]
|
||||
|
||||
def env_int(key: str | list[str], default: int) -> int:
|
||||
key = [key] if isinstance(key, str) else key
|
||||
val = [os.getenv(k) for k in key]
|
||||
val = [int(x) for x in val if x is not None]
|
||||
return val[0] if val else default
|
||||
|
||||
|
||||
TWS_WAIT_EMAIL_CODE = env_int(["TWS_WAIT_EMAIL_CODE", "LOGIN_CODE_TIMEOUT"], 30)
|
||||
|
||||
|
||||
class EmailLoginError(Exception):
|
||||
|
||||
Загрузка…
x
Ссылка в новой задаче
Block a user