修一下

This commit is contained in:
2026-01-07 15:30:58 +08:00
parent 296118b408
commit 7d8ae97c25
4 changed files with 79 additions and 81 deletions

View File

@@ -278,11 +278,11 @@ class DeviceSimple(QWidget):
with open(dst_path, 'w', encoding='utf-8') as f:
f.write(content)
# 复制设备文件夹下的其他文件(如 lcd_lib.h
# 复制设备文件夹下的其他额外文件(如 lcd_lib.h
if os.path.exists(device_template_dir):
import shutil
for item in os.listdir(device_template_dir):
# 跳过已处理的文件
# 跳过已处理的主要文件
if item in files_to_process:
continue
@@ -291,11 +291,9 @@ class DeviceSimple(QWidget):
# 只复制文件,不复制子目录
if os.path.isfile(src_file):
# 检查文件是否已存在,避免覆盖
if not os.path.exists(dst_file):
os.makedirs(os.path.dirname(dst_file), exist_ok=True)
shutil.copy2(src_file, dst_file)
print(f"复制额外文件: {dst_file}")
os.makedirs(os.path.dirname(dst_file), exist_ok=True)
shutil.copy2(src_file, dst_file)
print(f"复制设备额外文件: {item}")
self._save_config()
return True