Exemple #1
0
    def handleMessage(self, message):
        """
        Adds a message to the queue of images to send.
        """
        # Check the message and it to the queue.
        if self.strict:
            if not message.m_type in halMessage.valid_messages:
                msg = "Invalid message type '" + message.m_type
                msg += "' received from " + message.getSourceName()
                raise halExceptions.HalException(msg)

            validator = halMessage.valid_messages[message.m_type].get("data")
            halMessage.validateData(validator, message)

        message.logEvent("queued")

        self.queued_messages.append(message)

        # Start the message timer, if it is not already running.
        self.startMessageTimer()
Exemple #2
0
    def handleMessage(self, message):
        """
        Adds a message to the queue of images to send.
        """
        # Check the message and it to the queue.
        if self.strict:
            if not message.m_type in halMessage.valid_messages:
                msg = "Invalid message type '" + message.m_type
                msg += "' received from " + message.getSourceName()
                raise halExceptions.HalException(msg)

            validator = halMessage.valid_messages[message.m_type].get("data")
            halMessage.validateData(validator, message)
            
        message.logEvent("queued")

        self.queued_messages.append(message)

        # Start the message timer, if it is not already running.
        self.startMessageTimer()