🚨 修复F824

This commit is contained in:
KimigaiiWuyi 2025-04-26 03:52:35 +08:00
parent 4ea3d9d6f8
commit cba02e666b
10 changed files with 1173 additions and 1101 deletions

View File

@ -11,6 +11,9 @@
"python.autoComplete.extraPaths": [ "python.autoComplete.extraPaths": [
"${workspaceFolder}/gsuid_core" "${workspaceFolder}/gsuid_core"
], ],
"flake8.args": [
"--max-line-length=120"
],
"isort.args": [ "isort.args": [
"--profile", "--profile",
"black" "black"
@ -18,5 +21,6 @@
"basedpyright.analysis.typeCheckingMode": "basic", "basedpyright.analysis.typeCheckingMode": "basic",
"basedpyright.analysis.extraPaths": [ "basedpyright.analysis.extraPaths": [
"${workspaceFolder}/gsuid_core" "${workspaceFolder}/gsuid_core"
] ],
"python.analysis.typeCheckingMode": "off"
} }

View File

@ -38,7 +38,6 @@ async def count_group_user():
@scheduler.scheduled_job('cron', hour='0', minute='0') @scheduler.scheduled_job('cron', hour='0', minute='0')
async def _u_scheduled_save_global_val_all(): async def _u_scheduled_save_global_val_all():
global bot_val
await save_all_global_val(1) await save_all_global_val(1)
gv.bot_val = {} gv.bot_val = {}
logger.success('[早柚核心] 状态已清空!') logger.success('[早柚核心] 状态已清空!')
@ -67,7 +66,11 @@ async def send_core_status_msg(bot: Bot, ev: Event):
else: else:
_day = None _day = None
logger.info('开始执行 早柚核心 [状态]') logger.info('开始执行 早柚核心 [状态]')
local_val = await gv.get_global_val(ev.real_bot_id, ev.bot_self_id, _day) local_val = await gv.get_global_val(
ev.real_bot_id,
ev.bot_self_id,
_day,
)
if ev.group_id: if ev.group_id:
_command = sum( _command = sum(

View File

@ -35,8 +35,6 @@ bot_val: BotVal = {}
def get_platform_val(bot_id: str, bot_self_id: str): def get_platform_val(bot_id: str, bot_self_id: str):
global bot_val
if bot_id not in bot_val: if bot_id not in bot_val:
bot_val[bot_id] = {} bot_val[bot_id] = {}
if bot_self_id not in bot_val[bot_id]: if bot_self_id not in bot_val[bot_id]:
@ -168,7 +166,6 @@ async def get_global_analysis(
async def load_all_global_val(): async def load_all_global_val():
global bot_val
today = datetime.date.today() today = datetime.date.today()
date_format = today.strftime("%Y_%d_%b") date_format = today.strftime("%Y_%d_%b")
@ -184,7 +181,6 @@ async def load_all_global_val():
async def save_all_global_val(day: int = 0): async def save_all_global_val(day: int = 0):
global bot_val
for bot_id in bot_val: for bot_id in bot_val:
for bot_self_id in bot_val[bot_id]: for bot_self_id in bot_val[bot_id]:
await save_global_val(bot_id, bot_self_id, day) await save_global_val(bot_id, bot_self_id, day)

View File

@ -182,7 +182,6 @@ if 'file' in logger_list:
async def read_log(): async def read_log():
global log_history
index = 0 index = 0
while True: while True:
if index <= len(log_history) - 1: if index <= len(log_history) - 1:

View File

@ -18,8 +18,6 @@ CACHE: Dict[float, Dict[str, Union[Path, str]]] = {}
def gs_cache(expire_time=3600): def gs_cache(expire_time=3600):
global CACHE
def wrapper(func): def wrapper(func):
is_coroutine = inspect.iscoroutinefunction(func) is_coroutine = inspect.iscoroutinefunction(func)

View File

@ -214,8 +214,6 @@ async def download_all_file(
URL: Optional[str] = None, URL: Optional[str] = None,
TAG: Optional[str] = None, TAG: Optional[str] = None,
): ):
global global_tag, global_url
if URL: if URL:
TAG, BASE_URL = TAG or '[Unknown]', URL TAG, BASE_URL = TAG or '[Unknown]', URL
else: else:

View File

@ -119,7 +119,6 @@ async def set_proxy_all_plugins(proxy: Optional[str] = None) -> List[str]:
async def refresh_list() -> List[str]: async def refresh_list() -> List[str]:
global plugins_list
refresh_list = [] refresh_list = []
async with aiohttp.ClientSession() as session: async with aiohttp.ClientSession() as session:
logger.trace(f'稍等...开始刷新插件列表, 地址: {plugins_lib}') logger.trace(f'稍等...开始刷新插件列表, 地址: {plugins_lib}')

2184
poetry.lock generated

File diff suppressed because it is too large Load Diff

View File

@ -52,7 +52,7 @@ pandas = "^2.2.3"
betterproto = ">=2.0.0b7" betterproto = ">=2.0.0b7"
[tool.poetry.group.dev.dependencies] [tool.poetry.group.dev.dependencies]
flake8 = "^6.0.0" flake8 = "^7.0.0"
black = "^22.12.0" black = "^22.12.0"
isort = "^5.11.4" isort = "^5.11.4"
pre-commit = "^2.21.0" pre-commit = "^2.21.0"
@ -67,9 +67,9 @@ core = "gsuid_core/core.py"
[tool.pdm.dev-dependencies] [tool.pdm.dev-dependencies]
dev = [ dev = [
"flake8<7.0.0,>=6.0.0", "flake8<8.0.0,>=7.0.0",
"black<23.0.0,>=22.12.0", "black<26.0.0,>=25.0.0",
"isort<6.0.0,>=5.11.4", "isort<7.0.0,>=6.0.0",
"pre-commit<3.0.0,>=2.21.0", "pre-commit<3.0.0,>=2.21.0",
"pycln<3.0.0,>=2.1.2", "pycln<3.0.0,>=2.1.2",
] ]

View File

@ -3,84 +3,85 @@
aioboto3==12.4.0 ; python_version >= "3.10" and python_version < "4.0" aioboto3==12.4.0 ; python_version >= "3.10" and python_version < "4.0"
aiobotocore[boto3]==2.12.3 ; python_version >= "3.10" and python_version < "4.0" aiobotocore[boto3]==2.12.3 ; python_version >= "3.10" and python_version < "4.0"
aiofiles==24.1.0 ; python_version >= "3.10" and python_version < "4.0" aiofiles==24.1.0 ; python_version >= "3.10" and python_version < "4.0"
aiohappyeyeballs==2.4.4 ; python_version >= "3.10" and python_version < "4.0" aiohappyeyeballs==2.6.1 ; python_version >= "3.10" and python_version < "4.0"
aiohttp==3.11.11 ; python_version >= "3.10" and python_version < "4.0" aiohttp==3.11.18 ; python_version >= "3.10" and python_version < "4.0"
aioitertools==0.12.0 ; python_version >= "3.10" and python_version < "4.0" aioitertools==0.12.0 ; python_version >= "3.10" and python_version < "4.0"
aiosignal==1.3.2 ; python_version >= "3.10" and python_version < "4.0" aiosignal==1.3.2 ; python_version >= "3.10" and python_version < "4.0"
aiosqlite==0.21.0 ; python_version >= "3.10" and python_version < "4.0" aiosqlite==0.21.0 ; python_version >= "3.10" and python_version < "4.0"
annotated-types==0.7.0 ; python_version >= "3.10" and python_version < "4.0" annotated-types==0.7.0 ; python_version >= "3.10" and python_version < "4.0"
anyio==4.8.0 ; python_version >= "3.10" and python_version < "4.0" anyio==4.9.0 ; python_version >= "3.10" and python_version < "4.0"
apscheduler==3.11.0 ; python_version >= "3.10" and python_version < "4.0" apscheduler==3.11.0 ; python_version >= "3.10" and python_version < "4.0"
async-timeout==4.0.3 ; python_version >= "3.10" and python_version < "4.0" async-timeout==4.0.3 ; python_version >= "3.10" and python_version < "4.0"
attrs==25.1.0 ; python_version >= "3.10" and python_version < "4.0" attrs==25.3.0 ; python_version >= "3.10" and python_version < "4.0"
bcrypt==4.0.1 ; python_version >= "3.10" and python_version < "4.0" bcrypt==4.0.1 ; python_version >= "3.10" and python_version < "4.0"
beautifulsoup4==4.13.1 ; python_version >= "3.10" and python_version < "4.0" beautifulsoup4==4.13.4 ; python_version >= "3.10" and python_version < "4.0"
betterproto==2.0.0b7 ; python_version >= "3.10" and python_version < "4.0" betterproto==2.0.0b7 ; python_version >= "3.10" and python_version < "4.0"
boto3==1.34.69 ; python_version >= "3.10" and python_version < "4.0" boto3==1.34.69 ; python_version >= "3.10" and python_version < "4.0"
botocore==1.34.69 ; python_version >= "3.10" and python_version < "4.0" botocore==1.34.69 ; python_version >= "3.10" and python_version < "4.0"
casbin==1.38.0 ; python_version >= "3.10" and python_version < "4.0" casbin==1.41.0 ; python_version >= "3.10" and python_version < "4.0"
certifi==2025.1.31 ; python_version >= "3.10" and python_version < "4.0" certifi==2025.1.31 ; python_version >= "3.10" and python_version < "4.0"
click==8.1.8 ; python_version >= "3.10" and python_version < "4.0" click==8.1.8 ; python_version >= "3.10" and python_version < "4.0"
colorama==0.4.6 ; python_version >= "3.10" and python_version < "4.0" colorama==0.4.6 ; python_version >= "3.10" and python_version < "4.0"
dnspython==2.7.0 ; python_version >= "3.10" and python_version < "4.0" dnspython==2.7.0 ; python_version >= "3.10" and python_version < "4.0"
email-validator==2.2.0 ; python_version >= "3.10" and python_version < "4.0" email-validator==2.2.0 ; python_version >= "3.10" and python_version < "4.0"
exceptiongroup==1.2.2 ; python_version >= "3.10" and python_version < "3.11" exceptiongroup==1.2.2 ; python_version >= "3.10" and python_version < "3.11"
fastapi-amis-admin==0.7.2 ; python_version >= "3.10" and python_version < "4.0" fastapi-amis-admin==0.7.3 ; python_version >= "3.10" and python_version < "4.0"
fastapi-user-auth==0.7.3 ; python_version >= "3.10" and python_version < "4.0" fastapi-user-auth==0.7.3 ; python_version >= "3.10" and python_version < "4.0"
fastapi==0.112.2 ; python_version >= "3.10" and python_version < "4.0" fastapi==0.112.2 ; python_version >= "3.10" and python_version < "4.0"
frozenlist==1.5.0 ; python_version >= "3.10" and python_version < "4.0" frozenlist==1.6.0 ; python_version >= "3.10" and python_version < "4.0"
gitdb==4.0.12 ; python_version >= "3.10" and python_version < "4.0" gitdb==4.0.12 ; python_version >= "3.10" and python_version < "4.0"
gitpython==3.1.44 ; python_version >= "3.10" and python_version < "4.0" gitpython==3.1.44 ; python_version >= "3.10" and python_version < "4.0"
greenlet==3.1.1 ; python_version < "3.14" and (platform_machine == "aarch64" or platform_machine == "ppc64le" or platform_machine == "x86_64" or platform_machine == "amd64" or platform_machine == "AMD64" or platform_machine == "win32" or platform_machine == "WIN32") and python_version >= "3.10" greenlet==3.2.1 ; python_version < "3.14" and (platform_machine == "aarch64" or platform_machine == "ppc64le" or platform_machine == "x86_64" or platform_machine == "amd64" or platform_machine == "AMD64" or platform_machine == "win32" or platform_machine == "WIN32") and python_version >= "3.10"
grpclib==0.4.7 ; python_version >= "3.10" and python_version < "4.0" grpclib==0.4.7 ; python_version >= "3.10" and python_version < "4.0"
h11==0.14.0 ; python_version >= "3.10" and python_version < "4.0" h11==0.16.0 ; python_version >= "3.10" and python_version < "4.0"
h2==4.2.0 ; python_version >= "3.10" and python_version < "4.0" h2==4.2.0 ; python_version >= "3.10" and python_version < "4.0"
hpack==4.1.0 ; python_version >= "3.10" and python_version < "4.0" hpack==4.1.0 ; python_version >= "3.10" and python_version < "4.0"
httpcore==1.0.7 ; python_version >= "3.10" and python_version < "4.0" httpcore==1.0.9 ; python_version >= "3.10" and python_version < "4.0"
httpx==0.28.1 ; python_version >= "3.10" and python_version < "4.0" httpx==0.28.1 ; python_version >= "3.10" and python_version < "4.0"
hyperframe==6.1.0 ; python_version >= "3.10" and python_version < "4.0" hyperframe==6.1.0 ; python_version >= "3.10" and python_version < "4.0"
idna==3.10 ; python_version >= "3.10" and python_version < "4.0" idna==3.10 ; python_version >= "3.10" and python_version < "4.0"
jinja2==3.1.5 ; python_version >= "3.10" and python_version < "4.0" jinja2==3.1.6 ; python_version >= "3.10" and python_version < "4.0"
jmespath==1.0.1 ; python_version >= "3.10" and python_version < "4.0" jmespath==1.0.1 ; python_version >= "3.10" and python_version < "4.0"
loguru==0.7.3 ; python_version >= "3.10" and python_version < "4.0" loguru==0.7.3 ; python_version >= "3.10" and python_version < "4.0"
lxml==5.3.0 ; python_version >= "3.10" and python_version < "4.0" lxml==5.4.0 ; python_version >= "3.10" and python_version < "4.0"
markupsafe==3.0.2 ; python_version >= "3.10" and python_version < "4.0" markupsafe==3.0.2 ; python_version >= "3.10" and python_version < "4.0"
mpmath==1.3.0 ; python_version >= "3.10" and python_version < "4.0" mpmath==1.3.0 ; python_version >= "3.10" and python_version < "4.0"
msgspec==0.19.0 ; python_version >= "3.10" and python_version < "4.0" msgspec==0.19.0 ; python_version >= "3.10" and python_version < "4.0"
multidict==6.1.0 ; python_version >= "3.10" and python_version < "4.0" multidict==6.4.3 ; python_version >= "3.10" and python_version < "4.0"
numpy==2.2.2 ; python_version >= "3.10" and python_version <= "3.11" or python_version >= "3.12" and python_version < "4.0" numpy==2.2.5 ; python_version >= "3.10" and python_version <= "3.11" or python_version >= "3.12" and python_version < "4.0"
pandas==2.2.3 ; python_version >= "3.10" and python_version < "4.0" pandas==2.2.3 ; python_version >= "3.10" and python_version < "4.0"
passlib==1.7.4 ; python_version >= "3.10" and python_version < "4.0" passlib==1.7.4 ; python_version >= "3.10" and python_version < "4.0"
pillow==11.1.0 ; python_version >= "3.10" and python_version < "4.0" pillow==11.2.1 ; python_version >= "3.10" and python_version < "4.0"
propcache==0.2.1 ; python_version >= "3.10" and python_version < "4.0" propcache==0.3.1 ; python_version >= "3.10" and python_version < "4.0"
psutil==6.1.1 ; python_version >= "3.10" and python_version < "4.0" psutil==6.1.1 ; python_version >= "3.10" and python_version < "4.0"
pydantic-core==2.20.1 ; python_version >= "3.10" and python_version < "4.0" pydantic-core==2.20.1 ; python_version >= "3.10" and python_version < "4.0"
pydantic-settings==2.7.1 ; python_version >= "3.10" and python_version < "4.0" pydantic-settings==2.9.1 ; python_version >= "3.10" and python_version < "4.0"
pydantic==2.8.2 ; python_version >= "3.10" and python_version < "4.0" pydantic==2.8.2 ; python_version >= "3.10" and python_version < "4.0"
pypng==0.20220715.0 ; python_version >= "3.10" and python_version < "4.0" pypng==0.20220715.0 ; python_version >= "3.10" and python_version < "4.0"
python-dateutil==2.9.0.post0 ; python_version >= "3.10" and python_version < "4.0" python-dateutil==2.9.0.post0 ; python_version >= "3.10" and python_version < "4.0"
python-dotenv==1.0.1 ; python_version >= "3.10" and python_version < "4.0" python-dotenv==1.1.0 ; python_version >= "3.10" and python_version < "4.0"
python-multipart==0.0.20 ; python_version >= "3.10" and python_version < "4.0" python-multipart==0.0.20 ; python_version >= "3.10" and python_version < "4.0"
pytz==2024.2 ; python_version >= "3.10" and python_version < "4.0" pytz==2024.2 ; python_version >= "3.10" and python_version < "4.0"
qrcode[pil]==7.4.2 ; python_version >= "3.10" and python_version < "4.0" qrcode[pil]==7.4.2 ; python_version >= "3.10" and python_version < "4.0"
s3transfer==0.10.4 ; python_version >= "3.10" and python_version < "4.0" s3transfer==0.10.4 ; python_version >= "3.10" and python_version < "4.0"
setuptools==75.8.0 ; python_version >= "3.10" and python_version < "4.0" setuptools==79.0.1 ; python_version >= "3.10" and python_version < "4.0"
simpleeval==1.0.3 ; python_version >= "3.10" and python_version < "4.0" simpleeval==1.0.3 ; python_version >= "3.10" and python_version < "4.0"
six==1.17.0 ; python_version >= "3.10" and python_version < "4.0" six==1.17.0 ; python_version >= "3.10" and python_version < "4.0"
smmap==5.0.2 ; python_version >= "3.10" and python_version < "4.0" smmap==5.0.2 ; python_version >= "3.10" and python_version < "4.0"
sniffio==1.3.1 ; python_version >= "3.10" and python_version < "4.0" sniffio==1.3.1 ; python_version >= "3.10" and python_version < "4.0"
soupsieve==2.6 ; python_version >= "3.10" and python_version < "4.0" soupsieve==2.7 ; python_version >= "3.10" and python_version < "4.0"
sqlalchemy-database==0.1.2 ; python_version >= "3.10" and python_version < "4.0" sqlalchemy-database==0.1.2 ; python_version >= "3.10" and python_version < "4.0"
sqlalchemy==2.0.37 ; python_version >= "3.10" and python_version < "4.0" sqlalchemy==2.0.40 ; python_version >= "3.10" and python_version < "4.0"
sqlmodel==0.0.22 ; python_version >= "3.10" and python_version < "4.0" sqlmodel==0.0.24 ; python_version >= "3.10" and python_version < "4.0"
starlette==0.38.6 ; python_version >= "3.10" and python_version < "4.0" starlette==0.38.6 ; python_version >= "3.10" and python_version < "4.0"
toml==0.10.2 ; python_version >= "3.10" and python_version < "4.0" toml==0.10.2 ; python_version >= "3.10" and python_version < "4.0"
typing-extensions==4.12.2 ; python_version >= "3.10" and python_version < "4.0" typing-extensions==4.13.2 ; python_version >= "3.10" and python_version < "4.0"
tzdata==2025.1 ; python_version >= "3.10" and python_version < "4.0" typing-inspection==0.4.0 ; python_version >= "3.10" and python_version < "4.0"
tzlocal==5.2 ; python_version >= "3.10" and python_version < "4.0" tzdata==2025.2 ; python_version >= "3.10" and python_version < "4.0"
tzlocal==5.3.1 ; python_version >= "3.10" and python_version < "4.0"
urllib3==1.26.20 ; python_version >= "3.10" and python_version < "4.0" urllib3==1.26.20 ; python_version >= "3.10" and python_version < "4.0"
uvicorn==0.34.0 ; python_version >= "3.10" and python_version < "4.0" uvicorn==0.34.2 ; python_version >= "3.10" and python_version < "4.0"
websockets==14.2 ; python_version >= "3.10" and python_version < "4.0" websockets==15.0.1 ; python_version >= "3.10" and python_version < "4.0"
win32-setctime==1.2.0 ; python_version >= "3.10" and python_version < "4.0" and sys_platform == "win32" win32-setctime==1.2.0 ; python_version >= "3.10" and python_version < "4.0" and sys_platform == "win32"
wrapt==1.17.2 ; python_version >= "3.10" and python_version < "4.0" wrapt==1.17.2 ; python_version >= "3.10" and python_version < "4.0"
yarl==1.18.3 ; python_version >= "3.10" and python_version < "4.0" yarl==1.20.0 ; python_version >= "3.10" and python_version < "4.0"