忘了展示统计

This commit is contained in:
UnCLAS-Prommer
2025-07-08 10:43:28 +08:00
parent 36974197a8
commit 023e524b3b
3 changed files with 13 additions and 6 deletions

View File

@@ -522,6 +522,7 @@ class BasePlugin(ABC):
def register_plugin(self) -> bool: def register_plugin(self) -> bool:
"""注册插件及其所有组件""" """注册插件及其所有组件"""
from src.plugin_system.core.component_registry import component_registry from src.plugin_system.core.component_registry import component_registry
components = self.get_plugin_components() components = self.get_plugin_components()
# 检查依赖 # 检查依赖
@@ -552,6 +553,7 @@ class BasePlugin(ABC):
def _check_dependencies(self) -> bool: def _check_dependencies(self) -> bool:
"""检查插件依赖""" """检查插件依赖"""
from src.plugin_system.core.component_registry import component_registry from src.plugin_system.core.component_registry import component_registry
if not self.dependencies: if not self.dependencies:
return True return True

View File

@@ -7,6 +7,7 @@
from src.plugin_system.core.plugin_manager import plugin_manager from src.plugin_system.core.plugin_manager import plugin_manager
from src.plugin_system.core.component_registry import component_registry from src.plugin_system.core.component_registry import component_registry
from src.plugin_system.core.dependency_manager import dependency_manager from src.plugin_system.core.dependency_manager import dependency_manager
__all__ = [ __all__ = [
"plugin_manager", "plugin_manager",
"component_registry", "component_registry",

View File

@@ -90,6 +90,8 @@ class PluginManager:
else: else:
total_failed_registration += 1 total_failed_registration += 1
self._show_stats(total_registered, total_failed_registration)
return total_registered, total_failed_registration return total_registered, total_failed_registration
def load_registered_plugin_classes(self, plugin_name: str) -> bool: def load_registered_plugin_classes(self, plugin_name: str) -> bool:
@@ -173,6 +175,7 @@ class PluginManager:
""" """
重新扫描插件根目录 重新扫描插件根目录
""" """
# --------------------------------------- NEED REFACTORING ---------------------------------------
for directory in self.plugin_directories: for directory in self.plugin_directories:
if os.path.exists(directory): if os.path.exists(directory):
logger.debug(f"重新扫描插件根目录: {directory}") logger.debug(f"重新扫描插件根目录: {directory}")
@@ -566,5 +569,6 @@ class PluginManager:
else: else:
logger.info(f"✅ 插件加载成功: {plugin_name}") logger.info(f"✅ 插件加载成功: {plugin_name}")
# 全局插件管理器实例 # 全局插件管理器实例
plugin_manager = PluginManager() plugin_manager = PluginManager()