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. |
Raises | ConfigErrors | if the are errors. A list of all schema problems can be retrieved via the errors property. |
This method appends the parsed IConfigData
to the overlays property.
Parameters | conf_name | the name of the config. |
conf_data | a string of unparsed config data. |
This method removes the named ConfigData from the stack; ConfigData above the named ConfigData are removed too.
Parameters | conf_name | the name of the IConfigData to remove. |
Returns | the tuple of IConfigData that was removed from overlays. | |
Raises | NoConfigError | if no IConfigData has the conf_name. |