
\c           @@  s]  d  Z  d d l m Z d d l Z d d l Z d d l Z d d l Z d d l Z d d l Z d d l	 Z	 d d l
 Z
 d d l Z d d l m Z d d l m Z d d l m Z d d l m Z d d l m Z d d	 l m Z m Z d d
 l m Z d d l m Z m Z m Z d d l m Z d d l m  Z  m! Z! m" Z" m# Z# m$ Z$ d d l% m& Z& d d l' m( Z( m) Z) m* Z* d d l+ m, Z, d d l- m. Z. m/ Z/ m0 Z0 m1 Z1 d d l2 m3 Z3 d d l4 m5 Z5 d d l+ m6 Z6 d d l4 m7 Z7 m8 Z8 m9 Z9 m: Z: m; Z; m< Z< m= Z= m> Z> m? Z? m@ Z@ mA ZA d d lB mC ZC mD ZD mE ZE mF ZF d d lG mH ZH eI rd d lJ mK ZK mL ZL mM ZM mN ZN mO ZO mP ZP mQ ZQ mR ZR mS ZS mT ZT mU ZU mV ZV n  e, jW eX  ZY e jZ d  Z[ e jZ d  Z\ d   Z] d   Z^ d@ d  Z_ dA d  Z` d ea f d      YZb d! ea f d"     YZc i  dB d d#  Zd d$ Ze d%   Zf d&   Zg d'   Zh e jZ d(  Zi d)   Zj d* ek f d+     YZl d,   Zm d-   Zn d. ea f d/     YZo d0   Zp d1   Zq d2   Zr d3 d4  Zs d5 ek f d6     YZt d d7  Zv d8   Zw d9   Zx d: ex d;  Zy d: d d ex d<  Zz d=   Z{ d>   Z| d?   Z} d S(C   s   
    sphinx.util
    ~~~~~~~~~~~

    Utility functions for Sphinx.

    :copyright: Copyright 2007-2019 by the Sphinx team, see AUTHORS.
    :license: BSD, see LICENSE for details.
i    (   t   absolute_importN(   t   BOM_UTF8(   t   deque(   t   datetime(   t   md5(   t   path(   t   mktimet   strptime(   t   relative_path(   t	   text_typet   binary_typet
   itervalues(   t   range(   t   urlsplitt
   urlunsplitt
   quote_plust	   parse_qslt	   urlencode(   t   RemovedInSphinx30Warning(   t   PycodeErrort   SphinxParallelErrort   ExtensionError(   t   logging(   t   strip_colorst   colorizet   boldt   term_width_line(   t   copy_asset_file(   t   fs_encoding(   t   smartypants(   t   SEPt   os_patht   relative_urit	   ensuredirt   walkt   mtimes_of_filest   movefilet   copyfilet	   copytimest   make_filenamet	   ustrftime(   t   nested_parse_with_titlest   split_explicit_titlet   explicit_title_ret   caption_ref_re(   t	   patfilter(   t   Anyt   Callablet   Dictt   IOt   Iterablet   Iteratort   Listt   Patternt   Sequencet   Sett   Tuplet   Unions   \s+s   (?P<schema>.+)://.*c         C@  s$   t  j t  j d |  d |   d S(   Nt   /s   ..i   (   t	   posixpatht   normpatht   join(   t   basedocnamet   docname(    (    s3   lib/python2.7/site-packages/sphinx/util/__init__.pyt   docname_joinB   s    c         C@  s@   |  j  t j j t  } t | t  r< t j d |  } n  | S(   s+   normalize path separater and unicode stringt   NFC(	   t   replacet   osR   t   sepR   t
   isinstanceR	   t   unicodedatat	   normalize(   t   filepatht   newpath(    (    s3   lib/python2.7/site-packages/sphinx/util/__init__.pyt   path_stabilizeH   s    c         #@  s6  t  j t  j |    }  t |   d } xt |  d t D] \ }   } | |  t  f d     D  } t  f d   | D  } x` | D]X } g  | D] } | | d  s | ^ q } g  | D] } | | d  s | ^ q } q Wt   f d   | D    (x t |  D] \ }	 }
 |
 VqWq; Wd S(   s}   Get all file names in a directory, recursively.

    Exclude files and dirs matching some matcher in *exclude_matchers*.
    i   t   followlinksc         3@  s'   |  ] } t  t j   |   Vq d  S(   N(   RJ   R   R=   (   t   .0t   dn(   t   relativeroot(    s3   lib/python2.7/site-packages/sphinx/util/__init__.pys	   <genexpr>^   s   c         3@  s'   |  ] } t  t j   |   Vq d  S(   N(   RJ   R   R=   (   RL   t   fn(   RN   (    s3   lib/python2.7/site-packages/sphinx/util/__init__.pys	   <genexpr>`   s   c         3@  s   |  ] \ } }   | Vq d  S(   N(    (   RL   t   it   _(   t   dirs(    s3   lib/python2.7/site-packages/sphinx/util/__init__.pys	   <genexpr>f   s    N(   R   R<   t   abspatht   lenR"   t   Truet	   enumeratet   sorted(   t   dirnamet   exclude_matcherst   dirlent   roott   filest   qdirst   qfilest   matchert   entryRP   t   filename(    (   RR   RN   s3   lib/python2.7/site-packages/sphinx/util/__init__.pyt   get_matching_filesQ   s    "
)-c         c@  sv   g  | D] } d | ^ q } xR t  |  |  D]A } x8 | D]0 } t j | |  r: | t |  d  VPq: q: Wq- Wd S(   s   Get all file names (without suffixes) matching a suffix in a directory,
    recursively.

    Exclude files and dirs matching a pattern in *exclude_patterns*.
    t   *i   N(   Rb   t   fnmatchRT   (   RX   t   suffixesRY   t   st   suffixpatternsRa   t   suffixpattern(    (    s3   lib/python2.7/site-packages/sphinx/util/__init__.pyt   get_matching_docsl   s    t   FilenameUniqDictc           B@  sD   e  Z d  Z d   Z d   Z d   Z d   Z d   Z d   Z RS(   s   
    A dictionary that automatically generates unique names for its keys,
    interpreted as filenames, and keeps track of a set of docnames they
    appear in.  Used for images and downloadable files in the environment.
    c         C@  s   t    |  _ d  S(   N(   t   sett	   _existing(   t   self(    (    s3   lib/python2.7/site-packages/sphinx/util/__init__.pyt   __init__   s    c         C@  s   | |  k r- |  | d j  |  |  | d St j |  } t j |  \ } } d } x0 | |  j k r | d 7} d | | | f } qZ Wt | g  | f |  | <|  j j  |  | S(   Ni    i   s   %s%s%s(   t   addR   t   basenamet   splitextRl   Rk   (   Rm   R?   t   newfilet
   uniquenamet   baset   extRP   (    (    s3   lib/python2.7/site-packages/sphinx/util/__init__.pyt   add_file   s    
c         C@  sZ   xS t  |  j    D]? \ } \ } } | j |  | s |  | =|  j j |  q q Wd  S(   N(   t   listt   itemst   discardRl   (   Rm   R?   Ra   t   docst   unique(    (    s3   lib/python2.7/site-packages/sphinx/util/__init__.pyt	   purge_doc   s
    %c         C@  sR   xK | j    D]= \ } \ } } x( | t |  @D] } |  j | |  q0 Wq Wd  S(   N(   Rx   Rk   Rv   (   Rm   t   docnamest   otherRa   Rz   R{   t   doc(    (    s3   lib/python2.7/site-packages/sphinx/util/__init__.pyt   merge_other   s    c         C@  s   |  j  S(   N(   Rl   (   Rm   (    (    s3   lib/python2.7/site-packages/sphinx/util/__init__.pyt   __getstate__   s    c         C@  s   | |  _  d  S(   N(   Rl   (   Rm   t   state(    (    s3   lib/python2.7/site-packages/sphinx/util/__init__.pyt   __setstate__   s    (	   t   __name__t
   __module__t   __doc__Rn   Rv   R|   R   R   R   (    (    (    s3   lib/python2.7/site-packages/sphinx/util/__init__.pyRj   {   s   					t   DownloadFilesc           B@  s)   e  Z d  Z d   Z d   Z d   Z RS(   s   A special dictionary for download files.

    .. important:: This class would be refactored in nearly future.
                   Hence don't hack this directly.
    c         C@  sz   | |  k rY t  | j d   j   } d | t j j |  f } t   | f |  | <n  |  | d j |  |  | d S(   Ns   utf-8s   %s/%si    i   (   R   t   encodet	   hexdigestRC   R   Rp   Rk   Ro   (   Rm   R?   Ra   t   digestt   dest(    (    s3   lib/python2.7/site-packages/sphinx/util/__init__.pyRv      s    c         C@  sJ   xC t  |  j    D]/ \ } \ } } | j |  | s |  | =q q Wd  S(   N(   Rw   Rx   Ry   (   Rm   R?   Ra   Rz   R   (    (    s3   lib/python2.7/site-packages/sphinx/util/__init__.pyR|      s    %c         C@  sR   xK | j    D]= \ } \ } } x( | t |  @D] } |  j | |  q0 Wq Wd  S(   N(   Rx   Rk   Rv   (   Rm   R}   R~   Ra   Rz   R   R?   (    (    s3   lib/python2.7/site-packages/sphinx/util/__init__.pyR      s    (   R   R   R   Rv   R|   R   (    (    (    s3   lib/python2.7/site-packages/sphinx/util/__init__.pyR      s   	
	c   
   
   C@  sO  t  j d t d d | r^ t t j | j d  |   } x! | D] } | |  rA d SqA Wn  t j |   r t |  | | | j	  n t j
 |   rKt j
 |  s t j |  n  x t j |   D] } | j d  r q n  | }	 t j
 t j |  |   rt j | |  }	 n  t t j |  |  |	 | | d | d d	 | q Wn  d S(
   s   [DEPRECATED] Copy a HTML builder static_path entry from source to targetdir.

    Handles all possible cases of files, directories and subdirectories.
    s7   sphinx.util.copy_static_entry is deprecated for removalt
   stackleveli   t   dummyNt   .t   leveli   RY   (   t   warningst   warnR   R   R   R=   t   srcdirt   isfileR   t	   templatest   isdirRC   t   mkdirt   listdirt
   startswitht   copy_static_entry(
   t   sourcet	   targetdirt   buildert   contextRY   R   t   relpathR_   R`   t	   newtarget(    (    s3   lib/python2.7/site-packages/sphinx/util/__init__.pyR      s*    	s   # Sphinx version: %s
# Python version: %s (%s)
# Docutils version: %s %s
# Jinja2 version: %s
# Last messages:
%s
# Loaded extensions:
c      
   C@  s  d d l  } d d l } d d l } d d l } t j   d } t | t  r_ d | j } n t j	   } t
 j d d  \ } } d }	 |  d k	 r d j d	   |  j D  }	 n  t j | t | j | j   | j   | j | j | j |	 f j d
   |  d k	 rx t |  j  D]} }
 t |
 j d d  } t | t  rY| j t d  } n  |
 j d k rt j | d |
 j  |
 j | f j d
   qqWn  t j | | j d
   t j! |  | S(   s;   Save the current exception's traceback in a temporary file.i    Ni   s   (Error in parallel process)
s   .logs   sphinx-err-t    s   
c         s@  s.   |  ]$ } d  t  t | d   j   Vq d S(   s   #   %ss   utf-8N(   R   t   force_decodet   strip(   RL   Rf   (    (    s3   lib/python2.7/site-packages/sphinx/util/__init__.pys	   <genexpr>  s   s   utf-8t   __file__t   unknownRB   t   builtins   #   %s (%s) from %s
("   t   sphinxt   jinja2t   docutilst   platformt   syst   exc_infoRE   R   t	   tracebackt
   format_exct   tempfilet   mkstempt   NoneR=   t
   messagelogRC   t   writet   _DEBUG_HEADERt   __display_version__t   python_versiont   python_implementationt   __version__t   __version_details__R   R   t
   extensionst   getattrt   modulet   bytest   decodeR   t   versiont   namet   close(   t   appR   R   R   R   t   exct
   exc_formatt   fdR   t	   last_msgsRu   t   modfile(    (    s3   lib/python2.7/site-packages/sphinx/util/__init__.pyt   save_traceback   s@    		*c   	      C@  s  |  t  j k rI y t |   WqI t k
 rE } t d |  |   qI Xn  t  j |  } t | d d  } t | d d  } | r t | d d  r y | j |   } Wq t k
 r } t d | |   q Xn  | d k r2| r2y# | j |   } | rd | f SWq2t k
 r.} t d |  |   q2Xn  | d k rQt d |    n  t	 j
 t	 j |   } | j   } | j d	  s| j d
  r| d  } t	 j |  rgt	 j | d  rg| d 7} qgn | j d  p| j d  st d |   nf d t j	 j | k rgd t j t j	 j  } t j | | d  \ } } t	 j |  rgd | f Sn  t	 j |  st d |   n  d | f S(   s   Try to find the source code for a module.

    Can return ('file', 'filename') in which case the source is in the given
    file, or ('string', 'source') which which case the source is the string.
    s   error importing %rR   t
   __loader__t   get_filenames   error getting filename for %rt   strings   error getting source for %rs   no source found for module %rs   .pyos   .pycit   ws   .pys   .pyws   source is not a .py file: %rs   .eggs
   (?<=\.egg)i   t   files   source file is not present: %rN(   R   t   modulest
   __import__t	   ExceptionR   R   R   R   t
   get_sourceR   R<   RS   t   lowert   endswithR   RC   RD   t   ret   escapet   split(	   t   modnamet   errt   modRa   t   loadert	   lfilenamet   patt   eggpathRQ   (    (    s3   lib/python2.7/site-packages/sphinx/util/__init__.pyt   get_module_source  sL    
#c         C@  so   |  d  k r d  St |   t j |  } | } x/ | j d  D] } | r= t | |  } q= q= Wt | d d   S(   NR   R   (   R   R   R   R   R   R   (   R   t	   attributeR   t   valuet   attr(    (    s3   lib/python2.7/site-packages/sphinx/util/__init__.pyt   get_full_modnameJ  s    
s   coding[:=]\s*([-\w.]+)c         @  s    f d   } d       f d   } t  j   } |   } | rd | j t  rd | d } d } n  | sn | S| |  } | r | S|   } | s | S| |  } | r | S| S(   s@   Like tokenize.detect_encoding() from Py3k, but a bit simplified.c           @  s$   y     SWn t  k
 r d  SXd  S(   N(   t   StopIterationR   (    (   t   readline(    s3   lib/python2.7/site-packages/sphinx/util/__init__.pyt   read_or_stope  s    c         S@  s^   |  d  j    j d d  } | d k s7 | j d  r; d S| d k sV | j d  rZ d S|  S(   s(   Imitates get_normal_name in tokenizer.c.i   RQ   t   -s   utf-8s   utf-8-s   latin-1s
   iso-8859-1s   iso-latin-1s   latin-1-s   iso-8859-1-s   iso-latin-1-(   s   latin-1s
   iso-8859-1s   iso-latin-1(   s   latin-1-s   iso-8859-1-s   iso-latin-1-(   R   RB   R   (   t   orig_enct   enc(    (    s3   lib/python2.7/site-packages/sphinx/util/__init__.pyt   get_normal_namel  s    c         @  sO   y |  j  d  } Wn t k
 r' d  SXt j |  } | sA d  S  | d  S(   Nt   asciii    (   R   t   UnicodeDecodeErrorR   t
   _coding_ret   findall(   t   linet   line_stringt   matches(   R   (    s3   lib/python2.7/site-packages/sphinx/util/__init__.pyt   find_cookiex  s    i   s	   utf-8-sig(   R   t   getdefaultencodingR   R   (   R   R   R   t   defaultt   firstt   encodingt   second(    (   R   R   s3   lib/python2.7/site-packages/sphinx/util/__init__.pyt   detect_encodinga  s(    		
		t   Teec           B@  s)   e  Z d  Z d   Z d   Z d   Z RS(   s2   
    File-like object writing to two streams.
    c         C@  s   | |  _  | |  _ d  S(   N(   t   stream1t   stream2(   Rm   R   R   (    (    s3   lib/python2.7/site-packages/sphinx/util/__init__.pyRn     s    	c         C@  s$   |  j  j |  |  j j |  d  S(   N(   R   R   R   (   Rm   t   text(    (    s3   lib/python2.7/site-packages/sphinx/util/__init__.pyR     s    c         C@  sH   t  |  j d  r" |  j j   n  t  |  j d  rD |  j j   n  d  S(   Nt   flush(   t   hasattrR   R   R   (   Rm   (    (    s3   lib/python2.7/site-packages/sphinx/util/__init__.pyR     s    (   R   R   R   Rn   R   R   (    (    (    s3   lib/python2.7/site-packages/sphinx/util/__init__.pyR     s   		c         C@  s4  t    } |  j d  } x| D]} y | j   j d  } d d g | k rX t  n t |  d k r | j t | d  d  n t |  d k rt | d p d  } t | d p t | |   } | | k r t  n  | j t	 | d |   n t  Wq t
 k
 r+t d |    q Xq W| S(   s_   Parse a line number spec (such as "1,2,4-6") and return a list of
    wanted line numbers.
    t   ,R   R   i   i    i   s   invalid line number spec: %r(   Rw   R   R   t
   ValueErrorRT   t   appendt   intt   maxt   extendR   R   (   t   spect   totalRx   t   partst   partt   begendt   startt   end(    (    s3   lib/python2.7/site-packages/sphinx/util/__init__.pyt   parselinenos  s&    			
c         C@  sd   t  |  t  r` y+ | r* |  j |  }  n |  j d  }  Wq` t k
 r\ |  j d  }  q` Xn  |  S(   s2   Forcibly get a unicode string out of a bytestring.s   utf-8t   latin1(   RE   R
   R   t   UnicodeError(   R   R   (    (    s3   lib/python2.7/site-packages/sphinx/util/__init__.pyR     s    t   attrdictc           B@  s#   e  Z d    Z d   Z d   Z RS(   c         C@  s   |  | S(   N(    (   Rm   t   key(    (    s3   lib/python2.7/site-packages/sphinx/util/__init__.pyt   __getattr__  s    c         C@  s   | |  | <d  S(   N(    (   Rm   R  t   val(    (    s3   lib/python2.7/site-packages/sphinx/util/__init__.pyt   __setattr__  s    c         C@  s   |  | =d  S(   N(    (   Rm   R  (    (    s3   lib/python2.7/site-packages/sphinx/util/__init__.pyt   __delattr__  s    (   R   R   R  R  R  (    (    (    s3   lib/python2.7/site-packages/sphinx/util/__init__.pyR    s   		c         C@  sA   |  j  |  } | d k r7 |  |  |  | t |  f Sd |  f S(   sE   Similar to str.rpartition from 2.5, but doesn't return the separator.iR   (   t   rfindRT   (   Rf   t   tRP   (    (    s3   lib/python2.7/site-packages/sphinx/util/__init__.pyt
   rpartition  s    c         C@  sh   g  | j  d |  d  D] } | j   ^ q } t d   | D  |  k  rd t d | | f   n  | S(   s@   Split an index entry into a given number of parts at semicolons.t   ;i   c         s@  s   |  ] } | r d  Vq d S(   i   N(    (   RL   R  (    (    s3   lib/python2.7/site-packages/sphinx/util/__init__.pys	   <genexpr>  s    s   invalid %s index entry %r(   R   R   t   sumR   (   t   nt   typeR   t   xR  (    (    s3   lib/python2.7/site-packages/sphinx/util/__init__.pyt
   split_into  s    /c         C@  s   |  d k rK y t  d d |  } Wq t k
 rG t  d d |  } q Xn |  d k rl t  d d |  } ny |  d k r t  d d |  } nX |  d k r t  d d |  } n7 |  d k r t  d d |  } n t d	 |  | f   | S(
   Nt   singlei   i   t   pairt   triplei   t   seet   seealsos   invalid %s index entry %r(   R  R   (   R  R   t   result(    (    s3   lib/python2.7/site-packages/sphinx/util/__init__.pyt   split_index_msg  s    i   c         C@  s\   t  j   \ } } } g  } t j |  } | | |  7} | t j | |  7} d j |  S(   s?   Format an exception with traceback, but only the last x frames.R   (   R   R   R   t	   format_tbt   format_exception_onlyR=   (   R  t   typR  t   tbt   rest   tbres(    (    s3   lib/python2.7/site-packages/sphinx/util/__init__.pyt   format_exception_cut_frames  s    t   PeekableIteratorc           B@  sA   e  Z d  Z d   Z d   Z d   Z e Z d   Z d   Z RS(   sm   
    An iterator which wraps any iterable and makes it possible to peek to see
    what's the next item.
    c         C@  s   t    |  _ t |  |  _ d  S(   N(   R   t	   remainingt   itert	   _iterator(   Rm   t   iterable(    (    s3   lib/python2.7/site-packages/sphinx/util/__init__.pyRn   "  s    c         C@  s   |  S(   N(    (   Rm   (    (    s3   lib/python2.7/site-packages/sphinx/util/__init__.pyt   __iter__'  s    c         C@  s#   |  j  r |  j  j   St |  j  S(   s'   Return the next item from the iterator.(   R+  t   popleftt   nextR-  (   Rm   (    (    s3   lib/python2.7/site-packages/sphinx/util/__init__.pyt   __next__+  s    	c         C@  s   |  j  j |  d S(   sj   Push the `item` on the internal stack, it will be returned on the
        next :meth:`next` call.
        N(   R+  R   (   Rm   t   item(    (    s3   lib/python2.7/site-packages/sphinx/util/__init__.pyt   push4  s    c         C@  s   t  |   } |  j |  | S(   s@   Return the next item without changing the state of the iterator.(   R1  R4  (   Rm   R3  (    (    s3   lib/python2.7/site-packages/sphinx/util/__init__.pyt   peek;  s    (	   R   R   R   Rn   R/  R2  R1  R4  R5  (    (    (    s3   lib/python2.7/site-packages/sphinx/util/__init__.pyR*    s   				c         C@  s   y |  j  d d  \ } } Wn: t k
 rX } t d |  | rH d | pK d |   n Xy# t t | d  d  | g  |  SWns t k
 r } t d | | r d | p d |   n: t k
 r } t d |  | r d | p d |   n Xd  S(   NR   i   s   Invalid full object name %ss    (needed for %s)R   s   Could not import %ss   Could not find %s(   t   rsplitR   R   R   R   R   t   ImportErrort   AttributeError(   t   objnameR   R   R   R   (    (    s3   lib/python2.7/site-packages/sphinx/util/__init__.pyt   import_objectC  s     
#

c         C@  s   t  t |    } | d j d  j d  | d <t | d j d  d  | d <t  d   t | d  D  } t |  | d <t |  S(	   Ni   t   idnaR   i   s   utf-8R:   c         s@  s*   |  ]  \ } } | | j  d   f Vq d S(   s   utf-8N(   R   (   RL   t   qt   v(    (    s3   lib/python2.7/site-packages/sphinx/util/__init__.pys	   <genexpr>\  s    i   (   Rw   R   R   R   R   R   R   R   (   t   uriR   t   query(    (    s3   lib/python2.7/site-packages/sphinx/util/__init__.pyt
   encode_uriW  s       c         C@  sU   t  |  t t f  rK t |   d k r5 t |  d  Sd |  d |  d f St |   S(   Ni   i    s   %s .. %si(   RE   Rw   t   tupleRT   R	   (   t   chunk(    (    s3   lib/python2.7/site-packages/sphinx/util/__init__.pyt   display_chunka  s
    t	   darkgreenc         c@  s   d } xs |  D]k } | d k rA t  j t |  d t d } n  t  j | |  d | d t t  j d d t | Vq W| d k r t  j d  n  d  S(   Ni    t   nonli   t   colort    R   (   t   loggert   infoR   RU   (   R.  t   summaryRF  t   stringify_funct   lR3  (    (    s3   lib/python2.7/site-packages/sphinx/util/__init__.pyt   old_status_iteratorj  s    		c   	      c@  s   | d k r5 x" t  |  | | |  D] } | Vq" Wd  Sd } t |  } xy |  D]q } | d 7} d | d | | t | | |   f } | r | d 7} n t |  } t j | d t | VqN W| d k r t j d  n  d  S(   Ni    i   s   %s[%3d%%] %sid   s   
RE  R   (   RM  R   R   R   RH  RI  RU   (	   R.  RJ  RF  t   lengtht	   verbosityRK  R3  RL  Rf   (    (    s3   lib/python2.7/site-packages/sphinx/util/__init__.pyt   status_iteratory  s     	
*	c         C@  s<   d d l  m } t j |   } d } | | | d d d S(   s)   Convert datetime format epoch to RFC1123.i    (   t   format_datetimes   EEE, dd LLL yyyy hh:mm:sst   localet   ens    GMT(   t   babel.datesRQ  R   t   fromtimestamp(   t   epochRQ  t   dtt   fmt(    (    s3   lib/python2.7/site-packages/sphinx/util/__init__.pyt   epoch_to_rfc1123  s    c         C@  s   t  t |  d   S(   Ns   %a, %d %b %Y %H:%M:%S %Z(   R   R   (   t   rfc1123(    (    s3   lib/python2.7/site-packages/sphinx/util/__init__.pyt   rfc1123_to_epoch  s    c          @  s  d d d g d d d g d d g d	 d
 g d d g d d g d d g d d g d d g d d g d d g d d g d d g g }  t  j j d k r |  j d d g  n  d  d! d" d# g d$ d% d& g d' d( g g } d)   f d*      |   }   |  } t j d+ | | | f  S(,   Nu   :u   Au   Zu   _u   au   zu   Àu   Öu   Øu   öu   øu   ˿u   Ͱu   ͽu   Ϳu   ῿u   ‌u   ‍u   ⁰u   ↏u   Ⰰu   ⿯u   、u   ퟿u   豈u   ﷏u   ﷰu   �i   u   𐀀u   󯿿u   \-u   \.u   0u   9u   ·u   ̀u   ͯu   ‿u   ⁀u   |c         @  s]   g  } xG |  D]? } t  | t  r? | j d   | d   q | j |  q W| j |  S(   Nu   [%s]u   -(   RE   Rw   R   R=   (   t   entriest   splittert   resultsR`   (   t   convert(    s3   lib/python2.7/site-packages/sphinx/util/__init__.pyR_    s    u   (%s)(%s|%s)*(   R   t   version_infot   majorR   R   t   compile(   t   name_start_charst
   name_charst   start_chars_regext   name_chars_regex(    (   R_  s3   lib/python2.7/site-packages/sphinx/util/__init__.pyt   xmlname_checker  s    !
	(    (    (    (~   R   t
   __future__R    Rd   RC   R;   R   R   R   R   RF   R   t   codecsR   t   collectionsR   R   t   hashlibR   R   t   timeR   R   t   docutils.utilsR   t   sixR	   R
   R   t	   six.movesR   t   six.moves.urllib.parseR   R   R   R   R   t   sphinx.deprecationR   t   sphinx.errorsR   R   R   t   sphinx.utilR   t   sphinx.util.consoleR   R   R   R   t   sphinx.util.fileutilR   t   sphinx.util.osutilR   R   R   R   R    R!   R"   R#   R$   R%   R&   R'   R(   t   sphinx.util.nodesR)   R*   R+   R,   t   sphinx.util.matchingR-   t   Falset   typingR.   R/   R0   R1   R2   R3   R4   R5   R6   R7   R8   R9   t	   getLoggerR   RH  Rb  t   ws_ret   url_reR@   RJ   Rb   Ri   t   dictRj   R   R   R   R   R   R   R   R   t   objectR   R
  R   R  R  R  R"  R)  R*  R   R:  R@  RC  RM  RP  RY  R[  Rg  (    (    (    s3   lib/python2.7/site-packages/sphinx/util/__init__.pyt   <module>
   s   ("L"U			0&	&	0		8							&	
				
	