ó
öĀ\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  d
 e f d     YZ d   Z d S(   s  
    sphinx.environment.collectors.dependencies
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    The dependencies collector components for sphinx.environment.

    :copyright: Copyright 2007-2019 by the Sphinx team, see AUTHORS.
    :license: BSD, see LICENSE for details.
iĸĸĸĸ(   t   path(   t   relative_path(   t   EnvironmentCollector(   t   getcwdt   fs_encoding(   t   Dictt   Set(   t   nodes(   t   Sphinx(   t   BuildEnvironmentt   DependenciesCollectorc           B   s)   e  Z d  Z d   Z d   Z d   Z RS(   s.   dependencies collector for sphinx.environment.c         C   s   | j  j | d   d  S(   N(   t   dependenciest   popt   None(   t   selft   appt   envt   docname(    (    sI   lib/python2.7/site-packages/sphinx/environment/collectors/dependencies.pyt	   clear_doc   s    c         C   s;   x4 | D], } | | j  k r | j  | | j  | <q q Wd  S(   N(   R   (   R   R   R   t   docnamest   otherR   (    (    sI   lib/python2.7/site-packages/sphinx/environment/collectors/dependencies.pyt   merge_other"   s    c         C   s·   t    } t j t j | j  d  } | j j } | s= d Sxs | j D]h } t | t	  rn | j
 t  } n  t | t j t j | |    } | j j | j j j |  qG Wd S(   s+   Process docutils-generated dependency info.t   dummyN(   R   R    t   joint   normpatht   srcdirt   settingst   record_dependenciest   listt
   isinstancet   bytest   decodeR   R   R   R   R   t   add(   R   R   t   doctreet   cwdt   frompatht   depst   dept   relpath(    (    sI   lib/python2.7/site-packages/sphinx/environment/collectors/dependencies.pyt   process_doc(   s    	(   t   __name__t
   __module__t   __doc__R   R   R'   (    (    (    sI   lib/python2.7/site-packages/sphinx/environment/collectors/dependencies.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/dependencies.pyt   setup:   s
    N(   R*   t   osR    t   docutils.utilsR   t   sphinx.environment.collectorsR   t   sphinx.util.osutilR   R   t   Falset   typingR   R   t   docutilsR   t   sphinx.sphinxR   t   sphinx.environmentR	   R
   R1   (    (    (    sI   lib/python2.7/site-packages/sphinx/environment/collectors/dependencies.pyt   <module>
   s   