Simple handler that does not really process any hooks.
| 486 | |
| 487 | |
| 488 | class SimpleConnectionHandler(LiveConnectionHandler): # pragma: no cover |
| 489 | """Simple handler that does not really process any hooks.""" |
| 490 | |
| 491 | hook_handlers: dict[str, Callable] |
| 492 | |
| 493 | def __init__(self, reader, writer, options, mode, hook_handlers): |
| 494 | super().__init__(reader, writer, options, mode) |
| 495 | self.hook_handlers = hook_handlers |
| 496 | |
| 497 | async def handle_hook(self, hook: commands.StartHook) -> None: |
| 498 | if hook.name in self.hook_handlers: |
| 499 | self.hook_handlers[hook.name](*hook.args()) |
| 500 | |
| 501 | |
| 502 | if __name__ == "__main__": # pragma: no cover |
no outgoing calls
no test coverage detected
searching dependent graphs…