ObjectOptions

class sofia_redux.scan.configuration.objects.ObjectOptions(allow_error=False, verbose=True)[source]

Bases: Options

Initialize the object options.

The object options contain configuration updates that should be applied when observing certain source objects.

Parameters:
allow_errorbool, optional

If True, allow poorly formatted options to be skipped rather than raising an error.

verbosebool, optional

If True, issues a warning when a poorly option is encountered.

Attributes Summary

append_keys

Methods Summary

clear()

Clear all options.

copy()

Return a copy of the ObjectOptions.

get(source[, default, unalias])

Retrieve the options for a given source.

set(source, options)

Set the options for a given source.

set_object(configuration, source_name[, ...])

Set the object options for a source in the supplied configuration.

update(configuration_options)

Update the object options.

Attributes Documentation

append_keys = ('blacklist', 'whitelist', 'forget', 'recall', 'lock', 'unlock', 'add', 'config')

Methods Documentation

clear()[source]

Clear all options.

Returns:
None
copy()[source]

Return a copy of the ObjectOptions.

Note that any applied objects will not be included in the copy.

Returns:
ObjectOptions
get(source, default=None, unalias=True)[source]

Retrieve the options for a given source.

Parameters:
sourcestr

The name of the observed source.

defaultdict or configobj.ConfigObj, optional

A value to return if no results are found. Must be of dict or configobj.ConfigObj type to be returned.

unaliasbool, optional

Not used by the ObjectOptions.

Returns:
optionsconfigobj.ConfigObj
set(source, options)[source]

Set the options for a given source.

Parameters:
sourcestr

The name of the observed source.

optionsdict or configobj.ConfigObj

The configuration options applicable to the source.

Returns:
None
set_object(configuration, source_name, validate=True)[source]

Set the object options for a source in the supplied configuration.

Parameters:
configurationConfiguration

The configuration in which to apply options for source_name.

source_namestr

The name of the source for which to apply options.

validatebool, optional

If True, validate the configuration after the source options have been applied

Returns:
None
update(configuration_options)[source]

Update the object options.

Parameters:
configuration_optionsdict or configobj.ConfigObj

The options to apply. These must contain an ‘object’ key and values in order to have an effect.

Returns:
None