执行 Ruff 安全自动修复

This commit is contained in:
yml2213
2026-08-31 10:28:14 +08:00
parent 2a1d27f953
commit b58c6b4357
145 changed files with 940 additions and 993 deletions
+3 -4
View File
@@ -1,6 +1,5 @@
"""代理模块使用的白名单适配器。"""
from typing import Optional
from .proxy_platforms import create_adapter
from .proxy_platforms.base import BaseWhitelistAdapter, _get_local_exit_ip
@@ -17,7 +16,7 @@ class DouyuWhitelistSyncer:
def __init__(
self,
platform: str = "xiequ",
credentials: Optional[dict] = None,
credentials: dict | None = None,
uid: str = "",
ukey: str = "",
):
@@ -28,7 +27,7 @@ class DouyuWhitelistSyncer:
self.platform = platform
self.credentials = credentials or {}
self._adapter: Optional[BaseWhitelistAdapter] = None
self._adapter: BaseWhitelistAdapter | None = None
if self.credentials:
self._adapter = create_adapter(platform, self.credentials)
@@ -38,5 +37,5 @@ class DouyuWhitelistSyncer:
return False, "未配置白名单凭据"
return self._adapter.sync_ip(ip)
def get_local_exit_ip(self) -> Optional[str]:
def get_local_exit_ip(self) -> str | None:
return _get_local_exit_ip()