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.


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.


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.

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 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.