Skip to content

Commit

Permalink
Type Annotations: core.output
Browse files Browse the repository at this point in the history
    - Resolves Issue #706
    - Related to PR #628
  • Loading branch information
derks committed Jul 13, 2024
1 parent bc8d247 commit 52e9ee2
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ Refactoring:
- `[core.log]` [Issue #703](https://github.com/datafolklabs/cement/issues/703)
- `[core.mail]` [Issue #704](https://github.com/datafolklabs/cement/issues/704)
- `[core.meta]` [Issue #705](https://github.com/datafolklabs/cement/issues/705)
- `[core.output]` [Issue #706](https://github.com/datafolklabs/cement/issues/706)
- `[utils.fs]` [Issue #688](https://github.com/datafolklabs/cement/issues/688)
- `[utils.misc]` [Issue #689](https://github.com/datafolklabs/cement/issues/689)
- `[utils.shell]` [Issue #690](https://github.com/datafolklabs/cement/issues/690)
Expand Down
8 changes: 5 additions & 3 deletions cement/core/output.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""Cement core output module."""

from abc import abstractmethod
from typing import Any, Dict
from ..core.interface import Interface
from ..core.handler import Handler
from ..utils.misc import minimal_logger
Expand All @@ -17,15 +18,15 @@ class OutputInterface(Interface):
:class:`OutputHandler` base class as a starting point.
"""

class Meta:
class Meta(Interface.Meta):

"""Handler meta-data."""

#: The string identifier of the interface
interface = 'output'

@abstractmethod
def render(self, data, *args, **kwargs):
def render(self, data: Dict[str, Any], *args: Any, **kwargs: Any) -> str:
"""
Render the ``data`` dict into output in some fashion. This function
must accept both ``*args`` and ``**kwargs`` to allow an application to
Expand All @@ -47,4 +48,5 @@ class OutputHandler(OutputInterface, Handler):

"""Output handler implementation."""

pass # pragma: nocover
class Meta(Handler.Meta):
pass # pragma: nocover

0 comments on commit 52e9ee2

Please sign in to comment.