Settings

Central storage of application and user settings

xl.settings.MANAGER

Singleton instance of the SettingsManager

xl.settings.get_option(name, default)
xl.settings.set_option(option, value, save=True)

Set an option (in section/key syntax) to the specified value

Parameters:
  • option (string) – the full path to an option
  • value (any) – the value the option should be assigned
  • save – If True, cause the settings to be written to file
class xl.settings.SettingsManager(location=None, default_location=None)[source]

Bases: configparser.RawConfigParser

Manages Exaile’s settings

get_option(option: str, default: Any = None) → Any[source]

Get the value of an option (in section/key syntax), returning default if the key does not exist yet

Parameters:
  • option – the full path to an option
  • default – a default value to use as fallback
Returns:

the option value or default

has_option(option)[source]

Returns information about the existence of a particular option

Parameters:option (string) – the option path
Returns:whether the option exists or not
Return type:bool
remove_option(option)[source]

Removes an option (in section/key syntax), thus will not be saved anymore

Parameters:option (string) – the option path
save()[source]

Save the settings to disk

set_option(option, value, save=True)[source]

Set an option (in section/key syntax) to the specified value

Parameters:
  • option (string) – the full path to an option
  • value (any) – the value the option should be assigned
  • save – If True, cause the settings to be written to file