yawning_titan.config.core.ConfigItem#
- class yawning_titan.config.core.ConfigItem(value, doc=None, alias=None, depends_on=<factory>, properties=None, validation=None)[source]#
Bases:
object
The ConfigItem class holds an items value, doc, and properties.
Methods
Set the value of the
ConfigItem
bypassing the validation.This is here to allow stringify methods to be call on both :class: ConfigItem and :class: ConfigGroup classes.
Return the ConfigItem as a dict.
Validate the item against its properties.
Attributes
The alias of the config item, i.e. its representation from the original config.
The items doc.
The items properties.
The instance of ConfigItemValidation that provides access to the item validation details.
The items value.
ConfigItem's upon which this item depends.
- value#
The items value.
- doc = None#
The items doc.
- alias = None#
The alias of the config item, i.e. its representation from the original config.
- depends_on#
ConfigItem’s upon which this item depends. If these items are set so must this item be.
- Type:
A list of
- Type:
class
- properties = None#
The items properties.
- validation = None#
The instance of ConfigItemValidation that provides access to the item validation details.
- to_dict(as_key_val_pair=False, values_only=False, include_none=True)[source]#
Return the ConfigItem as a dict.
- Parameters:
as_key_val_pair – If true, the dict is returned as a value in a key/value pair, the key being the class name.
- Returns:
The ConfigItem as a dict.
- validate()[source]#
Validate the item against its properties.
If no properties exist, simply return a default passed
ConfigItemValidation
.- Returns:
An instance of
ConfigItemValidation
.
- set_value(value)[source]#
Set the value of the
ConfigItem
bypassing the validation.- Parameters:
value – The value to be set.