noneflow[bot] 033c90dd74
Some checks failed
Code Coverage / Test Coverage (pydantic-v1, macos-latest, 3.10) (push) Waiting to run
Code Coverage / Test Coverage (pydantic-v1, macos-latest, 3.11) (push) Waiting to run
Code Coverage / Test Coverage (pydantic-v1, macos-latest, 3.12) (push) Waiting to run
Code Coverage / Test Coverage (pydantic-v1, macos-latest, 3.9) (push) Waiting to run
Code Coverage / Test Coverage (pydantic-v1, windows-latest, 3.10) (push) Waiting to run
Code Coverage / Test Coverage (pydantic-v1, windows-latest, 3.11) (push) Waiting to run
Code Coverage / Test Coverage (pydantic-v1, windows-latest, 3.12) (push) Waiting to run
Code Coverage / Test Coverage (pydantic-v1, windows-latest, 3.9) (push) Waiting to run
Code Coverage / Test Coverage (pydantic-v2, macos-latest, 3.10) (push) Waiting to run
Code Coverage / Test Coverage (pydantic-v2, macos-latest, 3.11) (push) Waiting to run
Code Coverage / Test Coverage (pydantic-v1, ubuntu-latest, 3.11) (push) Failing after 2s
Code Coverage / Test Coverage (pydantic-v2, macos-latest, 3.12) (push) Waiting to run
Code Coverage / Test Coverage (pydantic-v2, macos-latest, 3.9) (push) Waiting to run
Code Coverage / Test Coverage (pydantic-v2, windows-latest, 3.10) (push) Waiting to run
Code Coverage / Test Coverage (pydantic-v2, windows-latest, 3.11) (push) Waiting to run
Code Coverage / Test Coverage (pydantic-v2, windows-latest, 3.12) (push) Waiting to run
Code Coverage / Test Coverage (pydantic-v2, windows-latest, 3.9) (push) Waiting to run
Code Coverage / Test Coverage (pydantic-v1, ubuntu-latest, 3.12) (push) Failing after 6m59s
Code Coverage / Test Coverage (pydantic-v1, ubuntu-latest, 3.10) (push) Failing after 7m7s
Code Coverage / Test Coverage (pydantic-v2, ubuntu-latest, 3.10) (push) Failing after 5m14s
Code Coverage / Test Coverage (pydantic-v1, ubuntu-latest, 3.9) (push) Failing after 5m42s
Code Coverage / Test Coverage (pydantic-v2, ubuntu-latest, 3.11) (push) Failing after 4m51s
Code Coverage / Test Coverage (pydantic-v2, ubuntu-latest, 3.12) (push) Failing after 7m12s
Code Coverage / Test Coverage (pydantic-v2, ubuntu-latest, 3.9) (push) Failing after 6m33s
Pyright Lint / Pyright Lint (pydantic-v1) (push) Failing after 8m12s
Ruff Lint / Ruff Lint (push) Successful in 43s
Pyright Lint / Pyright Lint (pydantic-v2) (push) Failing after 6m56s
Site Deploy / publish (push) Failing after 7m21s
🔖 Release 2.4.1
2024-12-25 07:21:05 +00:00

2.4 KiB

mdx sidebar_position description
format
md
5 nonebot.plugin.manager 模块

nonebot.plugin.manager

本模块实现插件加载流程。

参考: import hooks, PEP302

class PluginManager(plugins=None, search_path=None)

  • 说明: 插件管理器。

  • 参数

    • plugins (Iterable[str] | None): 独立插件模块名集合。

    • search_path (Iterable[str] | None): 插件搜索路径(文件夹),相对于当前工作目录。

property third_party_plugins

  • 类型: set[str]

  • 说明: 返回所有独立插件标识符。

property searched_plugins

  • 类型: set[str]

  • 说明: 返回已搜索到的插件标识符。

property available_plugins

  • 类型: set[str]

  • 说明: 返回当前插件管理器中可用的插件标识符。

property controlled_modules

  • 类型: dict[str, str]

  • 说明: 返回当前插件管理器中控制的插件标识符与模块路径映射字典。

method load_plugin(name)

  • 说明

    加载指定插件。

    可以使用完整插件模块名或者插件标识符加载。

  • 参数

    • name (str): 插件名称或插件标识符。
  • 返回

method load_all_plugins()

  • 说明: 加载所有可用插件。

  • 参数

    empty

  • 返回

class PluginFinder(<auto>)

  • 参数

    auto

method find_spec(fullname, path, target=None)

  • 参数

    • fullname (str)

    • path (Sequence[str] | None)

    • target (ModuleType | None)

  • 返回

    • untyped

class PluginLoader(manager, fullname, path)

  • 参数

    • manager (PluginManager)

    • fullname (str)

    • path (str)

method create_module(spec)

  • 参数

    • spec
  • 返回

    • ModuleType | None

method exec_module(module)

  • 参数

    • module (ModuleType)
  • 返回

    • None