‡Æ
øMö9c       s     d  Z    d Z  d Z 	 d Z  d „  Z  d „  Z  d „  Z 6 d „  Z X d „  Z \ d	 „  Z	 k d
 „  Z
 • e d j o – e
 ƒ  n d S(   sH   Conversions to/from quoted-printable transport encoding as per RFC-1521.s   =iL   s   0123456789ABCDEFc    sR      |  d j o  | Sn  |  t j p d |  j o
 d j n Sd S(   s|   Decide whether a particular character needs to be quoted.

    The 'quotetabs' flag indicates whether tabs should be quoted.s   	s    s   ~N(   s   cs	   quotetabss   ESCAPE(   s   cs	   quotetabss#   /mit/python/lib/python2.0/quopri.pys   needsquoting s   c    s8      t  |  ƒ }  t t | d t | d Sd S(   s   Quote a single character.i   N(   s   ords   cs   is   ESCAPEs   HEX(   s   cs   is#   /mit/python/lib/python2.0/quopri.pys   quote s   c    sl     x\ d oQ |  i ƒ  }   | o ! Pn " d } # | d } $ | d j o % | d  } n
 ' d } ( d } ) x” | d ) r‡ } * t | | ƒ o + t	 | ƒ } n , t
 | ƒ t
 | ƒ t j o% - | i | t d ƒ . d } n / | | } 0 | } q W1 | d d f j o 2 | i | t d ƒ n 4 | i | d ƒ q Wd S(	   sÒ   Read 'input', apply quoted-printable encoding, and write to 'output'.

    'input' and 'output' are files with readline() and write() methods.
    The 'quotetabs' flag indicates whether tabs should be quoted.
	i   s    s   
i    s    s   	s   

N(   s   inputs   readlines   lines   news   lasts   prevs   cs   needsquotings	   quotetabss   quotes   lens   MAXLINESIZEs   outputs   writes   ESCAPE(   s   inputs   outputs	   quotetabss   lines   news   lasts   prevs   cs#   /mit/python/lib/python2.0/quopri.pys   encode s0    
			 	 c    sƒ  6 9 : d } ; xL; d oA< |  i ƒ  } = | o = Pn > d t | ƒ f \ } } ? | d j o | | d d j oZ @ d } | d } B x= B | d j o | | d d d f j o C | d } qš Wn
 E d } F xFF | | j  o5G | | } H | t	 j o I | | } | d } nú J | d | j o | o K d } PnÐ L | d | j  o | | d t	 j o M | t	 } | d } nŒ N | d | j  o' t
 | | d ƒ o t
 | | d ƒ o6 O | t t | | d | d !ƒ ƒ } | d } n Q | | } | d } qê WR | o! S | i | d ƒ T d } n q WU | o V | i | ƒ n d	 S(
   sŽ   Read 'input', apply quoted-printable decoding, and write to 'output'.

    'input' and 'output' are files with readline() and write() methods.s    i   i    s   
s    s   	i   i   N(   s   news   inputs   readlines   lines   lens   is   ns   partials   cs   ESCAPEs   ishexs   chrs   unhexs   outputs   write(   s   inputs   outputs   news   lines   is   ns   partials   cs#   /mit/python/lib/python2.0/quopri.pys   decode6 s>   	 
 % +	 )>6
c    sd   X Y Z d |  j o
 d j n p9 d |  j o
 d j n p d |  j o
 d j n Sd S(   s8   Return true if the character 'c' is a hexadecimal digit.s   0s   9s   as   fs   As   FN(   s   c(   s   cs#   /mit/python/lib/python2.0/quopri.pys   ishexX s   c    sö   \ ] ^ d } _ xÖ |  d _ rÉ } ` d | j o
 d j n o a t d ƒ } nu b d | j o
 d j n o c t d ƒ d } n= d d | j o
 d j n o e t d ƒ d } n g Ph | d	 t | ƒ | } q Wi | Sd
 S(   s.   Get the integer value of a hexadecimal number.i    s   0s   9s   as   fi
   s   As   Fi   N(   s   bitss   ss   cs   ords   i(   s   ss   bitss   cs   is#   /mit/python/lib/python2.0/quopri.pys   unhex\ s   	 	!!!c     s  k l d  k  }  m d  k } n y& o | i |  i d d ƒ \ } } WnZ p | i j
 oH } q |  i |  _ r | GHs d GHt d GHu d GHv |  i	 d ƒ n Xw d } x d } y xS | d y rF \ } } z | d j o z d } n { | d	 j o { d } n q¿ W| | o | o+ } |  i |  _ ~ d
 GH |  i	 d ƒ n € | o € d g } n  d }	 ‚ xë | d ‚ rÞ }
 ƒ |
 d j o „ |  i } n^ † y ‡ t |
 ƒ } WnD ˆ t j
 o5 } ‰ |  i i d |
 | f ƒ Š d }	 ‹ qxn XŒ | o  t | |  i ƒ n  t | |  i | ƒ  | |  i j	 o ‘ | i ƒ  n qxW’ |	 o “ |  i	 |	 ƒ n d  S(   Ni   s   tds"   usage: quopri [-t | -d] [file] ...s   -t: quote tabss   -d: decode; default encodei   i    s   -ts   -ds    -t and -d are mutually exclusives   -s   %s: can't open (%s)
(   s   syss   getopts   argvs   optss   argss   errors   msgs   stderrs   stdouts   exits   decos   tabss   os   as   stss   files   stdins   fps   opens   IOErrors   writes   decodes   encodes   close(   s   syss   getopts   optss   argss   msgs   decos   tabss   os   as   stss   files   fps#   /mit/python/lib/python2.0/quopri.pys   testk sV   &		    	 		

s   __main__N(   s   __doc__s   ESCAPEs   MAXLINESIZEs   HEXs   needsquotings   quotes   encodes   decodes   ishexs   unhexs   tests   __name__(    s#   /mit/python/lib/python2.0/quopri.pys   ? s   			"*