diff --git a/lib/tfw/event_handlers/event_handler_factory_base.py b/lib/tfw/event_handlers/event_handler_factory_base.py index 52f6962..4c4adcd 100644 --- a/lib/tfw/event_handlers/event_handler_factory_base.py +++ b/lib/tfw/event_handlers/event_handler_factory_base.py @@ -4,15 +4,15 @@ from .event_handler import EventHandler class EventHandlerFactoryBase: - def build(self, event_handler, *, keys=None, event_handler_type=EventHandler): - builder = EventHandlerBuilder(event_handler, keys, event_handler_type) + def build(self, handler_stub, *, keys=None, event_handler_type=EventHandler): + builder = EventHandlerBuilder(handler_stub, keys, event_handler_type) server_connector = self._build_server_connector() - real_event_handler = builder.build(server_connector) - event_handler.server_connector = server_connector + event_handler = builder.build(server_connector) + handler_stub.server_connector = server_connector with suppress(AttributeError): - event_handler.start() - real_event_handler.start() - return real_event_handler + handler_stub.start() + event_handler.start() + return event_handler def _build_server_connector(self): raise NotImplementedError() @@ -20,7 +20,7 @@ class EventHandlerFactoryBase: class EventHandlerBuilder: def __init__(self, event_handler, supplied_keys, event_handler_type): - self._analyzer = EventHandlerAnalyzer(event_handler, supplied_keys) + self._analyzer = HandlerStubAnalyzer(event_handler, supplied_keys) self._event_handler_type = event_handler_type def build(self, server_connector): @@ -40,7 +40,7 @@ class EventHandlerBuilder: raise -class EventHandlerAnalyzer: +class HandlerStubAnalyzer: def __init__(self, event_handler, supplied_keys): self._event_handler = event_handler self._supplied_keys = supplied_keys