✨ 安装/移除插件提供插件安装/卸载方法用于插件初始化 (#1654)

This commit is contained in:
HibiKier
2024-09-27 10:29:59 +08:00
committed by GitHub
parent b14220e6e3
commit 7890cc577f
3 changed files with 110 additions and 1 deletions
@@ -10,6 +10,7 @@ from zhenxun.utils.http_utils import AsyncHttpx
from zhenxun.models.plugin_info import PluginInfo
from zhenxun.utils.github_utils import GithubUtils
from zhenxun.utils.github_utils.models import RepoAPI
from zhenxun.services.plugin_init import PluginInitManager
from zhenxun.builtin_plugins.plugin_store.models import StorePluginInfo
from zhenxun.utils.image_utils import RowStyle, BuildImage, ImageTemplate
from zhenxun.builtin_plugins.auto_update.config import REQ_TXT_FILE_STRING
@@ -292,6 +293,7 @@ class ShopManage:
shutil.rmtree(path)
else:
path.unlink()
await PluginInitManager.remove(f"zhenxun.{plugin_info.module_path}")
return f"插件 {plugin_key} 移除成功! 重启后生效"
@classmethod