iota/transaction/base.py
def get_messages(self, errors='drop'):
        # type: (Text) -> List[Text]
        """
        Attempts to decipher encoded messages from the transactions in
        the bundle.

        :param errors:
            How to handle trytes that can't be converted, or bytes that
            can't be decoded using UTF-8:

            'drop'
                Drop the trytes from the result.

            'strict'
                Raise an exception.

            'replace'
                Replace with a placeholder character.

            'ignore'
                Omit the invalid tryte/byte sequence.
        """
        decode_errors = 'strict' if errors == 'drop' else errors

        messages = []

        for group in self.group_transactions():
            # Ignore inputs.
            if group[0].value < 0:
                continue

            message_trytes = TryteString(b'')
            for txn in group:
                message_trytes += txn.signature_message_fragment

            if message_trytes:
                try:
                    messages.append(message_trytes.decode(decode_errors))
                except (TrytesDecodeError, UnicodeDecodeError):
                    if errors != 'drop':
                        raise

        return messages
def get_messages(self, errors='drop'):
        # type: (Text) -> List[Text]
        """
        Attempts to decipher encoded messages from the transactions in
        the bundle.

        :param errors:
            How to handle trytes that can't be converted, or bytes that
            can't be decoded using UTF-8:

            'drop'
                Drop the trytes from the result.

            'strict'
                Raise an exception.

            'replace'
                Replace with a placeholder character.

            'ignore'
                Omit the invalid tryte/byte sequence.
        """
        decode_errors = 'strict' if errors == 'drop' else errors

        messages = []

        for group in self.group_transactions():
            # Ignore inputs.
            if group[0].value < 0:
                continue

            message_trytes = TryteString(b'')
            for txn in group:
                message_trytes += txn.signature_message_fragment

            if message_trytes:
                try:
                    messages.append(message_trytes.decode(decode_errors))
                except (TrytesDecodeError, UnicodeDecodeError):
                    if errors != 'drop':
                        raise

        return messages
Attempts to decipher encoded messages from the transactions in
        the bundle.

        :param errors:
            How to handle trytes that can't be converted, or bytes that
            can't be decoded using UTF-8:

            'drop'
                Drop the trytes from the result.

            'strict'
                Raise an exception.

            'replace'
                Replace with a placeholder character.

            'ignore'
                Omit the invalid tryte/byte sequence.