Ñò
#8Zc           @   s  d  d k  Z  d  d k Z d  d k Z d  d k l Z e i d ƒ Z d Z e e d ƒ Z	 d „  Z
 d „  Z 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(   iÿÿÿÿN(   t	   ucd_3_2_0u   [.ã€‚ï¼Žï½¡]s   xn--t   asciic         C   s—  g  } x; |  D]3 } t  i | ƒ o q n | i t  i | ƒ ƒ q Wd i | ƒ }  t i d |  ƒ }  x² |  D]ª } t  i | ƒ p€ t  i | ƒ pp t  i	 | ƒ p` t  i
 | ƒ pP t  i | ƒ p@ t  i | ƒ p0 t  i | ƒ p  t  i | ƒ p t  i | ƒ o t d | ƒ ‚ ql ql Wt t  i |  ƒ } xd | D]\ } | oO t t  i |  ƒ o t d ƒ ‚ n | d p | d o t d ƒ ‚ qq3q3W|  S(   Nu    t   NFKCs   Invalid character %rs   Violation of BIDI requirement 2i    iÿÿÿÿs   Violation of BIDI requirement 3(   t
   stringprept   in_table_b1t   appendt   map_table_b2t   joint   unicodedatat	   normalizet   in_table_c12t   in_table_c22t   in_table_c3t   in_table_c4t   in_table_c5t   in_table_c6t   in_table_c7t   in_table_c8t   in_table_c9t   UnicodeErrort   mapt   in_table_d1t   filtert   in_table_d2(   t   labelt   newlabelt   ct   RandAL(    (    s$   /usr/lib/python2.6/encodings/idna.pyt   nameprep   s:       c      	   C   s:  y |  i  d ƒ }  Wn t j
 o n7 Xd t |  ƒ j  o
 d j  n o |  St d ƒ ‚ t |  ƒ }  y |  i  d ƒ }  Wn t j
 o n7 Xd t |  ƒ j  o
 d j  n o |  St d ƒ ‚ |  i t ƒ o t d ƒ ‚ n |  i  d ƒ }  t |  }  d t |  ƒ j  o
 d j  n o |  St d ƒ ‚ d  S(   NR   i    i@   s   label empty or too longs   Label starts with ACE prefixt   punycode(   t   encodeR   t   lenR   t
   startswitht   uace_prefixt
   ace_prefix(   R   (    (    s$   /usr/lib/python2.6/encodings/idna.pyt   ToASCII>   s,    $$
$c         C   s  t  |  t ƒ o
 t } n6 y |  i d ƒ }  t } Wn t j
 o t } n X| pE t |  ƒ }  y |  i d ƒ }  Wq› t j
 o t d ƒ ‚ q› Xn |  i t ƒ p t	 |  d ƒ S|  t
 t ƒ } | i d ƒ } t | ƒ } |  i ƒ  | j o t d |  | ƒ ‚ n | S(   NR   s   Invalid character in IDN labelR   s   IDNA does not round-trip(   t
   isinstancet   strt   TrueR   R   t   FalseR   R    R"   t   unicodeR   t   decodeR#   t   lower(   R   t
   pure_asciit   label1t   resultt   label2(    (    s$   /usr/lib/python2.6/encodings/idna.pyt	   ToUnicodei   s*    

t   Codecc           B   s    e  Z d  d „ Z d  d „ Z RS(   t   strictc         C   s¸   | d j o t  d | ƒ ‚ n | p d Sg  } t i | ƒ } | o( t | d ƒ d j o d } | d =n d } x! | D] } | i t | ƒ ƒ q~ Wd i | ƒ | t | ƒ f S(   NR1   s   unsupported error handling t    i    iÿÿÿÿt   .(   R2   i    (   R   t   dotst   splitR   R   R#   R   (   t   selft   inputt   errorsR-   t   labelst   trailing_dotR   (    (    s$   /usr/lib/python2.6/encodings/idna.pyR   “   s     c         C   sô   | d j o t  d | ƒ ‚ n | p d	 St | t ƒ o t i | ƒ } n) t | ƒ } t | d ƒ | i d ƒ } | o( t | d ƒ d j o d } | d =n d } g  } x! | D] } | i t | ƒ ƒ qº Wd i	 | ƒ | t | ƒ f S(
   NR1   s   Unsupported error handling u    i    R   R3   iÿÿÿÿu   .(   u    i    (
   R   R$   R(   R4   R5   R%   R   R   R/   R   (   R6   R7   R8   R9   R:   R-   R   (    (    s$   /usr/lib/python2.6/encodings/idna.pyR)   ¨   s$     (   t   __name__t
   __module__R   R)   (    (    (    s$   /usr/lib/python2.6/encodings/idna.pyR0   ’   s   t   IncrementalEncoderc           B   s   e  Z d  „  Z RS(   c   	      C   s  | d j o t  d | ƒ ‚ n | p d	 St i | ƒ } d } | oC | d p d } | d =qŒ | p | d =| o
 d } qˆ qŒ n g  } d } xF | D]> } | i t | ƒ ƒ | o | d 7} n | t | ƒ 7} qŸ Wd i | ƒ | } | t | ƒ 7} | | f S(
   NR1   s   unsupported error handling R2   i    u    iÿÿÿÿR3   i   (   R2   i    (   R   R4   R5   R   R#   R   R   (	   R6   R7   R8   t   finalR9   R:   R-   t   sizeR   (    (    s$   /usr/lib/python2.6/encodings/idna.pyt   _buffer_encodeÆ   s2     (   R;   R<   R@   (    (    (    s$   /usr/lib/python2.6/encodings/idna.pyR=   Å   s   t   IncrementalDecoderc           B   s   e  Z d  „  Z RS(   c   	      C   sJ  | d j o t  d | ƒ ‚ n | p d
 St | t ƒ o t i | ƒ } n) t | ƒ } t | d ƒ | i d ƒ } d } | oC | d p d } | d =qÈ | p | d =| o
 d } qÄ qÈ n g  } d } xF | D]> } | i t | ƒ ƒ | o | d	 7} n | t | ƒ 7} qÛ Wd i	 | ƒ | } | t | ƒ 7} | | f S(   NR1   s   Unsupported error handling u    i    R   R3   iÿÿÿÿu   .i   (   u    i    (
   R   R$   R(   R4   R5   R%   R   R/   R   R   (	   R6   R7   R8   R>   R9   R:   R-   R?   R   (    (    s$   /usr/lib/python2.6/encodings/idna.pyt   _buffer_decodeè   s:     (   R;   R<   RB   (    (    (    s$   /usr/lib/python2.6/encodings/idna.pyRA   ç   s   t   StreamWriterc           B   s   e  Z RS(    (   R;   R<   (    (    (    s$   /usr/lib/python2.6/encodings/idna.pyRC     s   t   StreamReaderc           B   s   e  Z RS(    (   R;   R<   (    (    (    s$   /usr/lib/python2.6/encodings/idna.pyRD     s   c           C   s@   t  i d d d t ƒ  i d t ƒ  i d t d t d t d t ƒ S(	   Nt   namet   idnaR   R)   t   incrementalencodert   incrementaldecodert   streamwritert   streamreader(	   t   codecst	   CodecInfoR0   R   R)   R=   RA   RC   RD   (    (    (    s$   /usr/lib/python2.6/encodings/idna.pyt   getregentry  s    	(   R   t   reRK   R   R    t   compileR4   R"   R(   R!   R   R#   R/   R0   t   BufferedIncrementalEncoderR=   t   BufferedIncrementalDecoderRA   RC   RD   RM   (    (    (    s$   /usr/lib/python2.6/encodings/idna.pyt   <module>   s   $	0	+	)3"(