コード例 #1
0
def encode_base64(msg):
    """Encode the message's payload in Base64.

    Also, add an appropriate Content-Transfer-Encoding header.
    """
    orig = msg.get_payload()
    encdata = str(_bencode(orig), 'ascii')
    msg.set_payload(encdata)
    msg['Content-Transfer-Encoding'] = 'base64'
コード例 #2
0
def encode_base64(msg):
    """Encode the message's payload in Base64.

    Also, add an appropriate Content-Transfer-Encoding header.
    """
    orig = msg.get_payload(decode=True)
    encdata = str(_bencode(orig), 'ascii')
    msg.set_payload(encdata)
    msg['Content-Transfer-Encoding'] = 'base64'
コード例 #3
0
def encode_base64(msg):
    """Encode the message's payload in Base64.

    Also, add an appropriate Content-Transfer-Encoding header.
    """
    orig = msg.get_payload(decode=True)
    encdata = str(_bencode(orig), "ascii")
    msg.set_payload(encdata)
    msg["Content-Transfer-Encoding"] = "base64"
コード例 #4
0
ファイル: encoders.py プロジェクト: KitoHo/kbengine
def encode_base64(msg):
    """Encode the message's payload in Base64.

    Also, add an appropriate Content-Transfer-Encoding header.
    """
    orig = msg.get_payload()
    encdata = str(_bencode(orig), "ascii")
    msg.set_payload(encdata)
    msg["Content-Transfer-Encoding"] = "base64"
コード例 #5
0
ファイル: emailFiles.py プロジェクト: dorfsmay/emailFiles
def myencoder(msg):
    """
    See python issue # 11156.
    """
    from base64 import encodebytes as _bencode

    orig = msg.get_payload()
    encdata = str(_bencode(orig), "ascii")
    msg.set_payload(encdata)
    msg["Content-Transfer-Encoding"] = "base64"
コード例 #6
0
ファイル: EmailDialog.py プロジェクト: testmana2/test
def _encode_base64(msg):
    """
    Function to encode the message's payload in Base64.

    Note: It adds an appropriate Content-Transfer-Encoding header.
    
    @param msg reference to the message object (email.Message)
    """
    orig = msg.get_payload()
    encdata = str(_bencode(orig), "ASCII")
    msg.set_payload(encdata)
    msg['Content-Transfer-Encoding'] = 'base64'
コード例 #7
0
ファイル: EmailDialog.py プロジェクト: renerocksai/EricShort
def _encode_base64(msg):
    """
    Function to encode the message's payload in Base64.

    Note: It adds an appropriate Content-Transfer-Encoding header.
    
    @param msg reference to the message object (email.Message)
    """
    orig = msg.get_payload()
    encdata = str(_bencode(orig), "ASCII")
    msg.set_payload(encdata)
    msg['Content-Transfer-Encoding'] = 'base64'
コード例 #8
0
def encode_base64(msg):
    orig = msg.get_payload(decode=True)
    encdata = str(_bencode(orig), 'ascii')
    msg.set_payload(encdata)
    msg['Content-Transfer-Encoding'] = 'base64'