lisa.conf.LevelKeyDesc#
- class lisa.conf.LevelKeyDesc(name, help, children, value_path=None)[source]#
Bases:
KeyDescBase
,Mapping
Key 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
KeyDescBase
defining 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__
help
inheritedHelp description associated with the key.
name
inheritedName of that key.
parent
inheritedParent
LevelKeyDesc
.Properties
Leaf
KeyDescBase
that this level will delegate to in case it is assigned a leaf value.path
inheritedPath in the config file from the root to that key.
qualname
inheritedQualified 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.help
Help description associated with the key.
- LevelKeyDesc.name#
Inherited attribute, see
lisa.conf.KeyDescBase.name
Name of that key.
- LevelKeyDesc.parent#
Inherited attribute, see
lisa.conf.KeyDescBase.parent
Parent
LevelKeyDesc
.
Properties#
- property LevelKeyDesc.key_desc[source]#
Leaf
KeyDescBase
that this level will delegate to in case it is assigned a leaf value.This
KeyDescBase
is pointed at by thevalue_path
attribute.
- property LevelKeyDesc.path#
Inherited property, see
lisa.conf.KeyDescBase.path
Path in the config file from the root to that key.
- property LevelKeyDesc.qualname#
Inherited property, see
lisa.conf.KeyDescBase.qualname
Qualified 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()