refactor(core): 优化权限管理和事件模型
- 重构 AdminManager 和 PermissionManager 以 Redis 为主要数据源 - 为所有事件模型添加 slots=True 提升性能 - 更新文档说明 Mypyc 编译注意事项 - 清理测试和调试文件 - 移动静态资源到 web_static 目录
This commit is contained in:
@@ -8,6 +8,7 @@ import os
|
||||
import pkgutil
|
||||
import sys
|
||||
from typing import Set
|
||||
from .command_manager import CommandManager
|
||||
|
||||
from ..utils.exceptions import SyncHandlerError
|
||||
from ..utils.logger import logger
|
||||
@@ -20,7 +21,7 @@ class PluginManager:
|
||||
"""
|
||||
插件管理器类
|
||||
"""
|
||||
def __init__(self, command_manager):
|
||||
def __init__(self, command_manager: "CommandManager") -> None:
|
||||
"""
|
||||
初始化插件管理器
|
||||
|
||||
@@ -29,7 +30,7 @@ class PluginManager:
|
||||
self.command_manager = command_manager
|
||||
self.loaded_plugins: Set[str] = set()
|
||||
|
||||
def load_all_plugins(self):
|
||||
def load_all_plugins(self) -> None:
|
||||
"""
|
||||
扫描并加载 `plugins` 目录下的所有插件。
|
||||
"""
|
||||
@@ -77,7 +78,7 @@ class PluginManager:
|
||||
f" 加载插件 {module_name} 失败: {e}"
|
||||
)
|
||||
|
||||
def reload_plugin(self, full_module_name: str):
|
||||
def reload_plugin(self, full_module_name: str) -> None:
|
||||
"""
|
||||
精确重载单个插件。
|
||||
"""
|
||||
|
||||
Reference in New Issue
Block a user