Application settings class.
More...
|
def | validate_file (filepath=SETTINGS_FILE) |
| Validates a settings file and returns its contents as a dictionary. More...
|
|
def | save_to_file (filepath=SETTINGS_FILE) |
| Dumps the current app settings into a settings file. More...
|
|
def | load_from_file (filepath=SETTINGS_FILE) |
| Loads the app settings from a settings file. More...
|
|
|
dictionary | settings |
| global app settings dictionary synched with settings files More...
|
|
Application settings class.
◆ load_from_file()
def pycross.guisettings.CWSettings.load_from_file |
( |
|
filepath = SETTINGS_FILE | ) |
|
|
static |
Loads the app settings from a settings file.
- Parameters
-
filepath | str path to the settings file to load from |
- Warning
- The app uses GZIP compression in settings files (*.pxjson), so the raw JSON data is not viewable directly when you open such files in a notepad; you may still unpack them using your GZIP-compatible decompression tool.
- See also
- CWSettings::save_to_file()
◆ save_to_file()
def pycross.guisettings.CWSettings.save_to_file |
( |
|
filepath = SETTINGS_FILE | ) |
|
|
static |
Dumps the current app settings into a settings file.
- Parameters
-
filepath | str path to the settings file to save to |
- Warning
- The app uses GZIP compression in settings files (*.pxjson), so the raw JSON data is not viewable directly when you open such files in a notepad; you may still unpack them using your GZIP-compatible decompression tool.
- See also
- CWSettings::load_from_file()
◆ validate_file()
def pycross.guisettings.CWSettings.validate_file |
( |
|
filepath = SETTINGS_FILE | ) |
|
|
static |
Validates a settings file and returns its contents as a dictionary.
Validation compares the structure of the settings file contents to CWSettings::settings
and checks if the settings file contains the exact same keys recursively in each root key.
- Parameters
-
filepath | str path to the settings file to load |
- Returns
dict
|None
settings read from the file as a Python dictionary – see CWSettings::settings
; or None
on validation error
- Warning
- The app uses GZIP compression in settings files (*.pxjson), so the raw JSON data is not viewable directly when you open such files in a notepad; you may still unpack them using your GZIP-compatible decompression tool.
◆ settings
dictionary pycross.guisettings.CWSettings.settings |
|
static |
The documentation for this class was generated from the following file: