
Qc           @   s  d  d l  Z  d  d l Z d  d l Z d Z d Z d Z e  j d k rR e d 7Z n  d Z i d d 6d	 d
 6d d 6d d	 6d d 6d d 6d d 6d d 6Z d   Z	 e
 d k ri d d 6d d 6d d 6d d 6d d 6d d 6Z d  d d!  Z d"   Z d#   Z d$   Z d% d& d' d(  Z e   \ Z Z Z Z e e  \ Z Z e e  \ Z Z e e  \ Z Z e d)  e e d)  Z e e  Z e  j d k re e 7Z n  e e k rd* e j d+  GHd, e j d+  GHn  e rd- e j d+  GHn  e e k r#d. e j d+  GHd/ e j d+  GHn  e r>d0 e j d+  GHn  e e k rqd1 e j d+  GHd2 e j d+  GHn  e e k rd3 e j d+  GHd4 e j d+  GHn  e e e  d5 d6 GHe e e  d5 d7 GHe e e  d5 d8 GHd9 GHe e e  d5 d: GHd; Ge e  GHn  d S(<   iNu  "'(<\[{༺༼᚛⁅⁽₍〈❨❪❬❮❰❲❴⟅⟦⟨⟪⟬⟮⦃⦅⦇⦉⦋⦍⦏⦑⦓⦕⦗⧘⧚⧼⸢⸤⸦⸨〈《「『【〔〖〘〚〝〝﴾︗︵︷︹︻︽︿﹁﹃﹇﹙﹛﹝（［｛｟｢«‘“‹⸂⸄⸉⸌⸜⸠‚„»’”›⸃⸅⸊⸍⸝⸡‛‟u  "')>\]}༻༽᚜⁆⁾₎〉❩❫❭❯❱❳❵⟆⟧⟩⟫⟭⟯⦄⦆⦈⦊⦌⦎⦐⦒⦔⦖⦘⧙⧛⧽⸣⸥⸧⸩〉》」』】〕〗〙〛〞〟﴿︘︶︸︺︼︾﹀﹂﹄﹈﹚﹜﹞）］｝｠｣»’”›⸃⸅⸊⸍⸝⸡‛‟«‘“‹⸂⸄⸉⸌⸜⸠‚„u&  \-/:֊¡·¿;·՚-՟։־׀׃׆׳״؉؊،؍؛؞؟٪-٭۔܀-܍߷-߹࠰-࠾।॥॰෴๏๚๛༄-༒྅࿐-࿔၊-၏჻፡-፨᐀᙭᙮᛫-᛭᜵᜶។-៖៘-៚᠀-᠊᥄᥅᧞᧟᨞᨟᪠-᪦᪨-᪭᭚-᭠᰻-᰿᱾᱿᳓‐-‗†-‧‰-‸※-‾⁁-⁃⁇-⁑⁓⁕-⁞⳹-⳼⳾⳿⸀⸁⸆-⸈⸋⸎-⸛⸞⸟⸪-⸮⸰⸱、-〃〜〰〽゠・꓾꓿꘍-꘏꙳꙾꛲-꛷꡴-꡷꣎꣏꣸-꣺꤮꤯꥟꧁-꧍꧞꧟꩜-꩟꫞꫟꯫︐-︖︙︰-︲﹅﹆﹉-﹌﹐-﹒﹔-﹘﹟-﹡﹣﹨﹪﹫！-＃％-＇＊，-／：；？＠＼｡､･i uL   𐄀𐄁𐎟𐏐𐡗𐤟𐤿𐩐-𐩘𐩿𐬹-𐬿𑂻𑂼𑂾-𑃁𒑰-𒑳u   \\.,;!?u   »u   ‚u   ‘u   ’u   ‘’u   „u   “u   “”u   ”u   ›c         C   sN   y t  j |   } Wn t k
 r' t SX| t | k pM | t j |  d  k S(   Nt    (   t   openerst   indext
   ValueErrort   Falset   closerst   quote_pairst   get(   t   c1t   c2t   i(    (    sD   /usr/lib/python2.7/dist-packages/docutils/utils/punctuation_chars.pyt   match_charse   s
    t   __main__t   Dasht   Pdt   Opent   Pst   Closet   Pes   Initial quotet   Pis   Final quotet   Pft   Othert   Poi    c            s   | d k r8 t   f d   t t j d  D  } n  i  } xY   D]Q } g  t | | d  D]- } t j t |   | k r_ t |  ^ q_ | | <qE W| S(   s  Return dictionary of Unicode character lists.

        For each of the `catagories`, an item contains a list with all Unicode
        characters with `cp_min` <= code-point <= `cp_max` that belong to
        the category.

        The default values check every code-point supported by Python
        (`sys.maxint` is 0x10FFFF in a "wide" build and 0xFFFF in a "narrow"
        build, i.e. ucs4 and ucs2 respectively).
        c         3   s0   |  ]& } t  j t |     k r | Vq d  S(   N(   t   unicodedatat   categoryt   unichr(   t   .0t   x(   t
   categories(    sD   /usr/lib/python2.7/dist-packages/docutils/utils/punctuation_chars.pys	   <genexpr>   s    i   N(   t   Nonet   maxt   xranget   syst
   maxunicodeR   R   R   (   R   t   cp_mint   cp_maxt	   charlistst   catR   (    (   R   sD   /usr/lib/python2.7/dist-packages/docutils/utils/punctuation_chars.pyt   unicode_charlists   s    ,5c          C   s\  d }  t  t |   } | d j d  | d j d  | d c d d g 7<| d j d  | d j d  | d c d d g 7<| d j | d	 j d
  d  d g } x d D] } | j | |  q Wd g } x d D] } | j | |  q Wd g } x d D] } | j | |  qWd g } g  | | | | f D] } d j |  ^ qCS(   s   Docutils punctuation category sample strings.

        Return list of sample strings for the categories "Open", "Close",
        "Delimiters" and "Closing-Delimiters" used in the `inline markup
        recognition rules`_.
        i   R   u   ‚u   „R   u   ‛u   ‟R   R   u   〟u   〝u   "'(<\[{u   "')>\]}u   \-/:R   R   s   \\.,;!?u    (   R   R   R   (   R   R   R   (   R   R   (   R&   t   unicode_punctuation_categoriest   removet   insertR   t   extendt   join(   R"   t
   ucharlistsR   R%   R   t
   delimiterst   closing_delimiterst   chars(    (    sD   /usr/lib/python2.7/dist-packages/docutils/utils/punctuation_chars.pyt   punctuation_samples   s*    
	!				c         C   sx   d } g  |  D] } t  |  | k r | ^ q } g  |  D] } t  |  | k r8 | ^ q8 } d j |  d j |  f S(   s1   Return (s1,s2) with characters above 0xFFFF in s2i  R    (   t   ordR+   (   t   st   maxunicode_narrowt   cht   l1t   l2(    (    sD   /usr/lib/python2.7/dist-packages/docutils/utils/punctuation_chars.pyt   separate_wide_chars   s    ++c         C   s   g  } g  |  D] } t  |  ^ q }  |  j   xr |  D]j } y@ | d d d | k rk | d j |  n | j | g  Wq6 t k
 r | j | g  q6 Xq6 Wg  } xf | D]^ } g  | D] } t |  ^ q } t |  d k r| d d | d f } n  | j |  q Wd j |  S(   s   Return s with shortcut notation for runs of consecutive characters

        Sort string and replace 'cdef' by 'c-f' and similar.
        ii   i   i    u   -R    (   R1   t   sortt   appendt
   IndexErrorR   t   lenR*   R+   (   R2   t   lR4   t   nR6   R
   (    (    sD   /usr/lib/python2.7/dist-packages/docutils/utils/punctuation_chars.pyt   mark_intervals   s"    
t   (t   )iA   c         C   s   t  |  } d d t  |  d } | g } xV |  D]N } | d 7} | d k ru | | k ru t  |  } | | } n  | j |  q4 W| j |  d j |  S(   s.   Line-wrap a unicode string literal definition.s   '
t    s   u'i   s   \R    (   R;   R9   R+   (   R2   t   startstringt	   endstringt   wrapt   ct
   contstringR<   R4   (    (    sD   /usr/lib/python2.7/dist-packages/docutils/utils/punctuation_chars.pyt   wrap_string  s    	
i   s   - openers = ur"""%s"""t   utf8s   + openers = ur"""%s"""s   + openers-wide = ur"""%s"""s   - closers = ur"""%s"""s   + closers = ur"""%s"""s   + closers-wide = ur"""%s"""s   - delimiters = ur"%s"s   + delimiters = ur"%s"s   - closing_delimiters = ur"%s"s   + closing_delimiters = ur"%s"RB   s   openers = (s   closers = (s   delimiters = (s-   if sys.maxunicode >= 0x10FFFF: # "wide" builds       delimiters += (s   closing_delimiters =(   R    t   reR   R   R   R-   R!   R.   R   R   t   __name__R'   R   R&   R0   R7   R>   RG   t   oRE   t   dt   cdt   o_widet   c_widet   d_widet   encodet   repr(    (    (    sD   /usr/lib/python2.7/dist-packages/docutils/utils/punctuation_chars.pyt   <module>   sx   




	
	E		