Implement user-specific settings storage to prevent writing to application config.py#14
Merged
tmaier-kettering merged 3 commits intoSep 26, 2025
Conversation
Co-authored-by: tmaier-kettering <109093855+tmaier-kettering@users.noreply.github.com>
Co-authored-by: tmaier-kettering <109093855+tmaier-kettering@users.noreply.github.com>
Copilot
AI
changed the title
Update the settings handling in the application so that when saving user settings, the software does not attempt to write to config.py within the application or bundled directory (such as PyInstaller's _MEI* temp folder). Instead, store user-modifiable...
Implement user-specific settings storage to prevent writing to application config.py
Sep 26, 2025
3f016f8
into
copilot/fix-4a73586b-cec7-493a-824b-9a936f99931d
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.
Problem
The application was writing user settings directly to
settings/config.pywithin the application directory, which causes issues in:_MEI*folders)Solution
Implemented a new user-specific settings storage system that:
Stores user settings in platform-appropriate directories:
%APPDATA%\CodebookAI\config.json~/Library/Application Support/CodebookAI\config.json~/.config/CodebookAI\config.jsonMaintains config.py as read-only defaults: The original
settings/config.pynow serves exclusively as the source of default values and is never modified by the application.Provides seamless configuration merging: The new
settings/user_config.pymodule automatically merges user overrides with defaults fromconfig.py, making the transition transparent to existing code.Key Changes
New User Configuration Module
settings/user_config.pywith platform-specific directory detectionUpdated Settings Window
_write_config_file()method that wrote directly to config.pyget_setting()andset_setting()functionsUpdated Configuration Usage
batch_processing/batch_method.pyto use the new configuration systemconfig.attributecalls now go through the user config systemEnhanced Documentation
wiki/File/Settings.mdto document the new storage locations and configuration architectureBenefits
Testing
The implementation has been thoroughly tested for:
This change ensures the application works reliably across all deployment scenarios while maintaining a clean separation between application defaults and user-specific settings.
Warning
Firewall rules blocked me from connecting to one or more addresses (expand for details)
I tried to connect to the following addresses, but was blocked by firewall rules:
https://api.github.com/repos/tmaier-kettering/tmaier-kettering%2FCodebookAI/languages/home/REDACTED/work/_temp/ghcca-node/node/bin/node --enable-source-maps /home/REDACTED/work/_temp/copilot-developer-action-main/dist/index.js(http block)If you need me to access, download, or install something from one of these locations, you can either:
Original prompt
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.