platypush/backend/__init__.py
def on_message(self, msg):
        """
        Callback when a message is received on the backend.
        It parses and posts the message on the main bus.
        It should be called by the derived classes whenever
        a new message should be processed.

        :param msg: Received message.  It can be either a key-value dictionary, a platypush.message.Message object,
            or a string/byte UTF-8 encoded string
        """

        msg = Message.build(msg)

        if not getattr(msg, 'target') or msg.target != self.device_id:
            return  # Not for me

        self.logger.debug('Message received on the {} backend: {}'.format(
            self.__class__.__name__, msg))

        if self._is_expected_response(msg):
            # Expected response, trigger the response handler
            clear_timeout()
            self._request_context['on_response'](msg)
            self.stop()
            return

        msg.backend = self   # Augment message to be able to process responses
        self.bus.post(msg)

        Callback when a message is received on the backend.
        It parses and posts the message on the main bus.
        It should be called by the derived classes whenever
        a new message should be processed.

        :param msg: Received message.  It can be either a key-value dictionary, a platypush.message.Message object,
            or a string/byte UTF-8 encoded string
        
Callback when a message is received on the backend.
It parses and posts the message on the main bus.
It should be called by the derived classes whenever
a new message should be processed.
Callback when a message is received on the backend . It parses and posts the message on the main bus . It should be called by the derived classes whenever a new message should be processed .
def on_message(self, msg):
        msg = Message.build(msg)
        if not getattr(msg, 'target') or msg.target != self.device_id:
            return  
        self.logger.debug('Message received on the {} backend: {}'.format(
            self.__class__.__name__, msg))
        if self._is_expected_response(msg):
            clear_timeout()
            self._request_context['on_response'](msg)
            self.stop()
            return
        msg.backend = self   
        self.bus.post(msg)
def on_message ( self , msg ) : msg = Message . build ( msg ) if not getattr ( msg , 'target' ) or msg . target != self . device_id : return self . logger . debug ( 'Message received on the {} backend: {}' . format ( self . __class__ . __name__ , msg ) ) if self . _is_expected_response ( msg ) : clear_timeout ( ) self . _request_context [ 'on_response' ] ( msg ) self . stop ( ) return msg . backend = self self . bus . post ( msg )
Callback when a message is received on the backend.
Callback when a message is received on the backend .
"""
        Callback when a message is received on the backend.
        It parses and posts the message on the main bus.
        It should be called by the derived classes whenever
        a new message should be processed.

        :param msg: Received message.  It can be either a key-value dictionary, a platypush.message.Message object,
            or a string/byte UTF-8 encoded string
        """ # Not for me # Expected response, trigger the response handler # Augment message to be able to process responses
self
msg
Received message.  It can be either a key-value dictionary, a platypush.message.Message object,
or a string/byte UTF-8 encoded string
Received message . It can be either a key - value dictionary a platypush . message . Message object or a string / byte UTF - 8 encoded string