Remove deprecated 'reset' key. Sad to see you go :(

This commit is contained in:
Kristóf Tóth 2018-07-13 15:42:18 +02:00
parent 688c615fd7
commit cfa8fc5ab6

View File

@ -21,7 +21,7 @@ class EventHandlerBase(ABC):
def __init__(self, key): def __init__(self, key):
self.server_connector = ServerConnector() self.server_connector = ServerConnector()
self.key = key self.key = key
self.subscribe(self.key, 'reset') self.subscribe(self.key)
self.server_connector.register_callback(self.event_handler_callback) self.server_connector.register_callback(self.event_handler_callback)
def event_handler_callback(self, message): def event_handler_callback(self, message):
@ -57,9 +57,7 @@ class EventHandlerBase(ABC):
:param message: the message received :param message: the message received
:returns: the message to send back :returns: the message to send back
""" """
if message['key'] != 'reset': return self.handle_event(message)
return self.handle_event(message)
return self.handle_reset(message)
@abstractmethod @abstractmethod
def handle_event(self, message): def handle_event(self, message):
@ -71,16 +69,6 @@ class EventHandlerBase(ABC):
""" """
raise NotImplementedError 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): def subscribe(self, *keys):
""" """
Subscribe this EventHandler to receive events for given keys. Subscribe this EventHandler to receive events for given keys.