feat: 批量下载脚本、依赖文件、说明书
This commit is contained in:
@@ -373,7 +373,6 @@ def dsm_upload_downloaded_files(downloaded_files, ticket_id, serial_id, json_mod
|
||||
|
||||
return upload_results
|
||||
|
||||
|
||||
def print_attachment_summary(all_attachments):
|
||||
"""打印附件清单汇总"""
|
||||
print(f"\n{'='*60}")
|
||||
@@ -680,7 +679,7 @@ def main():
|
||||
)
|
||||
result["dsmUpload"] = upload_results
|
||||
|
||||
# 上传完成后清理本地下载文件
|
||||
# 上传完成后清理本地下载文件及子目录
|
||||
for f in result["downloadedFiles"]:
|
||||
local_path = f.get("savedPath")
|
||||
if local_path and os.path.exists(local_path):
|
||||
@@ -691,6 +690,14 @@ def main():
|
||||
except OSError as e:
|
||||
if not args.json_mode:
|
||||
print(f" 删除失败: {local_path}: {e}")
|
||||
# 删除空的下载子目录
|
||||
try:
|
||||
if os.path.isdir(args.output_dir) and not os.listdir(args.output_dir):
|
||||
os.rmdir(args.output_dir)
|
||||
if not args.json_mode:
|
||||
print(f" 已删除目录: {args.output_dir}")
|
||||
except OSError:
|
||||
pass
|
||||
|
||||
if args.json_mode:
|
||||
print(json.dumps(result, ensure_ascii=False, indent=2))
|
||||
|
||||
Reference in New Issue
Block a user