执行 Ruff 安全自动修复
This commit is contained in:
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user