Add portable mode support for Persepolis#1117
Open
mgh12453 wants to merge 1 commit intopersepolisdm:masterfrom
Open
Add portable mode support for Persepolis#1117mgh12453 wants to merge 1 commit intopersepolisdm:masterfrom
mgh12453 wants to merge 1 commit intopersepolisdm:masterfrom
Conversation
When a file named 'portable' exists alongside the executable (or repo root for dev mode), all data is stored in a 'persepolis_data' subfolder instead of system directories. Also supports --portable CLI flag which creates the marker file automatically. - QSettings uses INI file instead of registry in portable mode - Default download path points to persepolis_data/Downloads/ - Browser integration is skipped in portable mode - Windows mutex includes path hash for portable coexistence Closes persepolisdm#279 https://claude.ai/code/session_01VU149ugqp2U5ZGjkV8y6Cm
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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
This PR adds portable mode support to Persepolis, allowing the application to store all configuration, settings, and download data in a directory alongside the executable rather than in the user's home directory. This is useful for running Persepolis from USB drives or other portable storage.
Key Changes
_getPortableMarkerDir(),isPortableMode(), andsetForcePortableMode()functions to detect and manage portable mode via aportablemarker file or--portableCLI argumentcreateQSettings()function that returns platform-appropriate QSettings (INI file in portable mode, registry/defaults in normal mode)determineConfigFolder()to returnpersepolis_datasubdirectory when in portable modereturnDefaultSettings()to use portable data directory for downloads in portable mode--portablecommand-line flag that forces portable mode and creates the marker file if neededpersepolis.pybefore any config folders are computedcreateQSettings()for consistencyPersepolisBI.pyfor the browser integration helperImplementation Details
--portableis used if it doesn't already existportable.examplefile serves as documentation for manual portable mode activationpersepolis_datasubdirectory in portable mode