HEX
Server: Apache
System: Linux pdx1-shared-a1-38 6.6.104-grsec-jammy+ #3 SMP Tue Sep 16 00:28:11 UTC 2025 x86_64
User: mmickelson (3396398)
PHP: 8.1.31
Disabled: NONE
Upload Files
File: //opt/ndn-procwatch4/lib64/python3.8/site-packages/cement/core/controller.py
"""Cement core controller module."""

from abc import abstractmethod
from ..core.interface import Interface
from ..core.handler import Handler
from ..utils.misc import minimal_logger

LOG = minimal_logger(__name__)


class ControllerInterface(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
    :class:`ControllerHandler` base class as a starting point.
    """

    class Meta:

        """Interface meta-data."""

        #: The string identifier of the interface.
        interface = 'controller'

    @abstractmethod
    def _dispatch(self):
        """
        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:
            unknown: The result of the executed controller function, or
            ``None`` if no controller function is called.

        """
        pass    # pragma: nocover


class ControllerHandler(ControllerInterface, Handler):
    """Controller handler implementation."""
    pass    # pragma: nocover