测试加载逻辑

This commit is contained in:
liuwei
2025-03-19 11:37:14 +08:00
parent 5d2e37439a
commit bd4c4ebe37
3 changed files with 3 additions and 2 deletions

View File

@@ -77,6 +77,7 @@ class PluginInterface(ABC):
if os.path.exists(config_path):
with open(config_path, "r", encoding="utf-8") as f:
plugin_config = toml.load(f)
print(f"{config_path} 加载插件{self.name}配置:{plugin_config}")
self._config.update(plugin_config)
print(f"{config_path} 加载插件配置成功")
return True

View File

@@ -1,5 +1,5 @@
[StatsDashBoard]
enable = "True"
enable = true
host = "127.0.0.1"
port = 8080
username = "admin"

View File

@@ -69,7 +69,7 @@ class StatsDashboardPlugin(PluginInterface):
try:
self.server_thread = threading.Thread(target=self.server.run, daemon=True)
self.server_thread.start()
self.logger.info(f"统计看板服务器已启动,访问地址: http://{self.config['host']}:{self.config['port']}")
self.logger.info(f"统计看板服务器已启动,访问地址: http://{self._config['host']}:{self._config['port']}")
return True
except Exception as e:
self.logger.error(f"启动统计看板服务器失败: {e}")