Unify (key, response) ordering

This commit is contained in:
Kristóf Tóth 2018-02-23 12:13:19 +01:00
parent 38ca56fa9d
commit fd1cb100ad

View File

@ -30,8 +30,7 @@ class TFWServer:
except AttributeError: return False
def fsm_callback(self, kwargs_dict):
response, key = self.generate_fsm_update() # TODO: unify (key,response) order
self.uplink.send(key, response)
self.uplink.send(*self.generate_fsm_update())
def generate_fsm_update(self):
key = 'FSMUpdate'
@ -39,7 +38,7 @@ class TFWServer:
'data': {'current_state': self.fsm.state,
'valid_transitions':
[{'trigger': trigger} for trigger in self.fsm.machine.get_triggers(self.fsm.state)]}}
return response, key
return key, response
def listen(self, port):
self.application.listen(port)