mirror of
https://github.com/datafolklabs/cement.git
synced 2026-02-06 13:26:45 +00:00
Type Annotations: core.controller
- Resolves Issue #695 - Related to PR #628
This commit is contained in:
parent
18d353eedc
commit
3a636dbfbd
@ -26,6 +26,7 @@ Refactoring:
|
||||
- `[core.arg]` [Issue #692](https://github.com/datafolklabs/cement/issues/692)
|
||||
- `[core.cache]` [Issue #693](https://github.com/datafolklabs/cement/issues/693)
|
||||
- `[core.config]` [Issue #694](https://github.com/datafolklabs/cement/issues/694)
|
||||
- `[core.controller]` [Issue #695](https://github.com/datafolklabs/cement/issues/695)
|
||||
- `[core.exc]` [Issue #697](https://github.com/datafolklabs/cement/issues/697)
|
||||
- `[core.interface]` [Issue #702](https://github.com/datafolklabs/cement/issues/702)
|
||||
- `[core.meta]` [Issue #705](https://github.com/datafolklabs/cement/issues/705)
|
||||
|
||||
@ -1,6 +1,8 @@
|
||||
"""Cement core controller module."""
|
||||
|
||||
from __future__ import annotations
|
||||
from abc import abstractmethod
|
||||
from typing import Any, Union
|
||||
from ..core.interface import Interface
|
||||
from ..core.handler import Handler
|
||||
from ..utils.misc import minimal_logger
|
||||
@ -17,7 +19,7 @@ class ControllerInterface(Interface):
|
||||
:class:`ControllerHandler` base class as a starting point.
|
||||
"""
|
||||
|
||||
class Meta:
|
||||
class Meta(Interface.Meta):
|
||||
|
||||
"""Interface meta-data."""
|
||||
|
||||
@ -25,7 +27,7 @@ class ControllerInterface(Interface):
|
||||
interface = 'controller'
|
||||
|
||||
@abstractmethod
|
||||
def _dispatch(self):
|
||||
def _dispatch(self) -> Union[Any | None]:
|
||||
"""
|
||||
Reads the application object's data to dispatch a command from this
|
||||
controller. For example, reading ``self.app.pargs`` to determine what
|
||||
@ -45,4 +47,5 @@ class ControllerInterface(Interface):
|
||||
|
||||
class ControllerHandler(ControllerInterface, Handler):
|
||||
"""Controller handler implementation."""
|
||||
pass # pragma: nocover
|
||||
class Meta(Handler.Meta):
|
||||
pass # pragma: nocover
|
||||
|
||||
Loading…
Reference in New Issue
Block a user