ó
öĄ\c           @   sĶ   d  Z  d d l m Z d d l m Z d d l m Z d d l m Z m	 Z	 e
 r d d l m Z m Z d d l m Z d d l m Z d d	 l m Z n  e	 j e  Z d
 e f d     YZ d   Z d S(   s  
    sphinx.environment.collectors.indexentries
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    Index entries collector for sphinx.environment.

    :copyright: Copyright 2007-2019 by the Sphinx team, see AUTHORS.
    :license: BSD, see LICENSE for details.
i’’’’(   t	   text_type(   t   addnodes(   t   EnvironmentCollector(   t   split_index_msgt   logging(   t   Dictt   Set(   t   nodes(   t   Sphinx(   t   BuildEnvironmentt   IndexEntriesCollectorc           B   s)   e  Z d  Z d   Z d   Z d   Z RS(   t   indicesc         C   s   | j  j | d   d  S(   N(   t   indexentriest   popt   None(   t   selft   appt   envt   docname(    (    sI   lib/python2.7/site-packages/sphinx/environment/collectors/indexentries.pyt	   clear_doc   s    c         C   s)   x" | D] } | j  | | j  | <q Wd  S(   N(   R   (   R   R   R   t   docnamest   otherR   (    (    sI   lib/python2.7/site-packages/sphinx/environment/collectors/indexentries.pyt   merge_other#   s    c         C   sö   | j  j } g  } | j  j | <xĻ | j t j  D]» } y. x' | d D] } t | d | d  qG WWn< t k
 r„ } t j	 t
 |  d | | j j |  q3 XxE | d D]9 } t |  d k rŁ | j |  q± | j | d  q± Wq3 Wd  S(   Nt   entriesi    i   t   locationi   (   N(   R   R   R   t   traverseR   t   indexR   t
   ValueErrort   loggert   warningR    t   parentt   removet   lent   appendR   (   R   R   t   doctreeR   R   t   nodet   entryt   exc(    (    sI   lib/python2.7/site-packages/sphinx/environment/collectors/indexentries.pyt   process_doc(   s    (   t   __name__t
   __module__t   nameR   R   R&   (    (    (    sI   lib/python2.7/site-packages/sphinx/environment/collectors/indexentries.pyR
      s   		c         C   s&   |  j  t  i d d 6t d 6t d 6S(   Nt   builtint   versiont   parallel_read_safet   parallel_write_safe(   t   add_env_collectorR
   t   True(   R   (    (    sI   lib/python2.7/site-packages/sphinx/environment/collectors/indexentries.pyt   setup<   s
    N(   t   __doc__t   sixR    t   sphinxR   t   sphinx.environment.collectorsR   t   sphinx.utilR   R   t   Falset   typingR   R   t   docutilsR   t   sphinx.applicatinR   t   sphinx.environmentR	   t	   getLoggerR'   R   R
   R0   (    (    (    sI   lib/python2.7/site-packages/sphinx/environment/collectors/indexentries.pyt   <module>
   s    