# Copyright (C) 2018 Avatao.com Innovative Learning Kft. # All Rights Reserved. See LICENSE file for details. from abc import ABC from .event_handler_base import EventHandlerBase from .fsm_aware import FSMAware class FSMAwareEventHandler(EventHandlerBase, FSMAware, ABC): # pylint: disable=abstract-method """ Abstract base class for EventHandlers which automatically keep track of the state of the TFW FSM. """ def __init__(self, key): EventHandlerBase.__init__(self, key) FSMAware.__init__(self) self.subscribe('fsm_update') def dispatch_handling(self, message): if self.update_fsm_data(message): return None return super().dispatch_handling(message)