mirror of
https://github.com/avatao-content/baseimage-tutorial-framework
synced 2024-11-10 21:07:16 +00:00
Improve FSMAware api
This commit is contained in:
parent
78bd97493a
commit
481a919606
@ -7,7 +7,7 @@ from .fsm_managing_event_handler import FSMManagingEventHandler
|
|||||||
from .ide_event_handler import IdeEventHandler
|
from .ide_event_handler import IdeEventHandler
|
||||||
from .log_monitoring_event_handler import LogMonitoringEventHandler
|
from .log_monitoring_event_handler import LogMonitoringEventHandler
|
||||||
from .message_sender import MessageSender
|
from .message_sender import MessageSender
|
||||||
#from .pipe_io_event_handler import PipeIOEventHandlerBase, PipeIOEventHandler
|
from .pipe_io_event_handler import PipeIOEventHandlerBase, PipeIOEventHandler
|
||||||
#from .pipe_io_event_handler import TransformerPipeIOEventHandler, CommandEventHandler
|
from .pipe_io_event_handler import TransformerPipeIOEventHandler, CommandEventHandler
|
||||||
from .process_managing_event_handler import ProcessManagingEventHandler
|
from .process_managing_event_handler import ProcessManagingEventHandler
|
||||||
from .terminal_event_handler import TerminalEventHandler
|
from .terminal_event_handler import TerminalEventHandler
|
||||||
|
@ -21,6 +21,6 @@ class FSMAwareEventHandler(EventHandler, FSMAware, ABC):
|
|||||||
self.subscribe('fsm_update')
|
self.subscribe('fsm_update')
|
||||||
|
|
||||||
def dispatch_handling(self, message):
|
def dispatch_handling(self, message):
|
||||||
if self.update_fsm_data(message):
|
if self.refresh_on_fsm_update(message):
|
||||||
return None
|
return None
|
||||||
return super().dispatch_handling(message)
|
return super().dispatch_handling(message)
|
||||||
|
@ -19,7 +19,7 @@ class FSMAware:
|
|||||||
self.fsm_event_log = []
|
self.fsm_event_log = []
|
||||||
self._auth_key = KeyManager().auth_key
|
self._auth_key = KeyManager().auth_key
|
||||||
|
|
||||||
def update_fsm_data(self, message):
|
def refresh_on_fsm_update(self, message):
|
||||||
if message['key'] == 'fsm_update' and verify_message(self._auth_key, message):
|
if message['key'] == 'fsm_update' and verify_message(self._auth_key, message):
|
||||||
self._handle_fsm_update(message)
|
self._handle_fsm_update(message)
|
||||||
return True
|
return True
|
||||||
|
Loading…
Reference in New Issue
Block a user