def _message_to_string ( message , data = None ) : if data is None : data = _json_from_message ( message ) return "Message {} from {} to {}: {}" . format ( message . namespace , message . source_id , message . destination_id , data )
how to conver email message object to string in python
Gives a string representation of a PB2 message .
def _message_to_string(message, data=None):
    """ Gives a string representation of a PB2 message. """
    if data is None:
        data = _json_from_message(message)

    return "Message {} from {} to {}: {}".format(
        message.namespace, message.source_id, message.destination_id, data)