Ñò
mÈKc        	   @   s   d  Z  d d k Z d d k Z y d d k l Z Wn# e j
 o d d k l Z n Xd d „ Z d d „ Z d e i f d „  ƒ  YZ d	 e i	 f d
 „  ƒ  YZ	 d e i
 f d „  ƒ  YZ
 d e e i f d „  ƒ  YZ d e e i f d „  ƒ  YZ d „  Z d S(   sg   Codec for quoted-printable encoding.

Like base64 and rot13, this returns Python strings, not Unicode.
iÿÿÿÿN(   t   StringIOt   strictc         C   s^   | d j p t  ‚ t t |  ƒ ƒ } t ƒ  } t i | | d ƒ | i ƒ  } | t |  ƒ f S(   sê   Encode the input, returning a tuple (output object, length consumed).

    errors defines the error handling to apply. It defaults to
    'strict' handling which is the only currently supported
    error handling for this codec.

    R   i   (   t   AssertionErrorR    t   strt   quoprit   encodet   getvaluet   len(   t   inputt   errorst   ft   gt   output(    (    s,   /usr/lib/python2.6/encodings/quopri_codec.pyt   quopri_encode   s    	c         C   s[   | d j p t  ‚ t t |  ƒ ƒ } t ƒ  } t i | | ƒ | i ƒ  } | t |  ƒ f S(   sê   Decode the input, returning a tuple (output object, length consumed).

    errors defines the error handling to apply. It defaults to
    'strict' handling which is the only currently supported
    error handling for this codec.

    R   (   R   R    R   R   t   decodeR   R   (   R   R	   R
   R   R   (    (    s,   /usr/lib/python2.6/encodings/quopri_codec.pyt   quopri_decode   s    	t   Codecc           B   s    e  Z d  d „ Z d  d „ Z RS(   R   c         C   s   t  | | ƒ S(   N(   R   (   t   selfR   R	   (    (    s,   /usr/lib/python2.6/encodings/quopri_codec.pyR   -   s    c         C   s   t  | | ƒ S(   N(   R   (   R   R   R	   (    (    s,   /usr/lib/python2.6/encodings/quopri_codec.pyR   /   s    (   t   __name__t
   __module__R   R   (    (    (    s,   /usr/lib/python2.6/encodings/quopri_codec.pyR   +   s   t   IncrementalEncoderc           B   s   e  Z e d  „ Z RS(   c         C   s   t  | |  i ƒ d S(   Ni    (   R   R	   (   R   R   t   final(    (    s,   /usr/lib/python2.6/encodings/quopri_codec.pyR   3   s    (   R   R   t   FalseR   (    (    (    s,   /usr/lib/python2.6/encodings/quopri_codec.pyR   2   s   t   IncrementalDecoderc           B   s   e  Z e d  „ Z RS(   c         C   s   t  | |  i ƒ d S(   Ni    (   R   R	   (   R   R   R   (    (    s,   /usr/lib/python2.6/encodings/quopri_codec.pyR   7   s    (   R   R   R   R   (    (    (    s,   /usr/lib/python2.6/encodings/quopri_codec.pyR   6   s   t   StreamWriterc           B   s   e  Z RS(    (   R   R   (    (    (    s,   /usr/lib/python2.6/encodings/quopri_codec.pyR   :   s   t   StreamReaderc           B   s   e  Z RS(    (   R   R   (    (    (    s,   /usr/lib/python2.6/encodings/quopri_codec.pyR   =   s   c           C   s4   t  i d d d t d t d t d t d t d t ƒ S(	   Nt   nameR   R   R   t   incrementalencodert   incrementaldecodert   streamwritert   streamreader(   t   codecst	   CodecInfoR   R   R   R   R   R   (    (    (    s,   /usr/lib/python2.6/encodings/quopri_codec.pyt   getregentryB   s    	(   t   __doc__R   R   t	   cStringIOR    t   ImportErrorR   R   R   R   R   R   R   R!   (    (    (    s,   /usr/lib/python2.6/encodings/quopri_codec.pyt   <module>   s   