
    Fe
                    \    d Z ddlmZ ddlmZ erddlmZ ddlmZ ddl	m
Z
  G d d      Zy	)
z5The data collector components for sphinx.environment.    )annotations)TYPE_CHECKING)nodes)Sphinx)BuildEnvironmentc                  t    e Zd ZU dZdZded<   ddZddZddZ	 	 	 	 	 	 ddZ	dd	Z
dd
Z	 	 	 	 	 	 	 	 ddZy)EnvironmentCollectoraC  An EnvironmentCollector is a specific data collector from each document.

    It gathers data and stores :py:class:`BuildEnvironment
    <sphinx.environment.BuildEnvironment>` as a database.  Examples of specific
    data would be images, download files, section titles, metadatas, index
    entries and toctrees, etc.
    Nzdict[str, int] | Nonelistener_idsc                >   | j                   J |j                  d| j                        |j                  d| j                        |j                  d| j                        |j                  d| j
                        |j                  d| j                        d| _         y )Ndoctree-readenv-merge-infoenv-purge-docenv-get-updatedenv-get-outdated)r   r   r   r   r   )r
   connectprocess_docmerge_other	clear_docget_updated_docsget_outdated_docs)selfapps     H/usr/lib/python3/dist-packages/sphinx/environment/collectors/__init__.pyenablezEnvironmentCollector.enable   s      ((( #ND<L<L M #,<d>N>N O #OT^^ L #,=t?T?T U #,>@V@V W
    c                    | j                   J | j                   j                         D ]  }|j                  |        d | _         y )N)r
   values
disconnect)r   r   listener_ids      r   disablezEnvironmentCollector.disable#   sF      ,,,,,335 	(KNN;'	( r   c                    t         )zcRemove specified data of a document.

        This method is called on the removal of the document.NotImplementedError)r   r   envdocnames       r   r   zEnvironmentCollector.clear_doc)   
     "!r   c                    t         )zMerge in specified data regarding docnames from a different `BuildEnvironment`
        object which coming from a subprocess in parallel builds.r"   )r   r   r$   docnamesothers        r   r   z EnvironmentCollector.merge_other/   r&   r   c                    t         )zoProcess a document and gather specific data from it.

        This method is called after the document is read.r"   )r   r   doctrees      r   r   z EnvironmentCollector.process_doc5   r&   r   c                    g S )zReturn a list of docnames to re-read.

        This methods is called after reading the whole of documents (experimental).
         )r   r   r$   s      r   r   z%EnvironmentCollector.get_updated_docs;   s	    
 	r   c                    g S )zlReturn a list of docnames to re-read.

        This methods is called before reading the documents.
        r-   )r   r   r$   addedchangedremoveds         r   r   z&EnvironmentCollector.get_outdated_docsB   s	     	r   )r   r   returnNone)r   r   r$   r   r%   strr2   r3   )
r   r   r$   r   r(   set[str]r)   r   r2   r3   )r   r   r+   znodes.documentr2   r3   )r   r   r$   r   r2   	list[str])r   r   r$   r   r/   r5   r0   r5   r1   r5   r2   r6   )__name__
__module____qualname____doc__r
   __annotations__r   r    r   r   r   r   r   r-   r   r   r	   r	      so     +/L'.
!""&"/?"DH""!)4<GOT]r   r	   N)r:   
__future__r   typingr   docutilsr   sphinx.applicationr   sphinx.environmentr   r	   r-   r   r   <module>rA      s$    ; "  )3: :r   