From cfa8fc5ab6eba6154f76712be709af64cde7fe77 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Krist=C3=B3f=20T=C3=B3th?= Date: Fri, 13 Jul 2018 15:42:18 +0200 Subject: [PATCH] Remove deprecated 'reset' key. Sad to see you go :( --- lib/tfw/event_handler_base.py | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) diff --git a/lib/tfw/event_handler_base.py b/lib/tfw/event_handler_base.py index 81b1ead..511af7c 100644 --- a/lib/tfw/event_handler_base.py +++ b/lib/tfw/event_handler_base.py @@ -21,7 +21,7 @@ class EventHandlerBase(ABC): def __init__(self, key): self.server_connector = ServerConnector() self.key = key - self.subscribe(self.key, 'reset') + self.subscribe(self.key) self.server_connector.register_callback(self.event_handler_callback) def event_handler_callback(self, message): @@ -57,9 +57,7 @@ class EventHandlerBase(ABC): :param message: the message received :returns: the message to send back """ - if message['key'] != 'reset': - return self.handle_event(message) - return self.handle_reset(message) + return self.handle_event(message) @abstractmethod def handle_event(self, message): @@ -71,16 +69,6 @@ class EventHandlerBase(ABC): """ raise NotImplementedError - def handle_reset(self, message): - # pylint: disable=unused-argument,no-self-use - """ - Usually 'reset' events receive some sort of special treatment. - - :param message: the message received - :returns: the message to send back - """ - return None - def subscribe(self, *keys): """ Subscribe this EventHandler to receive events for given keys.