fix:实现配置功能,实现园长一键签名功能

This commit is contained in:
2025-12-19 12:23:00 +08:00
parent 0e47603d23
commit 14b8c19dfe
19 changed files with 307 additions and 107 deletions

View File

@@ -3,7 +3,7 @@ import os
import time
from loguru import logger
import zipfile
import traceback
def export_templates_folder(output_folder, stop_event, progress_callback=None):
"""
@@ -217,3 +217,27 @@ def check_file_exists(file_path):
判断文件是否存在
"""
return file_path and isinstance(file_path, str) and os.path.exists(file_path)
def get_output_pptx_files(output_dir="output"):
"""
获取 output 文件夹下所有的 pptx 文件
:param output_dir: output 文件夹路径
"""
try:
folder_path = os.path.abspath(output_dir)
if not os.path.exists(folder_path):
logger.error(f"文件夹不存在: {folder_path}")
return
# 获取所有 ppt/pptx 文件
files = [
f for f in os.listdir(folder_path) if f.lower().endswith((".ppt", ".pptx"))
]
if not files:
logger.warning("没有找到 PPT 文件")
return
total_count = len(files)
logger.info(f"发现 {total_count} 个文件,准备开始转换...")
return files
except Exception as e:
logger.error(f"发生未知错误: {e}")
logger.error(traceback.format_exc())