ferrero-opentext/Python-Version/scripts
DJP fb8f17d9b2 Add --keep-files flag to A2→A3 script to preserve Box files
Allows keeping uploaded files in Box for testing/debugging purposes.

NEW FEATURE: --keep-files Flag
- Optional flag for testing/debugging
- Prevents deletion of files from Box after upload
- Files remain in Box folder after successful DAM upload

USAGE:
  Default (delete files after upload):
    python scripts/a2_to_a3_upload_polling.py

  Keep files in Box (testing):
    python scripts/a2_to_a3_upload_polling.py --keep-files

  Combined with A3update:
    python scripts/a2_to_a3_upload_polling.py --keep-files --A3update

HOW IT WORKS:
1. Upload file to DAM (always happens)
2. Store in database (always happens)
3. If --keep-files flag:
   - Skip Box file deletion
   - Log: "--keep-files flag set - File kept in Box: filename.jpg"
4. If no flag (default):
   - Delete file from Box
   - Log: "Deleted file from Box: filename.jpg"

LOGGING:
```
With flag:
  --keep-files flag set - File kept in Box: my_file.jpg

Without flag:
  Deleted file from Box: my_file.jpg
```

USE CASES:
- Testing: Upload multiple times without re-uploading to Box
- Debugging: Keep files to inspect Box metadata
- Development: Test upload logic without losing files
- Backup: Maintain Box copies during initial testing

PRODUCTION NOTE:
For production, don't use this flag - files should be deleted
after successful upload to avoid duplicates on next run.

BOTH FLAGS TOGETHER:
  python scripts/a2_to_a3_upload_polling.py --keep-files --A3update
  - Uploads file to DAM
  - Keeps file in Box
  - Updates campaign A2→A3
  - Perfect for end-to-end testing

Changes:
- scripts/a2_to_a3_upload_polling.py
  - Added --keep-files flag
  - Added keep_files parameter to process_box_file()
  - Conditional Box file deletion
  - Enhanced logging for both modes

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-05 13:17:11 -05:00
..
shared Add detailed upload logging and job polling for actual asset ID 2025-11-05 12:38:45 -05:00
a1_to_a2_download.py Add optional mTLS certificate authentication with --auth-pfx flag 2025-11-04 18:01:23 -05:00
a2_to_a3_upload.py Complete Python automation implementation - All components built 2025-10-30 16:49:14 -04:00
a2_to_a3_upload_polling.py Add --keep-files flag to A2→A3 script to preserve Box files 2025-11-05 13:17:11 -05:00
a5_to_a6_download.py Add optional mTLS certificate authentication with --auth-pfx flag 2025-11-04 18:01:23 -05:00
b1_to_b2_download.py Add optional mTLS certificate authentication with --auth-pfx flag 2025-11-04 18:01:23 -05:00
daily_report.py Add daily summary report with comprehensive statistics 2025-11-04 16:34:44 -05:00
test_connection.py Add optional mTLS certificate authentication with --auth-pfx flag 2025-11-04 18:01:23 -05:00
test_mtls_cert.py Add optional mTLS certificate authentication with --auth-pfx flag 2025-11-04 18:01:23 -05:00
test_mtls_debug.py Add separate mTLS base URL configuration for certificate authentication 2025-11-05 08:25:31 -05:00