Lala Config Module

Config module

Changed in version 0.5.

The function set_default_options was removed. To achieve the same behaviour, set a module-level dict called “DEFAULT_OPTIONS” where the keys are the option names and the values are the default values in your plugin.

lala.config.get(key, converter=None)[source]

Returns the value of a config option. The section is the name of the calling file.

Default values for all keys can be set with set_default_options().

Parameters:key – The key to lookup
lala.config.get_int(*args)[source]

Returns the value of a config option as an int.

Parameters:*args

See lala.config.get()

Return type:int
lala.config.get_list(*args)[source]

Gets a list option.

Parameters:*args

See lala.config.get()

Return type:list of strings
lala.config.set(key, value, plugin=None)[source]

Sets the value of key. The section is the name of the calling file.

lala.config.set_list(key, value, *args)[source]

Sets option key to value where value is a list of values.

None of the values in value are allowed to contain lala.config._LIST_SEPARATOR.

This method does not preserve the type of the items in the list, they’re all passed through str().

Parameters:
lala.config._LIST_SEPARATOR = ','

Used as a separator when storing lists of values in the config file