Files
neko-run-controller-asyncio/neko_run_controller_asyncio/neko/interfaces.py
2025-01-04 11:54:01 +02:00

24 lines
652 B
Python

from neko_run_controller_std.neko.types import LogsHandler
from typing import Type
import dataclasses
from neko_run_controller_std.neko.interfaces import RunControllerHandlersInterface
@dataclasses.dataclass
class __HiddenStorage:
logs_handlers: list[Type[LogsHandler]] = dataclasses.field(default_factory=list)
_storage = __HiddenStorage()
class RRunControllerHandlersInterface(RunControllerHandlersInterface):
@staticmethod
def add_logs_handler(handler: Type[LogsHandler]):
_storage.logs_handlers.append(handler)
RunControllerHandlersInterface = RRunControllerHandlersInterface
__all__ = [RunControllerHandlersInterface]