mirror of
https://github.com/avatao-content/baseimage-tutorial-framework
synced 2024-11-23 05:11:31 +00:00
21 lines
635 B
Python
21 lines
635 B
Python
from tfw.components import FSMAware
|
|
from tfw.networking import Scope
|
|
|
|
from .event_handler import EventHandler
|
|
|
|
|
|
class FSMAwareEventHandler(EventHandler, FSMAware):
|
|
# pylint: disable=abstract-method
|
|
"""
|
|
Abstract base class for EventHandlers which automatically
|
|
keep track of the state of the TFW FSM.
|
|
"""
|
|
def __init__(self, key, scope=Scope.ZMQ):
|
|
EventHandler.__init__(self, key, scope=scope)
|
|
FSMAware.__init__(self)
|
|
self.subscribe('fsm_update')
|
|
|
|
def dispatch_handling(self, message):
|
|
if not self.refresh_on_fsm_update(message):
|
|
super().dispatch_handling(message)
|