Repository navigation
API turboframe.config
rafageist edited this page Dec 4, 2026
·
4 revisions
Source: turboframe/config.py. Generated from the code of TurboFrame 0.3.0 by tools/wiki_api.py.
An application's settings in a JSON file of the user's: the store TurboFrame's components take.
JsonStore("myapp") is $XDG_CONFIG_HOME/myapp/config.json (~/.config by default; %APPDATA% on Windows unless appdata=False). It is what turboframe.ui.history.set_store, DesktopApp.colors_store and DiffView.store take: an object with load() -> dict and save(dict).
- A missing, unreadable or malformed file loads as
{}; a value that is not a JSON object too. - A save writes a temporary file next to the target, then replaces it: an interrupted save leaves the old settings whole.
-
set_valueon a read-only home keeps the value for nothing but says nothing: a setting is not worth an error dialog.
class JsonStore
JsonStore(app: str, file: str = 'config.json', *, appdata: bool = True)<config home>/<app>/<file>, read and written whole.
-
path(property): Computed each time: a test (or the user) may changeXDG_CONFIG_HOME. load() -> dict[str, Any]save(settings: dict[str, Any]) -> Noneget(key: str, default: Any = None) -> Anyset_value(key: str, value: Any) -> None
def config_home(*, appdata: bool = True) -> PathWhere users' settings live: $XDG_CONFIG_HOME, else %APPDATA% on Windows (when appdata), else ~/.config.
TurboFrame · part of Divengine · GPL-3.0-or-later · report an issue
Tutorial
Examples
The desktop
- The Desktop
- Application Mixins
- Windows and Lists
- Dialogs
- Histories
- Progress
- Themes and Colors
- Glyphs
- Settings and Recent Files
- Command Palette
Editing
Tasks
Languages
Running
Reference
Links