From 481a91960659fd74420daaf907844be9a5bccd25 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Krist=C3=B3f=20T=C3=B3th?= Date: Fri, 28 Jun 2019 15:16:08 +0200 Subject: [PATCH] Improve FSMAware api --- lib/tfw/builtins/__init__.py | 4 ++-- lib/tfw/builtins/fsm_aware_event_handler.py | 2 +- lib/tfw/components/fsm_aware.py | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/tfw/builtins/__init__.py b/lib/tfw/builtins/__init__.py index b4e7178..af322b8 100644 --- a/lib/tfw/builtins/__init__.py +++ b/lib/tfw/builtins/__init__.py @@ -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 diff --git a/lib/tfw/builtins/fsm_aware_event_handler.py b/lib/tfw/builtins/fsm_aware_event_handler.py index 01d8410..6eb7565 100644 --- a/lib/tfw/builtins/fsm_aware_event_handler.py +++ b/lib/tfw/builtins/fsm_aware_event_handler.py @@ -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) diff --git a/lib/tfw/components/fsm_aware.py b/lib/tfw/components/fsm_aware.py index ddbf6fb..beb4957 100644 --- a/lib/tfw/components/fsm_aware.py +++ b/lib/tfw/components/fsm_aware.py @@ -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