- Introduced new logging modules for action tracking, error logging, and performance tracking to improve observability. - Added functions for retrieving debug and error log paths in `path_config.py`. - Updated various components to utilize the new logging system, enhancing error handling and performance diagnostics. - Implemented a GUI component for viewing error logs, improving user experience in monitoring application issues. - Cleaned up unnecessary blank lines and improved code readability across multiple files.
60 lines
940 B
Python
60 lines
940 B
Python
"""配置管理组件
|
|
|
|
包含配置加载、保存等功能的GUI组件。
|
|
"""
|
|
|
|
from __future__ import annotations
|
|
|
|
from typing import Any, Callable
|
|
import tkinter as tk
|
|
from tkinter import ttk
|
|
|
|
from gui.gui_core import read_config, write_config
|
|
|
|
|
|
def load_config_to_ui(
|
|
cfg: dict[str, Any],
|
|
vars_dict: dict[str, Any],
|
|
on_line: Callable[[str], None],
|
|
) -> None:
|
|
"""从配置文件加载到UI变量。
|
|
|
|
参数:
|
|
cfg: 配置字典
|
|
vars_dict: UI变量字典
|
|
on_line: 日志输出回调
|
|
"""
|
|
# TODO: 实现配置加载逻辑
|
|
# 临时从原文件导入
|
|
pass
|
|
|
|
|
|
def save_ui_to_config(
|
|
vars_dict: dict[str, Any],
|
|
on_line: Callable[[str], None],
|
|
) -> None:
|
|
"""将UI变量保存到配置文件。
|
|
|
|
参数:
|
|
vars_dict: UI变量字典
|
|
on_line: 日志输出回调
|
|
"""
|
|
# TODO: 实现配置保存逻辑
|
|
# 临时从原文件导入
|
|
pass
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|