Ńň
#8Zc           @   sn   d  Z  d d d d g Z d d k Z d d k l Z d   Z d	   Z d
   Z d   Z	 d   Z
 d   Z d S(   s    Encodings and related functions.t   encode_7or8bitt   encode_base64t   encode_noopt   encode_quoprii˙˙˙˙N(   t   encodestringc         C   s"   t  |  d t } | i d d  S(   Nt	   quotetabst    s   =20(   t   _encodestringt   Truet   replace(   t   st   enc(    (    s$   /usr/lib/python2.6/email/encoders.pyt   _qencode   s    c         C   sQ   |  p |  S|  d d j } t  i |   } | o | d d j o	 | d  S| S(   Ni˙˙˙˙s   
(   t   base64R   (   R
   t
   hasnewlinet   value(    (    s$   /usr/lib/python2.6/email/encoders.pyt   _bencode   s    	c         C   s3   |  i    } t |  } |  i |  d |  d <d S(   sl   Encode the message's payload in Base64.

    Also, add an appropriate Content-Transfer-Encoding header.
    R   s   Content-Transfer-EncodingN(   t   get_payloadR   t   set_payload(   t   msgt   origt   encdata(    (    s$   /usr/lib/python2.6/email/encoders.pyR   '   s    c         C   s3   |  i    } t |  } |  i |  d |  d <d S(   sv   Encode the message's payload in quoted-printable.

    Also, add an appropriate Content-Transfer-Encoding header.
    s   quoted-printables   Content-Transfer-EncodingN(   R   R   R   (   R   R   R   (    (    s$   /usr/lib/python2.6/email/encoders.pyR   3   s    c         C   sŽ   |  i    } | d j o d |  d <d Sy | i d  Wnd t j
 oX |  i   } | o | i } | o$ | i   i d  o d |  d <qŞ d |  d <n Xd |  d <d S(   s9   Set the Content-Transfer-Encoding header to 7bit or 8bit.t   7bits   Content-Transfer-EncodingNt   asciis	   iso-2202-t   8bit(   R   t   Nonet   encodet   UnicodeErrort   get_charsett   output_charsett   lowert
   startswith(   R   R   t   charsett   output_cset(    (    s$   /usr/lib/python2.6/email/encoders.pyR    ?   s    
c         C   s   d S(   s   Do nothing.N(    (   R   (    (    s$   /usr/lib/python2.6/email/encoders.pyR   W   s    (   t   __doc__t   __all__R   t   quopriR   R   R   R   R   R   R    R   (    (    (    s$   /usr/lib/python2.6/email/encoders.pyt   <module>   s   						