cement.core.extension¶
Cement core extensions module.
-
class
cement.core.extension.IExtension¶ Bases:
cement.core.interface.InterfaceThis 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:
objectInterface meta-data.
-
label= 'extension'¶ The string identifier of the interface.
-
validator(klass, obj)¶ The interface validator function.
-
-
IExtension._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
-
IExtension.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.
-
IExtension.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']
-
class
-
cement.core.extension.extension_validator(klass, obj)¶ Validates an handler implementation against the IExtension interface.