From ee7ffa55cb9873d2ae92493a33399317c40d9a8b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=B6=B5=E6=9B=A6?= Date: Fri, 5 Jul 2024 13:45:28 +0000 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E9=95=9C=E5=83=8F?= =?UTF-8?q?=E7=BC=BA=E5=B0=91=E6=96=87=E4=BB=B6=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Dockerfile | 1 + xiaomusic/plugin.py | 8 -------- 2 files changed, 1 insertion(+), 8 deletions(-) diff --git a/Dockerfile b/Dockerfile index 4fcd49041..b9d40947b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -11,6 +11,7 @@ WORKDIR /app COPY --from=builder /app/.venv /app/.venv COPY --from=builder /app/ffmpeg /app/ffmpeg COPY xiaomusic/ ./xiaomusic/ +COPY plugins/ ./plugins/ COPY xiaomusic.py . ENV XDG_CONFIG_HOME=/config ENV XIAOMUSIC_HOSTNAME=192.168.2.5 diff --git a/xiaomusic/plugin.py b/xiaomusic/plugin.py index 1ebf05890..f667c0766 100644 --- a/xiaomusic/plugin.py +++ b/xiaomusic/plugin.py @@ -1,8 +1,6 @@ import importlib import inspect -import os import pkgutil -import sys class PluginManager: @@ -10,14 +8,8 @@ def __init__(self, xiaomusic, plugin_dir="plugins"): self.xiaomusic = xiaomusic self.log = xiaomusic.log self._funcs = {} - self._add_plugin_dir_to_path(plugin_dir) self._load_plugins(plugin_dir) - def _add_plugin_dir_to_path(self, plugin_dir): - plugin_dir_path = os.path.join(os.path.dirname(__file__), plugin_dir) - if plugin_dir_path not in sys.path: - sys.path.append(plugin_dir_path) - def _load_plugins(self, plugin_dir): # 假设 plugins 已经在搜索路径上 package_name = plugin_dir