🎨 Apply black formatting

This commit is contained in:
远野千束(神羽) 2024-12-14 03:33:59 +08:00
parent 23f9a6dde4
commit 7b47606039
3 changed files with 15 additions and 10 deletions

View File

@ -84,7 +84,9 @@ def load_plugins(*plugin_dirs: str) -> set[Plugin]:
"""单文件加载"""
module_name = f"{path_to_module_name(Path(plugin_dir))}.{f[:-3]}"
elif os.path.isdir(path) and os.path.exists(os.path.join(path, "__init__.py")):
elif os.path.isdir(path) and os.path.exists(
os.path.join(path, "__init__.py")
):
"""包加载"""
module_name = path_to_module_name(path)

View File

@ -18,6 +18,7 @@ class Plugin(BaseModel):
metadata: "PluginMeta" | None
"""
name: str
"""包名称 例如marsho_test"""
module: ModuleType
@ -27,6 +28,7 @@ class Plugin(BaseModel):
metadata: "PluginMetadata" | None = None
""""""
class PluginMetadata(BaseModel):
"""
Marsho 插件 对象元数据
@ -48,6 +50,7 @@ class PluginMetadata(BaseModel):
extra: dict[str, Any]
额外信息自定义键值对
"""
name: str
description: str = ""
usage: str = ""