Skip to content
Snippets Groups Projects
Commit 466aa690 authored by Timothe Jost's avatar Timothe Jost
Browse files

PypelineLoggerProtocol typehint on getLogger

parent c6895835
No related branches found
No related tags found
No related merge requests found
Pipeline #131771 passed
__version__ = "0.0.61"
__version__ = "0.0.62"
from . import loggs
from .pipes import *
......
......@@ -13,10 +13,28 @@ from coloredlogs import (
)
from pathlib import Path
from typing import Protocol, Callable, cast
NAMELENGTH = 33 # global variable for formatting the length of the padding dedicated to name part in a logging record
LEVELLENGTH = 9 # global variable for formatting the length of the padding dedicated to levelname part in a record
class PypelineLoggerProtocol(Protocol):
def save(self, msg, *args, **kwargs) -> None: ...
def load(self, msg, *args, **kwargs) -> None: ...
def note(self, msg, *args, **kwargs) -> None: ...
def start(self, msg, *args, **kwargs) -> None: ...
def end(self, msg, *args, **kwargs) -> None: ...
def header(self, msg, *args, **kwargs) -> None: ...
class PypelineLogger(logging.Logger, PypelineLoggerProtocol):
pass
getLogger = cast(Callable[[str], PypelineLogger], logging.getLogger)
def enable_logging(
filename: str | None = None,
terminal_level: str = "NOTE",
......
......@@ -10,12 +10,7 @@ if TYPE_CHECKING:
from .graphs import PipelineGraph
class PipelineType(Protocol):
def __getattr__(self, name: str) -> "BasePipe": ...
class Pipeline(PipelineType):
class Pipeline:
pipes: Dict[str, "BasePipe"]
runner_backend_class = BaseTaskBackend
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment