mirror of
https://github.com/avatao-content/baseimage-tutorial-framework
synced 2024-11-09 01:27:17 +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 .log_monitoring_event_handler import LogMonitoringEventHandler
|
||||
from .message_sender import MessageSender
|
||||
#from .pipe_io_event_handler import PipeIOEventHandlerBase, PipeIOEventHandler
|
||||
#from .pipe_io_event_handler import TransformerPipeIOEventHandler, CommandEventHandler
|
||||
from .pipe_io_event_handler import PipeIOEventHandlerBase, PipeIOEventHandler
|
||||
from .pipe_io_event_handler import TransformerPipeIOEventHandler, CommandEventHandler
|
||||
from .process_managing_event_handler import ProcessManagingEventHandler
|
||||
from .terminal_event_handler import TerminalEventHandler
|
||||
|
@ -21,6 +21,6 @@ class FSMAwareEventHandler(EventHandler, FSMAware, ABC):
|
||||
self.subscribe('fsm_update')
|
||||
|
||||
def dispatch_handling(self, message):
|
||||
if self.update_fsm_data(message):
|
||||
if self.refresh_on_fsm_update(message):
|
||||
return None
|
||||
return super().dispatch_handling(message)
|
||||
|
@ -19,7 +19,7 @@ class FSMAware:
|
||||
self.fsm_event_log = []
|
||||
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):
|
||||
self._handle_fsm_update(message)
|
||||
return True
|
||||
|
Loading…
Reference in New Issue
Block a user