From ae69a094c7459ec9963d45aa19592e30287accff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Krist=C3=B3f=20T=C3=B3th?= Date: Tue, 23 Jul 2019 11:47:59 +0200 Subject: [PATCH] Improve names in EventHandlerFactoryBase to improve readability --- .../event_handler_factory_base.py | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) 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