feat: enhance downloader to support directory structures #2701
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
Enhanced the auto-updater downloader to use zip-based downloads with Python-only file copying for maximum safety. This naturally supports directory structures while preserving all user configurations.
Problem Solved
utils/*files inPREDBAT_FILESbefore they existconfig/apps.yamlSolution: Safe Zip + Python-Only
Changed to zip-based downloads with selective Python file copying:
*.pyfiles (never config, cache, or other files)utils/*.pyfilesChanges Made
predbat_update_download_zip(): Downloads full repo zip*.pyfiles from extracted ziputils/and copiesutils/*.pyfilesKey Safety Features
✅ Preserves user configs: Never touches
config/apps.yamlor other settings✅ Python code only: Only
*.pyfiles get updated✅ No overwrites: Ignores
.bak, cache, and development files✅ Directory structure: Automatically creates
utils/for OO managers✅ Future-proof: Any new
*.pyfiles or directories work automaticallyWhat Gets Copied
*.pyfiles:predbat.py,config.py,utils.py, etc.*.pyfiles:utils/battery_manager.py, etc.utils/as neededWhat Gets Ignored (for safety)
config/apps.yaml(user settings preserved)__pycache__/,.ruff_cache/(development artifacts).bak,.gitfiles (backup/development files)How It Works
https://github.com/springfall2008/batpred/archive/refs/tags/v8.25.1.zip*.pyfiles fromapps/predbat/and subdirectoriesImpact
This addresses the safety concern while enabling directory support for the OO architecture.
🤖 Generated with Claude Code