测试加载逻辑
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
[StatsDashBoard]
|
||||
enable = "True"
|
||||
enable = true
|
||||
host = "127.0.0.1"
|
||||
port = 8080
|
||||
username = "admin"
|
||||
|
||||
@@ -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}")
|
||||
|
||||
Reference in New Issue
Block a user