依赖注入示例
This commit is contained in:
@@ -5,7 +5,7 @@ from importlib.metadata import version
|
||||
|
||||
import click
|
||||
|
||||
from astrbot.base import LOGO
|
||||
from astrbot_api import LOGO
|
||||
|
||||
from .commands import conf, init, plug, run
|
||||
|
||||
|
||||
@@ -3,8 +3,11 @@ import shutil
|
||||
from pathlib import Path
|
||||
|
||||
import click
|
||||
from astrbot_api.abc import IAstrbotPaths
|
||||
|
||||
from astrbot.base import AstrbotPaths
|
||||
from astrbot_sdk import sync_base_container
|
||||
|
||||
AstrbotPaths: type[IAstrbotPaths] = sync_base_container.get(type[IAstrbotPaths])
|
||||
|
||||
from ..utils import (
|
||||
PluginStatus,
|
||||
|
||||
@@ -2,9 +2,11 @@ import warnings
|
||||
from pathlib import Path
|
||||
|
||||
import click
|
||||
from astrbot_api.abc import IAstrbotPaths
|
||||
|
||||
from astrbot.base import AstrbotPaths
|
||||
from astrbot_sdk import sync_base_container
|
||||
|
||||
AstrbotPaths = sync_base_container.get(type[IAstrbotPaths])
|
||||
|
||||
def check_astrbot_root(path: str | Path) -> bool:
|
||||
"""检查路径是否为 AstrBot 根目录"""
|
||||
|
||||
Reference in New Issue
Block a user