lisa.conf.LevelKeyDesc#
- class lisa.conf.LevelKeyDesc(name, help, children, value_path=None)[source]#
Bases:
KeyDescBase,MappingKey descriptor defining a hierarchical level in the configuration.
- Parameters:
name – name of the key in the configuration
help – Short help describing the use of the keys inside that level
children (collections.abc.Sequence) – collections.abc.Sequence of
KeyDescBasedefining the allowed keys under that levelvalue_path (list(str) or None) –
Relative path to a sub-key that will receive assignment to that level for non-mapping types. This allows turning a leaf key into a level while preserving backward compatibility, as long as:
The key did not accept mapping values, otherwise it would be ambiguous and is therefore rejected.
The old leaf key has a matching new leaf key, that is a sub-key of the new level key.
In practice, that allows turning a single knob into a tree of settings.
Children keys will get this key assigned as a parent when passed to the constructor.
Attributes
__reversed__inheritedSee
collections.abc.Mapping.__reversed__helpinheritedHelp description associated with the key.
nameinheritedName of that key.
parentinheritedParent
LevelKeyDesc.Properties
Leaf
KeyDescBasethat this level will delegate to in case it is assigned a leaf value.pathinheritedPath in the config file from the root to that key.
qualnameinheritedQualified name of the configuration key used for error reporting.
Methods
Checks that a given key is allowed under that levels.
Get a help message describing the key.
Validate a mapping to be used as a configuration source.
__class_getitem__()inheritedSee
collections.abc.Iterable.__class_getitem__()__contains__()inheritedSee
collections.abc.Mapping.__contains__()get()inheritedSee
collections.abc.Mapping.get()items()inheritedSee
collections.abc.Mapping.items()keys()inheritedSee
collections.abc.Mapping.keys()values()inheritedSee
collections.abc.Mapping.values()
Attributes#
- LevelKeyDesc.__reversed__ = None#
- LevelKeyDesc.help#
Inherited attribute, see
lisa.conf.KeyDescBase.helpHelp description associated with the key.
- LevelKeyDesc.name#
Inherited attribute, see
lisa.conf.KeyDescBase.nameName of that key.
- LevelKeyDesc.parent#
Inherited attribute, see
lisa.conf.KeyDescBase.parentParent
LevelKeyDesc.
Properties#
- property LevelKeyDesc.key_desc[source]#
Leaf
KeyDescBasethat this level will delegate to in case it is assigned a leaf value.This
KeyDescBaseis pointed at by thevalue_pathattribute.
- property LevelKeyDesc.path#
Inherited property, see
lisa.conf.KeyDescBase.pathPath in the config file from the root to that key.
- property LevelKeyDesc.qualname#
Inherited property, see
lisa.conf.KeyDescBase.qualnameQualified name of the configuration key used for error reporting.
Methods#
- LevelKeyDesc.get_help(style=None, last=False, children=True)[source]#
Get a help message describing the key.
- classmethod LevelKeyDesc.__class_getitem__()#
Inherited method, see
collections.abc.Iterable.__class_getitem__()
- LevelKeyDesc.__contains__()#
Inherited method, see
collections.abc.Mapping.__contains__()
- LevelKeyDesc.get()#
Inherited method, see
collections.abc.Mapping.get()
- LevelKeyDesc.items()#
Inherited method, see
collections.abc.Mapping.items()
- LevelKeyDesc.keys()#
Inherited method, see
collections.abc.Mapping.keys()
- LevelKeyDesc.values()#
Inherited method, see
collections.abc.Mapping.values()