pycrossword  0.4
Pure-Python implementation of a crossword puzzle generator and editor
Static Public Member Functions | Static Public Attributes | List of all members
pycross.guisettings.CWSettings Class Reference

Application settings class. More...

Static Public Member Functions

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...
 

Static Public Attributes

dictionary settings
 global app settings dictionary synched with settings files More...
 

Detailed Description

Application settings class.

Member Function Documentation

◆ load_from_file()

def pycross.guisettings.CWSettings.load_from_file (   filepath = SETTINGS_FILE)
static

Loads the app settings from a settings file.

Parameters
filepathstr 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
filepathstr 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
filepathstr 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.

Member Data Documentation

◆ settings

dictionary pycross.guisettings.CWSettings.settings
static

global app settings dictionary synched with settings files

See also
pycross::forms::SettingsDialog

The documentation for this class was generated from the following file: