导入指定列表中的插件以及指定目录下多个插件,以 `_` 开头的插件不会被导入! 参数: module_path: 指定插件集合 plugin_dir: 指定文件夹路径集合
(
module_path: Iterable[str], plugin_dir: Iterable[str]
)
| 55 | |
| 56 | |
| 57 | def load_all_plugins( |
| 58 | module_path: Iterable[str], plugin_dir: Iterable[str] |
| 59 | ) -> set[Plugin]: |
| 60 | """导入指定列表中的插件以及指定目录下多个插件,以 `_` 开头的插件不会被导入! |
| 61 | |
| 62 | 参数: |
| 63 | module_path: 指定插件集合 |
| 64 | plugin_dir: 指定文件夹路径集合 |
| 65 | """ |
| 66 | manager = PluginManager(module_path, plugin_dir) |
| 67 | _managers.append(manager) |
| 68 | return manager.load_all_plugins() |
| 69 | |
| 70 | |
| 71 | def load_from_json(file_path: str, encoding: str = "utf-8") -> set[Plugin]: |
no test coverage detected