die TEFBOGEN sind korrigiert.
This commit is contained in:
@@ -3,7 +3,7 @@ import os
|
||||
import re
|
||||
import xml.etree.ElementTree as ET
|
||||
from xml.dom import minidom
|
||||
import argparse
|
||||
import shutil
|
||||
|
||||
def analyze_and_normalize_path(d, path_type, path_id=""):
|
||||
"""Strictly normalize path direction and generate detailed report"""
|
||||
@@ -364,7 +364,18 @@ def batch_process_svgs(input_dir, output_dir):
|
||||
print("\nProcessing summary:")
|
||||
print(f"Successfully processed: {success_count} files")
|
||||
print(f"Failed to process: {failure_count} files")
|
||||
|
||||
def clear_output_dir(path: str):
|
||||
|
||||
os.makedirs(path, exist_ok=True)
|
||||
for filename in os.listdir(path):
|
||||
file_path = os.path.join(path, filename)
|
||||
try:
|
||||
if os.path.isdir(file_path):
|
||||
shutil.rmtree(file_path) # 删除目录
|
||||
elif os.path.isfile(file_path) or os.path.islink(file_path):
|
||||
os.unlink(file_path) # 删除文件或符号链接
|
||||
except Exception as e:
|
||||
print(f"Failed to delete {file_path}. Reason: {e}")
|
||||
if __name__ == '__main__':
|
||||
input_dir = os.environ.get('RD_CONF_TEFWEICHEN')
|
||||
output_dir = os.environ.get('RD_CONF_WORK')
|
||||
@@ -376,7 +387,7 @@ if __name__ == '__main__':
|
||||
if not os.path.exists(input_dir):
|
||||
print(f"Error: Input directory '{input_dir}' does not exist")
|
||||
exit(1)
|
||||
|
||||
clear_output_dir(output_dir)
|
||||
print(f"Starting SVG file processing, working directory: {input_dir}")
|
||||
print("=" * 50)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user