Application base class reference

This document contains details about the base class provided by configglue for writing configglue-enabled applications.

App

class App([schema=None, plugin_manager=None, name=None, parser=None])

This is the base class from which your application should inherit in order to easily integrate itself with configglue.

More details about what kind of benefits this provides are depicted in the introduction to writing configglue-enabled applications.

App.schema

Optional.

This is the schema class for the application. This schema should describe application-wide configuration.

The schema can also be specified as a class attribute of subclasses of App.

App.plugin_manager

Optional.

This is the class used to manage plugins. Should be an subclass of PluginManager.

The default PluginManager will be used if none is specified.

The plugin manager can also be specified as a class attribute of subclasses of App.

App.name

Optional.

The name of the application. This value will be used to determine where to look for configuration files.

If none is provided, the application will take the name of the script used to invoke it from the command line.

App.parser

New in version 1.0.

Optional.

If provided, it will be used as the parser for commandline options to be extended by configglue.

Note

The custom parser is responsible for providing a ‘validate’ option, or else validation will not be available on the commandline.

By default a optparse.OptionParser instance will be created with an option named ‘validate’ to allow triggering configuration validation.