mirror of
https://github.com/avatao-content/baseimage-tutorial-framework
synced 2024-11-22 22:21:32 +00:00
Unify (key, response) ordering
This commit is contained in:
parent
38ca56fa9d
commit
fd1cb100ad
@ -30,8 +30,7 @@ class TFWServer:
|
|||||||
except AttributeError: return False
|
except AttributeError: return False
|
||||||
|
|
||||||
def fsm_callback(self, kwargs_dict):
|
def fsm_callback(self, kwargs_dict):
|
||||||
response, key = self.generate_fsm_update() # TODO: unify (key,response) order
|
self.uplink.send(*self.generate_fsm_update())
|
||||||
self.uplink.send(key, response)
|
|
||||||
|
|
||||||
def generate_fsm_update(self):
|
def generate_fsm_update(self):
|
||||||
key = 'FSMUpdate'
|
key = 'FSMUpdate'
|
||||||
@ -39,7 +38,7 @@ class TFWServer:
|
|||||||
'data': {'current_state': self.fsm.state,
|
'data': {'current_state': self.fsm.state,
|
||||||
'valid_transitions':
|
'valid_transitions':
|
||||||
[{'trigger': trigger} for trigger in self.fsm.machine.get_triggers(self.fsm.state)]}}
|
[{'trigger': trigger} for trigger in self.fsm.machine.get_triggers(self.fsm.state)]}}
|
||||||
return response, key
|
return key, response
|
||||||
|
|
||||||
def listen(self, port):
|
def listen(self, port):
|
||||||
self.application.listen(port)
|
self.application.listen(port)
|
||||||
|
Loading…
Reference in New Issue
Block a user