‡Æ
äÞ?:c       ss   d  Z  d Z d Z d Z d „  Z d „  Z d „  Z d „  Z d „  Z d	 „  Z	 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    sC   |  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	   quotetabss5   /home/guest/edwardam/cmp2/py2/lib/python2.0/quopri.pys   needsquoting s     	c    s,   t  |  ƒ } t t | d t | d Sd S(   s   Quote a single character.i   N(   s   ords   cs   is   ESCAPEs   HEX(   s   cs   is5   /home/guest/edwardam/cmp2/py2/lib/python2.0/quopri.pys   quote s     c    s!  xd o|  i ƒ  } | o Pn d } | d } | d j o | d  } n d } d } x| | d rr } t | | ƒ o t	 | ƒ } n t
 | ƒ t
 | ƒ t j o | i | t d ƒ d } n | | } | } qe W| d d f j o | i | t d ƒ n | 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   cs5   /home/guest/edwardam/cmp2/py2/lib/python2.0/quopri.pys   encode s0      	 


c    s#  d } xþd oö|  i ƒ  } | o Pn d t | ƒ f \ } } | d j o | | d d j oN d } | d } x7 | d j o | | d d d f j o | d } qv Wn d } x%| | j  o| | } | t	 j o | | } | d } nå | d | j o | o d } PnÁ | d | j  o | | d t	 j o | t	 } | d } nƒ | d | j  o' t
 | | d ƒ o t
 | | d ƒ o3 | t t | | d | d !ƒ ƒ } | d } n | | } | d } qº W| o | i | d ƒ d } n q	 W| o | 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   cs5   /home/guest/edwardam/cmp2/py2/lib/python2.0/quopri.pys   decode6 s>       " ( 
&;3c    s[   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   cs5   /home/guest/edwardam/cmp2/py2/lib/python2.0/quopri.pys   ishexX s     c    sÌ   d } x» |  d r± } d | j o
 d j n o t d ƒ } nf d | j o
 d j n o t d ƒ d } n4 d | j o
 d j n o t d ƒ d } n P| d	 t | ƒ | } q W| 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   is5   /home/guest/edwardam/cmp2/py2/lib/python2.0/quopri.pys   unhex\ s     	 c     sû  d  k  }  d  k } y# | i |  i d d ƒ \ } } WnE | i j
 o6 } |  i |  _ | GHd GHd GHd GH|  i	 d ƒ n Xd } d } xD | d r: \ } } | d j o
 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 } nL y t |
 ƒ } Wn8 t j
 o, } |  i i d |
 | f ƒ d }	 q$n X| o t | |  i ƒ n t | |  i | ƒ | |  i j	 o | i ƒ  n q$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   fps5   /home/guest/edwardam/cmp2/py2/lib/python2.0/quopri.pys   testk sV    		#	  
  	 s   __main__N(   s   __doc__s   ESCAPEs   MAXLINESIZEs   HEXs   needsquotings   quotes   encodes   decodes   ishexs   unhexs   tests   __name__(    s5   /home/guest/edwardam/cmp2/py2/lib/python2.0/quopri.pys   ? s   				"			*