lisa.conf.DerivedKeyDesc#
- class lisa.conf.DerivedKeyDesc(name, help, classinfo, base_key_paths, compute, newtype=None)[source]#
Bases:
KeyDescKey descriptor describing a key derived from other keys
Derived keys cannot be added from a source, since they are purely computed out of other keys. It is also not possible to change their source priorities. To achieve that, set the source priorities on the keys it is based on.
- Parameters:
base_key_paths (list(list(str))) – List of paths to the keys this key is derived from. The paths in the form of a list of string are relative to the current level. To reference a level above the current one, use the special key
...compute (collections.abc.Callable) – Function used to compute the value of the key. It takes a dictionary of base keys specified in
base_key_pathsas only parameter and is expected to return the key’s value.
Attributes
nameinheritedName of that key.
parentinheritedParent
LevelKeyDesc.Properties
Help description associated with the key.
newtypeinheritedUnique type associated with that key.
pathinheritedPath in the config file from the root to that key.
qualnameinheritedQualified name of the configuration key used for error reporting.
Methods
Get the
KeyDescBaseof base keys that have aDeferredValuevalue.get_help()inheritedGet a help message describing the key.
pretty_format()inheritedFormat the value for pretty printing.
validate_val()inheritedCheck that the value is an instance of one of the type specified in the
self.classinfo.
Attributes#
- DerivedKeyDesc.name#
Inherited attribute, see
lisa.conf.KeyDescBase.nameName of that key.
- DerivedKeyDesc.parent#
Inherited attribute, see
lisa.conf.KeyDescBase.parentParent
LevelKeyDesc.
Properties#
- property DerivedKeyDesc.newtype#
Inherited property, see
lisa.conf.KeyDesc.newtypeUnique type associated with that key.
- property DerivedKeyDesc.path#
Inherited property, see
lisa.conf.KeyDescBase.pathPath in the config file from the root to that key.
- property DerivedKeyDesc.qualname#
Inherited property, see
lisa.conf.KeyDescBase.qualnameQualified name of the configuration key used for error reporting.
Methods#
- DerivedKeyDesc.get_non_evaluated_base_keys(conf)[source]#
Get the
KeyDescBaseof base keys that have aDeferredValuevalue.
- DerivedKeyDesc.get_help(style=None, last=False, children=True)#
Inherited method, see
lisa.conf.KeyDesc.get_help()Get a help message describing the key.
- static DerivedKeyDesc.pretty_format(v)#
Inherited method, see
lisa.conf.KeyDesc.pretty_format()Format the value for pretty printing.
- DerivedKeyDesc.validate_val(val)#
Inherited method, see
lisa.conf.KeyDesc.validate_val()Check that the value is an instance of one of the type specified in the
self.classinfo.