- Removed obsolete command-line test parameters from `run_cli.py` to streamline functionality. - Introduced a new `ocr_preprocess.py` module for unified OCR image preprocessing, enhancing recognition stability. - Updated various components to utilize the new preprocessing function, improving code organization and readability. - Adjusted configuration values in `config.json` for better performance and consistency. - Added comprehensive technical documentation for the Douyin project, detailing code modification standards and operational guidelines. - Cleaned up excessive blank lines across multiple files to enhance overall readability.
82 lines
962 B
Python
82 lines
962 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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|