Configuration

class sofia_redux.pipeline.configuration.Configuration(config_file=None)[source]

Bases: object

Set Redux configuration.

Configuration values are set as attributes of this object, so that they can be accessed as config.value. If the value is not set in the configuration, None will be returned.

Subclasses should set the chooser attribute as appropriate. If unset, this class will use the default redux.Chooser.

Attributes:
config_filestr or dict-like

Initial configuration file.

config: `ConfigObj`

Loaded configuration object.

Initialize with an optional configuration file.

Parameters:
config_filestr or dict-like, optional

File path to an INI-format configuration file. May alternately be any object accepted by the ConfigObj constructor (e.g. a dictionary of configuration key-value pairs).

Methods Summary

load(config_file)

Read config file into ConfigObj object.

to_text()

Print the current configuration to a text list.

update(config_file)

Update configuration from a new config file.

Methods Documentation

load(config_file)[source]

Read config file into ConfigObj object.

Parameters:
config_filestr, dict, or ConfigObj

File path to an INI-format configuration file. Alternately, may be a dict or ConfigObj that can be directly read by the ConfigObj constructor, or it may be a string containing INI formatted values.

to_text()[source]

Print the current configuration to a text list.

Returns:
list of str

The parameters in INI-formatted strings.

update(config_file)[source]

Update configuration from a new config file.

Parameters:
config_filestr, dict, or ConfigObj

File path to an INI-format configuration file. Alternately, may be a dict or ConfigObj that can be directly read by the ConfigObj constructor, or it may be a string containing INI formatted values.