config#

Manages configuration options.

options#

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

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 in Application 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 named MPh.ini in the current directory, or in the folder inside the user profile as returned by location(), 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 in MPh.ini inside the default folder returned by location().