yawning_titan.config.core.ConfigValidationBase#

class yawning_titan.config.core.ConfigValidationBase(fail_reasons=None, fail_exceptions=None)[source]#

Bases: ConfigBase

The base validation methods for a config element.

Methods

add_validation

Add a validation fail_reason, exception pair to their respective lists.

get_config_elements

Get the attributes of the class that are either :class: ConfigGroup or ConfigItem.

get_non_config_elements

Get all attributes of the class that are not :class: ConfigGroup or :class: ConfigItem.

stringify

Represent the class as a string.

Attributes

config_groups

~yawning_titan.config.core.ConfigGroup children of the group.

config_items

~yawning_titan.config.core.ConfigItem children of the group.

passed

fail_reasons or :attribute: fail_exceptions.

add_validation(fail_reason, exception)[source]#

Add a validation fail_reason, exception pair to their respective lists.

Additionally check that no such error already exists.

Parameters:
  • fail_reason – A string message to describe a particular error.

  • exception – A wrapped Exception object that can be used to raise an error for the fail_reason.

stringify()[source]#

Represent the class as a string.

Returns:

A string.

abstract property passed#

fail_reasons or :attribute: fail_exceptions.

Returns:

A bool.

Type:

Returns True if there are no

Type:

attribute

property config_groups#

~yawning_titan.config.core.ConfigGroup children of the group.

Type:

Property to represent the

Type:

class

property config_items#

~yawning_titan.config.core.ConfigItem children of the group.

Type:

Property to represent the

Type:

class

get_config_elements(types=None)#

Get the attributes of the class that are either :class: ConfigGroup or ConfigItem.

Parameters:

_type – An optional type for a specific type of config element.

Returns:

A dictionary of names to config elements.

get_non_config_elements()#

Get all attributes of the class that are not :class: ConfigGroup or :class: ConfigItem.

Returns:

A dictionary of names to attributes.