cement.core.interface
Cement core interface module.
- class cement.core.interface.Interface(**kw)[source]
-
Base interface class that all Cement Interfaces should subclass from.
- class cement.core.interface.InterfaceManager(app)[source]
Bases:
object
Manages the interface system to define, get, list interfaces with the Cement Framework.
- define(ibc)[source]
Define an
ibc
(interface base class).- Parameters:
ibc (Interface) – The abstract base class that defines the interface
- Raises:
cement.core.exc.InterfaceError – If the interface label is already
defined –
Example
app.interface.define(DatabaseInterface)
- defined(interface)[source]
Test whether
interface
is defined.- Parameters:
interface (str) – The label of the interface (I.e.
log
,config
,output
, etc).- Returns:
True
if the interface is defined,False
otherwise- Return type:
Example
app.interface.defined('log')
- get(interface, fallback=None, **kwargs)[source]
Get an interface class.
- Parameters:
- Returns:
An uninstantiated interface class
- Return type:
- Raises:
cement.core.exc.InterfaceError – If the
interface
does not exist.
Example
i = app.interface.get('output')