c.l.i.c.IStackableConfig(IConfigSchema) : interface documentation

Part of canonical.lazr.interfaces.config View In Hierarchy

A configuration that is built from configs that extend each other.

A config may extend another config so that a configuration for a
process need only define the localized sections and keys. The
configuration is constructed from a stack of data that defines,
and redefines, the sections and keys in the configuration. Each config
overlays its data to define the final configuration.

A config file declares that is extends another using the 'extends' key
in the 'meta' section of the config data file:
    [meta]
    extends: common.conf

The push() and pop() methods can be used to test processes where the
test environment must be configured differently.
Attribute schema The schema that defines the config.
Attribute data The current ConfigData. use by the config.
Attribute extends The ConfigData that this config extends.
Attribute overlays The stack of ConfigData that define this config.
Method __getattr__ Return the named section.
Method validate Return True if the config is valid for the schema.
Method push Overlay the config with unparsed config data.
Method pop Remove conf_name from the overlays stack.

Inherited from IConfigSchema:

Attribute name The basename of the config filename.
Attribute filename The path to config file
Attribute category_names The list of section category names.
Method __iter__ Iterate over the `ISectionSchema`s.
Method __contains__ Return True or False if the name matches a ISectionSchema.
Method __getitem__ Return the ISectionSchema with the matching name.
Method getByCategory Return a list of ISectionSchemas that belong to the category name.
schema =
The schema that defines the config.
data =
The current ConfigData. use by the config.
extends =
The ConfigData that this config extends.
overlays =
The stack of ConfigData that define this config.
def __getattr__(name):
Return the named section.
Returnsthe matching ISection or ICategory.
RaisesAttributeError if there is no section or category with the name.
Unknown Field: namea section or category name.
def validate():
Return True if the config is valid for the schema.
RaisesConfigErrorsif the are errors. A list of all schema problems can be retrieved via the errors property.
def push(conf_name, conf_data):
Overlay the config with unparsed config data.

This method appends the parsed IConfigData to the overlays property.

Parametersconf_namethe name of the config.
conf_dataa string of unparsed config data.
def pop(conf_name):
Remove conf_name from the overlays stack.

This method removes the named ConfigData from the stack; ConfigData above the named ConfigData are removed too.

Parametersconf_namethe name of the IConfigData to remove.
Returnsthe tuple of IConfigData that was removed from overlays.
RaisesNoConfigErrorif no IConfigData has the conf_name.
API Documentation for Launchpad, generated by pydoctor at 2010-09-27 00:00:11.