Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ dependencies = [
"nonebot-plugin-apscheduler>=0.5.0,<1.0.0",
"nonebot-plugin-localstore>=0.7.4,<1.0.0",
"nonebot-plugin-uninfo>=0.10.1,<1.0.0",

]

[project.urls]
Expand Down Expand Up @@ -90,7 +89,7 @@ extras = [
]
test = [
"nonebug>=0.4.3,<1.0.0",
"poethepoet>=0.42.0",
"poethepoet>=0.42.1",
"pytest-asyncio>=1.3.0,<1.4.0",
"pytest-cov>=7.0.0",
"pytest-xdist>=3.8.0,<4.0.0",
Expand All @@ -114,7 +113,7 @@ conflicts = [
]

[tool.uv.sources]
nonebug = { git = "https://github.com/nonebot/nonebug" }
nonebug = { git = "https://github.com/nonebot/nonebug", rev = "master" }

[tool.bumpversion]
tag = true
Expand Down
3 changes: 1 addition & 2 deletions src/nonebot_plugin_parser/helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,8 +101,7 @@ def file_seg(
"""文件 Seg"""
if not display_name:
display_name = file.name
if not display_name:
raise ValueError("文件名不能为空")

if pconfig.use_base64:
return File(raw=file.read_bytes(), name=display_name)
else:
Expand Down
4 changes: 3 additions & 1 deletion src/nonebot_plugin_parser/parsers/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from asyncio import Task
from pathlib import Path
from collections.abc import Callable, Coroutine
from typing_extensions import Unpack
from typing_extensions import Unpack, final

from .data import Platform, ParseResult, ParseResultKwargs
from ..config import pconfig as pconfig
Expand Down Expand Up @@ -83,9 +83,11 @@ def get_all_subclass(cls) -> list[type["BaseParser"]]:
"""获取所有已注册的 Parser 类"""
return cls._registry

@final
async def parse(self, keyword: str, searched: Match[str]) -> ParseResult:
return await self._handlers[keyword](self, searched)

@final
async def parse_with_redirect(
self,
url: str,
Expand Down
22 changes: 11 additions & 11 deletions uv.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading