Source code for almanac.io.abstract_io_context

from abc import ABC, abstractmethod
from typing import Any


[docs]class AbstractIoContext(ABC): """An interface for input/output contexts."""
[docs] @abstractmethod def info( self, *args: Any, **kwargs: Any ) -> None: """Print an information message."""
[docs] @abstractmethod def warn( self, *args: Any, **kwargs: Any ) -> None: """Print a warning message."""
[docs] @abstractmethod def error( self, *args: Any, **kwargs: Any ) -> None: """Print an error message."""
[docs] @abstractmethod def raw( self, *args, **kwargs ) -> None: """Print formatted text without any prefix."""
[docs] @abstractmethod def ansi( self, *args, **kwargs ) -> None: """Print ANSI-escaped text."""
# TODO: need read/write-esque stuff if supporting files # all print_* style commands could just be variations on write