docs: 完善README文档与架构图,修复全量注释与日志问题

- README: 补充项目概述、技术栈、架构图(Mermaid)、插件生命周期时序图
- build.py: 补充模块和函数 docstring
- core/__init__.py: 修正模块说明(工具箱→插件系统)
- log.py: 修复过时注释,清理死代码,抑制第三方库日志刷屏
- plugin_registry.py: 修正矛盾注释,补充缺失日志,隐藏远程路径
- plugins.py: 修正过时注释,清理死代码和无用导入
- plugins_card.py: 修正错误类名注释,补充全量 docstring
- main.py: 修正错误注释,补充启动/退出/插件加载日志
This commit is contained in:
2026-07-21 17:04:34 +08:00
parent 0efaf2946b
commit 1b6796ec43
8 changed files with 282 additions and 138 deletions
+8 -13
View File
@@ -20,7 +20,7 @@ from pathlib import Path
from typing import Callable, Optional
from PySide6.QtCore import QObject, Signal
from PySide6.QtWidgets import QFrame, QTextEdit
from PySide6.QtWidgets import QFrame
from .log_ui import Ui_FrameLog
@@ -115,6 +115,10 @@ class FrameLog(QFrame, Ui_FrameLog):
logger = logging.getLogger()
logger.setLevel(logging.DEBUG)
# 抑制第三方库 DEBUG 日志刷屏
logging.getLogger("PySide6").setLevel(logging.WARNING)
logging.getLogger("qt_material").setLevel(logging.WARNING)
# 创建日志格式化器:时间 [级别] 消息
formatter = logging.Formatter(
"%(asctime)s [%(levelname)s] %(message)s",
@@ -190,20 +194,11 @@ class FrameLog(QFrame, Ui_FrameLog):
self.log_signal.connect(self._update_log_display)
def _update_log_display(self, message: str) -> None:
"""
更新 UI 的日志显示组件
"""更新 UI 的日志显示组件。
将日志消息追加到 TextEdit 组件中显示
将日志消息追加到 TextEdit 组件中显示
Args:
message: 格式化后的日志消息字符串
实现细节:
- 使用 findChild 查找 TextEdit 组件
- 使用 append 方法追加日志消息,自动换行
"""
self.textEdit.append(message)
# text_edit = self.findChild(QTextEdit, "textEdit")
# if text_edit:
# text_edit.append(message)
self.textEdit.append(message)