zhaoqingang
2025-02-06 b9c7727dc6fbb3789f063c0616ef9392311fecb2
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: