Skip to content

Commit 70ae6f5

Browse files
committed
up
1 parent 150e58e commit 70ae6f5

File tree

2 files changed

+13
-7
lines changed

2 files changed

+13
-7
lines changed

nonebot_plugin_picmenu_next/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
from .data_source import refresh_infos
1313
from .templates import load_builtin_templates
1414

15-
__version__ = "0.1.6"
15+
__version__ = "0.1.6.post1"
1616
__plugin_meta__ = PluginMetadata(
1717
name="PicMenu Next",
1818
description="新一代的图片帮助插件",

nonebot_plugin_picmenu_next/data_source/collect.py

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
from pathlib import Path
88

99
from cookit.loguru import warning_suppress
10-
from cookit.pyd import type_validate_json, type_validate_python
10+
from cookit.pyd import model_fields_set, type_validate_json, type_validate_python
1111
from nonebot import logger
1212
from nonebot.plugin import Plugin
1313

@@ -26,8 +26,12 @@ def normalize_metadata_user(info: str, allow_multi: bool = False) -> str:
2626

2727
@lru_cache
2828
def get_dist(module_name: str) -> Distribution | None:
29-
with warning_suppress(f"Unexpected error happened when getting info of package {module_name}"),\
30-
suppress(PackageNotFoundError): # fmt: skip
29+
with (
30+
warning_suppress(
31+
f"Unexpected error happened when getting info of package {module_name}",
32+
),
33+
suppress(PackageNotFoundError),
34+
):
3135
return distribution(module_name)
3236
if "." not in module_name:
3337
return None
@@ -37,8 +41,10 @@ def get_dist(module_name: str) -> Distribution | None:
3741

3842
@lru_cache
3943
def get_version_attr(module_name: str) -> str | None:
40-
with warning_suppress(f"Unexpected error happened when importing {module_name}"),\
41-
suppress(ImportError): # fmt: skip
44+
with (
45+
warning_suppress(f"Unexpected error happened when importing {module_name}"),
46+
suppress(ImportError),
47+
):
4248
m = importlib.import_module(module_name)
4349
if ver := getattr(m, "__version__", None):
4450
return ver
@@ -93,7 +99,7 @@ async def get_info_from_plugin(plugin: Plugin) -> PMNPluginInfo:
9399
)
94100

95101
pmn = (extra.pmn if extra else None) or PMNData()
96-
if ("hidden" not in pmn.model_fields_set) and meta and meta.type == "library":
102+
if ("hidden" not in model_fields_set(pmn)) and meta and meta.type == "library":
97103
pmn = PMNData(hidden=True)
98104

99105
logger.debug(f"Completed to get info of plugin {plugin.id_}")

0 commit comments

Comments
 (0)