o $a @sZdZddlmZmZmZmZmZddlmZddl m Z er$ddl m Z GdddZ dS) z sphinx.environment.collectors ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ The data collector components for sphinx.environment. :copyright: Copyright 2007-2021 by the Sphinx team, see AUTHORS. :license: BSD, see LICENSE for details. ) TYPE_CHECKINGDictListOptionalSet)nodes)BuildEnvironment)Sphinxc @seZdZUdZdZeeeefe d<dddZ dd d Z ddd e d eddfd dZ ddd e deede ddf ddZdddejddfddZddd e deefddZddd e deedeedeedeef ddZdS)EnvironmentCollectoraCAn EnvironmentCollector is a specific data collector from each document. It gathers data and stores :py:class:`BuildEnvironment ` as a database. Examples of specific data would be images, download files, section titles, metadatas, index entries and toctrees, etc. N listener_idsappr returncCsV|jdusJ|d|j|d|j|d|j|d|j|d|jd|_dS)N doctree-readenv-merge-info env-purge-docenv-get-updatedenv-get-outdated)rrrrr)r connect process_doc merge_other clear_docget_updated_docsget_outdated_docs)selfr rH/usr/lib/python3/dist-packages/sphinx/environment/collectors/__init__.pyenable s      zEnvironmentCollector.enablecCs2|jdusJ|jD]}||q d|_dS)N)r values disconnect)rr listener_idrrrdisable*s  zEnvironmentCollector.disableenvdocnamecCt)zcRemove specified data of a document. This method is called on the removal of the document.NotImplementedError)rr r!r"rrrr0zEnvironmentCollector.clear_docdocnamesothercCr#)zMerge in specified data regarding docnames from a different `BuildEnvironment` object which coming from a subprocess in parallel builds.r$)rr r!r'r(rrrr6r&z EnvironmentCollector.merge_otherdoctreecCr#)zoProcess a document and gather specific data from it. This method is called after the document is read.r$)rr r)rrrr<r&z EnvironmentCollector.process_doccCgS)zReturn a list of docnames to re-read. This methods is called after reading the whole of documents (experimental). r)rr r!rrrrBsz%EnvironmentCollector.get_updated_docsaddedchangedremovedcCr*)zlReturn a list of docnames to re-read. This methods is called before reading the documents. r)rr r!r+r,r-rrrrIsz&EnvironmentCollector.get_outdated_docs)r r r N)__name__ __module__ __qualname____doc__r rrstrint__annotations__rr rrrrrdocumentrrrrrrrrr s0      r N)r1typingrrrrrdocutilsrsphinx.environmentrsphinx.applicationr r rrrrs