plaid.viewer.preferences¶
plaid.viewer.preferences
¶
Persistent user preferences for the dataset viewer.
The viewer stores a tiny JSON document under the OS-standard user config
directory so a handful of settings (currently only the last local
datasets_root) survive across sessions. The file is best-effort:
read/write errors are silently swallowed so a broken preferences file
never prevents the viewer from starting.
Location: $XDG_CONFIG_HOME/plaid/viewer.json (falling back to
~/.config/plaid/viewer.json), overridable by setting
PLAID_VIEWER_CONFIG_FILE.
plaid.viewer.preferences.load_preferences
¶
Return the persisted preferences dict, or an empty dict on failure.
Source code in plaid/viewer/preferences.py
plaid.viewer.preferences.save_preferences
¶
Persist data to the preferences file, creating parents as needed.
Source code in plaid/viewer/preferences.py
plaid.viewer.preferences.update_preferences
¶
Merge updates into the persisted preferences and return the result.
Keys whose value is None are removed from the stored document so
clearing a setting (e.g. the datasets root) does not leave a stale
entry behind.
Source code in plaid/viewer/preferences.py
plaid.viewer.preferences.get_last_datasets_root
¶
Return the persisted last-used datasets root, or None.
Source code in plaid/viewer/preferences.py
plaid.viewer.preferences.set_last_datasets_root
¶
Persist (or clear) the last-used datasets root.