config¶
Manages configuration options.
- options = {'caching': False, 'classkit': False, 'session': 'platform-dependent'}¶
Default values for configuration options.
- option(name=None, value=None)[source]¶
Sets or returns the value of a configuration option.
If called without arguments, returns all configuration options as a dictionary. Returns an option’s value if only called with the option’s
name
. Otherwise sets the option to the givenvalue
.
- location()[source]¶
Returns the default location of the configuration file.
The folder returned by this function is platform-specific. It is inside the user’s
AppData
folder on Windows, inside.config
in the home directory on Linux, and inApplication Support
on macOS.
- load(file=None)[source]¶
Loads the configuration from the given
.ini
file.If
file
is not given, looks for a configuration file namedMPh.ini
in the current directory, or in the folder inside the user profile as returned bylocation()
, or in this library’s folder, in that order. If no such file is found, the hard-coded default values are used.
- save(file=None)[source]¶
Saves the configuration in the given
.ini
file.If
file
is not given, saves the configuration inMPh.ini
inside the default folder returned bylocation()
.