加载插件 / Load plugin 可以使用完整路径或仅使用名称, 仅使用名称时会在系统目录和当前目录中搜索. 也可以递归搜索目录中的插件 Can use full path or name only. When using name only, will search in system directory and current directory. Can also recursively search for plugins in a directory Args: path: 插件库路径或名
(path: Union[Path, str])
| 773 | |
| 774 | @staticmethod |
| 775 | def load_plugin(path: Union[Path, str]) -> bool: |
| 776 | """加载插件 / Load plugin |
| 777 | |
| 778 | 可以使用完整路径或仅使用名称, 仅使用名称时会在系统目录和当前目录中搜索. 也可以递归搜索目录中的插件 |
| 779 | Can use full path or name only. When using name only, will search in system directory and |
| 780 | current directory. Can also recursively search for plugins in a directory |
| 781 | |
| 782 | Args: |
| 783 | path: 插件库路径或名称 / Plugin library path or name |
| 784 | |
| 785 | Returns: |
| 786 | bool: 是否成功 / Whether successful |
| 787 | """ |
| 788 | strpath = str(path) |
| 789 | return bool( |
| 790 | Library.framework().MaaGlobalLoadPlugin( |
| 791 | strpath.encode(), |
| 792 | ) |
| 793 | ) |
| 794 | |
| 795 | _api_properties_initialized: bool = False |
| 796 |