Cement plugin extension module.

class cement.ext.ext_plugin.CementPluginHandler[source]

Bases: cement.core.plugin.PluginHandler

This class is an internal implementation of the IPlugin interface. It does not take any parameters on initialization.

class Meta[source]

Bases: object

Handler meta-data.

label = 'cement'

The string identifier for this class.

_load_plugin_from_bootstrap(plugin_name, base_package)[source]

Load a plugin from a python package. Returns True if no ImportError is encountered.

  • plugin_name (str) – The name of the plugin, also the name of the module to load from base_package. I.e. myapp.bootstrap.myplugin
  • base_package – The base python package to load the plugin module from. I.e. myapp.bootstrap or similar.

True is the plugin was loaded, False otherwise

Return type:



ImportError – If the plugin can not be imported

_load_plugin_from_dir(plugin_name, plugin_dir)[source]

Load a plugin from a directory path rather than a python package within sys.path. This would either be myplugin.py or myplugin/__init__.py within the given plugin_dir.

  • plugin_name (str) – The name of the plugin.
  • plugin_dir (str) – The filesystem directory path where the plugin exists.

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 (instance) – The application object.

List of disabled plugins


List of plugins that are enabled (not necessary loaded yet).


List of plugins that have been loaded.


Load a plugin whose name is plugin_name. First attempt to load from a plugin directory (plugin_dir), secondly attempt to load from a Python module determined by App.Meta.plugin_module.

Upon successful loading of a plugin, the plugin name is appended to the self._loaded_plugins list.

Parameters:plugin_name (str) – The name of the plugin to load.
Raises:cement.core.exc.FrameworkError – If the plugin can not be loaded

Load a list of plugins. Each plugin name is passed to self.load_plugin().

Parameters:plugin_list (list) – A list of plugin names to load.