dbs_annotator.utils.user_data

Per-user data locations for config and presets.

All user-owned runtime files (config JSON, preset overrides, cached state) MUST resolve under user_data_dir() so they survive reinstalls and in-place upgrades on every platform. The install directory (Windows Program Files / %LOCALAPPDATA%\Programs\..., the macOS .app bundle, the Linux /opt or /usr prefix) is wiped or replaced by every MSI / DMG / dpkg upgrade and must never hold user data.

The path is derived from Qt’s QStandardPaths so it follows platform conventions. Organization and application directory names are set in dbs_annotator.config as FS_ORG_NAME / FS_APP_NAME (ASCII, no spaces) and applied in __main__ via QApplication:

  • Windows: %LOCALAPPDATA%\WyssGeneva\DBSAnnotator

  • macOS: ~/Library/Application Support/WyssGeneva/DBSAnnotator

  • Linux: ~/.local/share/WyssGeneva/DBSAnnotator

Functions

user_config_file(name)

Return a path under user_data_dir() for a named config file.

user_data_dir()

Return the platform-appropriate per-user data directory for the app.