5.2.2 draco.config - the Config object

Draco features an integreted configuration subsystem. This subsystem is used by Draco itself to read its configuration and can be used by the user too.

The configuration subsystem is accessed using the global instance of the Config class. This instance is stored in the current module under the name config. The following code fragment illustrates this.

The Config object presents the configuration variables as a namespace. The namespace is read-only, configuration variables can be changed only by editing the configuration file. A small example:

from draco.config import config

do_order = config.get('Ordering', 1)

class Config( )
Global Draco object that provides access to the configuration subsystem.

The public methods of Config are:

namespace( scope)
Return the configuration subnamespace scope. Configuration namespaces with different scopes correspond to different sections in the configuration file. The main configuration namespace (the one accessed through the global Config object) has the scope '__system__'.