Registry

class Cauldron.registry.Registry(name, doc=None, modname='Cauldron.DFW')[source] [edit on github]

Bases: object

A registry of setup and teardown functions.

This module contains two Registry instances: client and dispatcher. They serve as the setup and teardown registries for the KTL client and disptachetr side APIs. Additional setup or teardown functions can be registered using setup_for() and teardown_for(). The base keyword and service classes for a particular backend can be set using keyword_for() and service_for(). All of these methods are decorators and can be used as such in the appropriate places:

from Cauldron import registry

@regsitry.client.setup_for("mybackend")
def mysetup():
    # Do some setup work here!
    pass

Attributes Summary

Keyword The Keyword class.
Service The Service class.
backend Get the backend name.

Methods Summary

guard(msg[, error]) Guard against backends that aren’t set up.
keys() Return the active and available registry keys.
keyword_for(backend[, keyword]) Register a keyword class.
service_for(backend[, service]) Register a service
setup() Do the setup process.
setup_for(backend) Register a setup function.
teardown() Do the teardown process.
teardown_for(backend) Register a teardown function.
use(backend) Set the backend.

Attributes Documentation

Keyword

The Keyword class.

Service

The Service class.

backend

Get the backend name.

Methods Documentation

guard(msg, error=<type 'exceptions.RuntimeError'>)[source] [edit on github]

Guard against backends that aren’t set up.

keys()[source] [edit on github]

Return the active and available registry keys.

keyword_for(backend, keyword=None)[source] [edit on github]

Register a keyword class.

service_for(backend, service=None)[source] [edit on github]

Register a service

setup()[source] [edit on github]

Do the setup process.

setup_for(backend)[source] [edit on github]

Register a setup function.

teardown()[source] [edit on github]

Do the teardown process.

teardown_for(backend)[source] [edit on github]

Register a teardown function.

use(backend)[source] [edit on github]

Set the backend.