cement.core.controller
Cement core controller module.
- class cement.core.controller.ControllerHandler(**kw: Any)[source]
Bases:
ControllerInterface,HandlerController handler implementation.
- class cement.core.controller.ControllerInterface(**kw: Any)[source]
Bases:
InterfaceThis 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
ControllerHandlerbase class as a starting point.- abstractmethod _dispatch() Any | None[source]
Reads the application object’s data to dispatch a command from this controller. For example, reading
self.app.pargsto 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
Noneif no controller function is called.- Return type:
unknown