cement.core.controller

Cement core controller module.

class cement.core.controller.ControllerHandler(**kw)[source]

Bases: ControllerInterface, Handler

Controller handler implementation.

class cement.core.controller.ControllerInterface(**kw)[source]

Bases: Interface

This class defines the Controller Interface. Handlers that implement this interface must provide the methods and attributes defined below. In general, most implementations should sub-class from the provided ControllerHandler base class as a starting point.

class Meta[source]

Bases: object

Interface meta-data.

interface = 'controller'

The string identifier of the interface.

abstract _dispatch()[source]

Reads the application object’s data to dispatch a command from this controller. For example, reading self.app.pargs to determine what command was passed, and then executing that command function.

Note that Cement does not parse arguments when calling _dispatch() on a controller, as it expects the controller to handle parsing arguments (I.e. self.app.args.parse()).

Returns:

The result of the executed controller function, or None if no controller function is called.

Return type:

unknown