cement.core.extension

Cement core extensions module.

class cement.core.extension.IExtension

Bases: cement.core.interface.Interface

This class defines the Extension Handler Interface. Classes that implement this handler must provide the methods and attributes defined below.

Implementations do not subclass from interfaces.

Usage:

from cement.core import extension

class MyExtensionHandler(object):
    class Meta:
        interface = extension.IExtension
        label = 'my_extension_handler'
    ...
class IMeta

Bases: object

Interface meta-data.

label = 'extension'

The string identifier of the interface.

validator(klass, obj)

The interface validator function.

_setup(app_obj)

The _setup function is called during application initialization and must ‘setup’ the handler object making it ready for the framework or the application to make further calls to it.

Parameters:app_obj – The application object.
Returns:None
load_extension(ext_module)

Load an extension whose module is ‘ext_module’. For example, ‘cement.ext.ext_configobj’.

Parameters:ext_module (str) – The name of the extension to load.
load_extensions(ext_list)

Load all extensions from ext_list.

Parameters:ext_list (list) – A list of extension modules to load. For example: ['cement.ext.ext_configobj', 'cement.ext.ext_logging']
cement.core.extension.extension_validator(klass, obj)

Validates an handler implementation against the IExtension interface.