mirror of
https://github.com/avatao-content/baseimage-tutorial-framework
synced 2024-11-23 00:31:31 +00:00
Rename make_response in networking to avoid confusion
This commit is contained in:
parent
d04479157d
commit
18e9ee5f52
@ -23,7 +23,7 @@ class TFWServer:
|
|||||||
self._event_handler_connector = EventHandlerConnector()
|
self._event_handler_connector = EventHandlerConnector()
|
||||||
|
|
||||||
self.application = Application(
|
self.application = Application(
|
||||||
[(r'/ws', ZMQWebSocketProxy, {'make_response': self.make_response,
|
[(r'/ws', ZMQWebSocketProxy, {'make_eventhandler_response': self.make_eventhandler_response,
|
||||||
'proxy_filter': self.proxy_filter,
|
'proxy_filter': self.proxy_filter,
|
||||||
'handle_trigger': self.handle_trigger,
|
'handle_trigger': self.handle_trigger,
|
||||||
'event_handler_connector': self._event_handler_connector})]
|
'event_handler_connector': self._event_handler_connector})]
|
||||||
@ -38,7 +38,7 @@ class TFWServer:
|
|||||||
def fsm_manager(self):
|
def fsm_manager(self):
|
||||||
return self._fsm_manager
|
return self._fsm_manager
|
||||||
|
|
||||||
def make_response(self, message):
|
def make_eventhandler_response(self, message):
|
||||||
self.trigger_fsm(message)
|
self.trigger_fsm(message)
|
||||||
message['FSMUpdate'] = self._fsm_updater.get_fsm_state_and_transitions()
|
message['FSMUpdate'] = self._fsm_updater.get_fsm_state_and_transitions()
|
||||||
return message
|
return message
|
||||||
|
@ -49,10 +49,10 @@ class ZMQWebSocketHandler(WebSocketHandler, ABC):
|
|||||||
|
|
||||||
def on_message(self, message):
|
def on_message(self, message):
|
||||||
LOG.debug('Received on WebSocket: %s', message)
|
LOG.debug('Received on WebSocket: %s', message)
|
||||||
self.send_message(self.make_response(message))
|
self.send_message(self.make_eventhandler_response(message))
|
||||||
|
|
||||||
@abstractmethod
|
@abstractmethod
|
||||||
def make_response(self, message):
|
def make_eventhandler_response(self, message):
|
||||||
raise NotImplementedError
|
raise NotImplementedError
|
||||||
|
|
||||||
def send_message(self, message: dict, key: str = None):
|
def send_message(self, message: dict, key: str = None):
|
||||||
@ -71,7 +71,7 @@ class ZMQWebSocketProxy(ZMQWebSocketHandler):
|
|||||||
# pylint: disable=abstract-method
|
# pylint: disable=abstract-method
|
||||||
def initialize(self, **kwargs): # pylint: disable=arguments-differ
|
def initialize(self, **kwargs): # pylint: disable=arguments-differ
|
||||||
super(ZMQWebSocketProxy, self).initialize(**kwargs)
|
super(ZMQWebSocketProxy, self).initialize(**kwargs)
|
||||||
self._make_response = kwargs['make_response']
|
self._make_eventhandler_response = kwargs['make_eventhandler_response']
|
||||||
self._proxy_filter = kwargs['proxy_filter']
|
self._proxy_filter = kwargs['proxy_filter']
|
||||||
self._handle_trigger = kwargs['handle_trigger']
|
self._handle_trigger = kwargs['handle_trigger']
|
||||||
|
|
||||||
@ -80,8 +80,8 @@ class ZMQWebSocketProxy(ZMQWebSocketHandler):
|
|||||||
if self._proxy_filter(message):
|
if self._proxy_filter(message):
|
||||||
super().on_message(message)
|
super().on_message(message)
|
||||||
|
|
||||||
def make_response(self, message):
|
def make_eventhandler_response(self, message):
|
||||||
return self._make_response(message)
|
return self._make_eventhandler_response(message)
|
||||||
|
|
||||||
def handle_trigger(self, message):
|
def handle_trigger(self, message):
|
||||||
self._handle_trigger(message)
|
self._handle_trigger(message)
|
||||||
|
Loading…
Reference in New Issue
Block a user