From 9be4808a8d7038e9af6de826f573c66ca38194db Mon Sep 17 00:00:00 2001 From: xuyonghao <898441624@qq.com> Date: 星期三, 22 一月 2025 11:31:16 +0800 Subject: [PATCH] 报表合并webSocket信息格式修改 --- app/utils/excelmerge/conformity.py | 15 +++++++-------- 1 files changed, 7 insertions(+), 8 deletions(-) diff --git a/app/utils/excelmerge/conformity.py b/app/utils/excelmerge/conformity.py index 3df2e86..fed5e19 100644 --- a/app/utils/excelmerge/conformity.py +++ b/app/utils/excelmerge/conformity.py @@ -2,8 +2,8 @@ import random import shutil import string -from datetime import datetime +from datetime import datetime from openpyxl import load_workbook @@ -65,17 +65,16 @@ template_excel.save(output_path) template_excel.close() - # 鍚堝苟瀹屾垚鍚庡垹闄ゆ棤鐢ㄦ枃浠� - for filename in os.listdir(file_path): - file_path_full = os.path.join(file_path, filename) - try: + try: + for filename in os.listdir(file_path): + file_path_full = os.path.join(file_path, filename) if os.path.isfile(file_path_full) or os.path.islink(file_path_full): os.unlink(file_path_full) elif os.path.isdir(file_path_full): shutil.rmtree(file_path_full) - os.rmdir(file_path) - except Exception as e: - print(f"鍒犻櫎鏂囦欢鏃跺彂鐢熼敊璇�: {e}") + os.rmdir(file_path) + except Exception as e: + print(f"鍒犻櫎鏂囦欢鏃跺彂鐢熼敊璇�: {e}") return file_name except Exception as e: -- Gitblit v1.8.0