How tousef-refuge/minecraft-backup-management works
This is a Python desktop GUI utility for managing Minecraft saves/backups on a local machine. It is not a client/server system; its “backend” is primarily local filesystem orchestration (reading/writing directories, extracting zip backups, tracking world numbers/history) driven by GUI “windows” (dialogs).
• GUI window flow (what screens exist and how they invoke operations)
• Core domain logic modules (zip extraction, cleanup, history tracking)
• Key filesystem resources (Minecraft directories, backup zips, history/config state)
• Packaging/entrypoint (how it’s launched: python -m app)
Entrypoints / App bootstrap
• app/__main__.py → module entrypoint for python -m app
• app/main.py → likely initializes GUI root, app lifecycle, loads settings, constructs main window
• app/__init__.py → package init (may define version/exports)
• pyproject.toml → packaging/build metadata (editable install pip install -e .)
Domain / Core logic layer
• app/logic/zip_extractor.py → extraction and restore workflows (zip→world folder), likely the “speedrun fixed seed restore” loop
• app/logic/world_history.py → tracking world numbers/history (persistence mechanism to be shown as a data store)
• app/logic/dir_check.py → validation of directory structure/paths (Minecraft folder, backups folder)
• app/logic/regex_funcs.py → parsing world names/numbers, matching backup naming patterns
Settings / Configuration
• app/settings/settings_list.py → central definition of settings keys/defaults
• app/settings/__init__.py → settings package entry
• Window-specific config modules:
• backup_extract/config.py
• backup_cleanup/config.py
These are important because they imply per-feature configuration (paths, toggles like “do not permanently delete”).
Paths / environment integration
• app/paths.py → canonical path resolution (project dir, .minecraft path, saves, backups, config files)
Application/Domain Logic: zip_extractor, world_history, dir_check, regex_funcs
3. Infrastructure: paths, “Settings store”, “History store”, filesystem adapters (even if implicit via stdlib)
Key dependencies to show:
• GUI windows → call logic modules
• Logic modules → use paths.py + filesystem
• Feature config modules → read/write settings store
• world_history.py → reads/writes history store
• regex_funcs.py → used by zip_extractor and/or world_history
Automatic backup extraction
• User → backup_extract/dialog.py (select backup/world/options)
• Dialog → backup_extract/config.py (load config)
• Dialog → dir_check.py (validate dirs)
• Dialog → zip_extractor.py (extract)
• zip_extractor.py → filesystem (read zip, write world folder)
• zip_extractor.py → world_history.py (update world number/history)
• zip_extractor.py → audio (confirm.wav)
• Dialog → backup_extract/status.py (progress/complete)
Backup folder cleanup
• User → backup_cleanup/dialog.py
• Dialog → backup_cleanup/config.py (load “permanent delete” toggle, target folder)
• Dialog → dir_check.py
• Dialog → cleanup logic (if implemented in dialog or separate; from tree it’s likely in dialog/status)
• Cleanup → filesystem (delete/move redundant backups)
• Dialog → backup_cleanup/status.py
Clear history
• User → clear_history/dialog.py
• Dialog → world_history.py (clear persisted history)
• world_history.py → history store (delete/reset file)
Relationships & interactions to explicitly capture
Because this is a local tool, accuracy comes from documenting which modules own which responsibilities and what state is persisted.
• World history store (used by world_history.py)
• Minecraft directories:
• .minecraft/saves/<world> (extraction target)
• backups directory containing .zip files
Cross-cutting concerns:
• Validation: dir_check.py gates operations before destructive actions
• Parsing/naming: regex_funcs.py drives detection of “world number” and redundant backups
• app/windows/*
• app/logic/*
• app/settings/*
• app/paths.py
• persisted stores + Minecraft folders