- Removed trailing whitespace and ensured files end with a single newline in cleanup_unused_files.py. - Added fix_trailing_whitespace.py to batch remove trailing whitespace from Python files. - Updated install_dependencies.py to improve dependency installation prompts. - Cleaned up pick_coords.py by removing unnecessary whitespace and improving code readability. - Enhanced region_selector.py by disabling specific pylint checks for better compatibility with third-party libraries. - Improved WPS流程图生成工具.py by cleaning up whitespace and enhancing readability. - Updated __init__.py in typings to remove unnecessary lines. - Modified app.js to adjust default configuration values and clean up unused code.
41 lines
953 B
Python
41 lines
953 B
Python
"""图像查看组件
|
|
|
|
包含图像预览、列表等功能的GUI组件。
|
|
"""
|
|
|
|
from __future__ import annotations
|
|
|
|
from typing import Any, Callable
|
|
import os
|
|
import tkinter as tk
|
|
from tkinter import ttk
|
|
from PIL import Image, ImageTk
|
|
|
|
|
|
def create_image_viewer(
|
|
parent: Any,
|
|
on_line: Callable[[str], None],
|
|
) -> tuple[Any, Callable[[], None], Callable[[], None]]:
|
|
"""创建图像查看器组件。
|
|
|
|
参数:
|
|
parent: 父容器
|
|
on_line: 日志输出回调
|
|
|
|
返回:
|
|
(image_var, update_image_list_func, refresh_preview_func)
|
|
"""
|
|
image_var = tk.StringVar()
|
|
|
|
def update_image_list(refresh_after: bool = True) -> None:
|
|
"""更新图像列表。"""
|
|
# TODO: 从原文件迁移函数实现
|
|
pass
|
|
|
|
def refresh_preview() -> None:
|
|
"""刷新图像预览。"""
|
|
# TODO: 从原文件迁移函数实现
|
|
pass
|
|
|
|
return image_var, update_image_list, refresh_preview
|