mirror of
https://github.com/avatao-content/baseimage-tutorial-framework
synced 2024-11-23 02:51:32 +00:00
Make FSM triggering dependent on FSMManager
This commit is contained in:
parent
50c940b21d
commit
7e8ea0c7ac
@ -12,6 +12,7 @@ class TFWServer:
|
|||||||
def __init__(self, fsm_type):
|
def __init__(self, fsm_type):
|
||||||
self._fsm = fsm_type()
|
self._fsm = fsm_type()
|
||||||
self.fsm_updater = FSMUpdater(self._fsm)
|
self.fsm_updater = FSMUpdater(self._fsm)
|
||||||
|
self.fsm_manager = FSMManager(self._fsm)
|
||||||
self._fsm.subscribe(self.fsm_updater.update)
|
self._fsm.subscribe(self.fsm_updater.update)
|
||||||
|
|
||||||
self.application = Application(
|
self.application = Application(
|
||||||
@ -26,7 +27,7 @@ class TFWServer:
|
|||||||
|
|
||||||
def make_response(self, message):
|
def make_response(self, message):
|
||||||
trigger = message.get('trigger', '')
|
trigger = message.get('trigger', '')
|
||||||
try: self.fsm.trigger(trigger, message=message)
|
try: self.fsm_manager.trigger(trigger, message)
|
||||||
except AttributeError: log.debug('FSM failed to execute nonexistent trigger: "{}"'.format(trigger))
|
except AttributeError: log.debug('FSM failed to execute nonexistent trigger: "{}"'.format(trigger))
|
||||||
return message
|
return message
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user