3

T'íc´Eã@sÒdZddlmZmZmZmZmZddlmZddl	m
Z
erHddlmZyddl	m
ZWn&ek
r~ddlmZej
ZYnXGdd	„d	ejƒZGd
d„dejƒZGdd
„d
ƒZGdd„dejej
eƒZGdd„dej
eƒZGdd„dejej
ƒZGdd„deejejejƒZGdd„dejejejƒZ Gdd„dejej
ƒZ!Gdd„deejejƒZ"Gdd„deejejejƒZ#Gdd„deejejejƒZ$e$Z%Gd d!„d!ejejejƒZ&Gd"d#„d#e&ƒZ'Gd$d%„d%ejejejƒZ(Gd&d'„d'ejejejƒZ)Gd(d)„d)ejejejƒZ*Gd*d+„d+ejejejƒZ+Gd,d-„d-ej,eƒZ-Gd.d/„d/e-ƒZ.Gd0d1„d1e-ƒZ/Gd2d3„d3e-ƒZ0Gd4d5„d5e-ƒZ1Gd6d7„d7e-ƒZ2Gd8d9„d9e-ƒZ3Gd:d;„d;e-ƒZ4Gd<d=„d=e-ƒZ5Gd>d?„d?e-ƒZ6e.e/e0e1e2e3e4e5e6g	Z7Gd@dA„dAejejƒZ8GdBdC„dCejej
ƒZ9GdDdE„dEejej
ƒZ:GdFdG„dGejejejƒZ;GdHdI„dIej<ejejƒZ=GdJdK„dKejejƒZ>GdLdM„dMej
ƒZ?GdNdO„dOej
ƒZ@GdPdQ„dQej
ƒZAGdRdS„dSejBƒZCGdTdU„dUej
ƒZDGdVdW„dWej
ƒZEGdXdY„dYej
ƒZFGdZd[„d[ej
ƒZGGd\d]„d]ej
ƒZHGd^d_„d_ejIejJej
ƒZ
Gd`da„daejej
ƒZKGdbdc„dcejejƒZLGddde„deejMƒZNGdfdg„dgejMƒZOGdhdi„diejPeƒZQGdjdk„dkejReƒZSGdldm„dmejejƒZTdneeUefdoœdpdq„ZVdrS)szAdditional docutils nodes.é)Ú
TYPE_CHECKINGÚAnyÚDictÚListÚSequence)Únodes)ÚElement)ÚSphinx)Úmeta)ÚMetaBodycs.eZdZdZdeeeedœ‡fdd„
Z‡ZS)ÚdocumentajThe document root element patched by Sphinx.

    This fixes that document.set_id() does not support a node having multiple node Ids.
    see https://sourceforge.net/p/docutils/patches/167/

    .. important:: This is only for Sphinx internal use.  Please don't use this
                   in your extensions.  It will be removed without deprecation period.
    NÚ)ÚnodeÚmsgnodeÚsuggested_prefixÚreturncsjddlm}|jdkr(tƒj|||ƒ}ntƒj||ƒ}|jdkrfx$|dD]}||jkrJ||j|<qJW|S)Nr)ÚdocutilsééÚids)rr)rr)Úsphinx.utilrÚ__version_info__ÚsuperÚset_idr)ÚselfrrrrÚretZnode_id)Ú	__class__©ú1/tmp/pip-build-gk9425m9/sphinx/sphinx/addnodes.pyrs


zdocument.set_id)Nr
)Ú__name__Ú
__module__Ú__qualname__Ú__doc__rÚstrrÚ
__classcell__rr)rrrsrc@sBeZdZdZddœdd„Zeeddœdd„Zeedœd	d
„ZdS)Útranslatablea¯Node which supports translation.

    The translation goes forward with following steps:

    1. Preserve original translatable messages
    2. Apply translated messages from message catalog
    3. Extract preserved messages (for gettext builder)

    The translatable nodes MUST preserve original messages.
    And these messages should not be overridden at applying step.
    Because they are used at final step; extraction.
    N)rcCst‚dS)z(Preserve original translatable messages.N)ÚNotImplementedError)rrrrÚpreserve_original_messages<sz'translatable.preserve_original_messages)Úoriginal_messageÚtranslated_messagercCst‚dS)zApply translated message.N)r&)rr(r)rrrÚapply_translated_message@sz%translatable.apply_translated_messagecCst‚dS)zjExtract translation messages.

        :returns: list of extracted messages or messages generator
        N)r&)rrrrÚextract_original_messagesDsz&translatable.extract_original_messages)	rr r!r"r'r#r*rr+rrrrr%.sr%c@seZdZdZdZdS)Únot_smartquotablez+A node which does not support smart-quotes.FN)rr r!r"Zsupport_smartquotesrrrrr,Lsr,c@sBeZdZdZddœdd„Zeeddœdd„Zeedœd	d
„ZdS)Útoctreez Node for inserting a "TOC tree".N)rcCsJ|jdgƒ}x"|dD]\}}|r|j|ƒqW|jdƒrF|d|d<dS)NÚ
rawentriesÚentriesÚcaptionÚ
rawcaption)Ú
setdefaultÚappendÚget)rr.ÚtitleZ_docnamerrrr'Ts
z"toctree.preserve_original_messages)r(r)rcCsPx4t|dƒD]$\}\}}||kr||f|d|<qW|jdƒ|krL||d<dS)Nr/r1r0)Ú	enumerater4)rr(r)Úir5Zdocnamerrrr*_s
z toctree.apply_translated_messagecCs0g}|j|jdgƒƒd|kr,|j|dƒ|S)Nr.r1)Úextendr4r3)rÚmessagesrrrr+is
z!toctree.extract_original_messages)	rr r!r"r'r#r*rr+rrrrr-Qs
r-cs8eZdZUdZgZeeeeddœ‡fdd„Z‡Z	S)Ú_desc_classes_injectorz_Helper base class for injecting a fixes list of classes.

    Use as the first base class.
    N)ÚargsÚkwargsrcs"tƒj||Ž|dj|jƒdS)NÚclasses)rÚ__init__r8r=)rr;r<)rrrr>sz_desc_classes_injector.__init__)
rr r!r"r=rr#rr>r$rr)rrr:ys
r:c@seZdZdZdS)ÚdescamNode for a list of object signatures and a common description of them.

    Contains one or more :py:class:`desc_signature` nodes
    and then a single :py:class:`desc_content` node.

    This node always has two classes:

    - The name of the domain it belongs to, e.g., ``py`` or ``cpp``.
    - The name of the object type in the domain, e.g., ``function``.
    N)rr r!r"rrrrr?‰s
r?cs,eZdZdZddgZe‡fdd„ƒZ‡ZS)Údesc_signatureaSNode for a single object signature.

    As default the signature is a single-line signature.
    Set ``is_multiline = True`` to describe a multi-line signature.
    In that case all child nodes must be :py:class:`desc_signature_line` nodes.

    This node always has the classes ``sig``, ``sig-object``, and the domain it belongs to.
    Úsigz
sig-objectcs|jdƒrdStƒjSdS)NZis_multilineú )r4rÚchild_text_separator)r)rrrrC¥s
z#desc_signature.child_text_separator)rr r!r"r=ÚpropertyrCr$rr)rrr@™sr@c@seZdZdZdZdS)Údesc_signature_linezõNode for a line in a multi-line object signature.

    It should only be used as a child of a :py:class:`desc_signature`
    with ``is_multiline`` set to ``True``.
    Set ``add_permalink = True`` for the line that should get the permalink.
    r
N)rr r!r"Zsphinx_line_typerrrrrE­srEc@seZdZdZdS)Údesc_contentzfNode for object description content.

    Must be the last child node in a :py:class:`desc` node.
    N)rr r!r"rrrrrF·srFcs4eZdZdZddgZeeeddœ‡fdd„Z‡ZS)Údesc_inlinezâNode for a signature fragment in inline text.

    This is for example used for roles like :rst:role:`cpp:expr`.

    This node always has the classes ``sig``, ``sig-inline``,
    and the name of the domain it belongs to.
    rAz
sig-inlineN)Údomainr;r<rcs tƒj||Ž|dj|ƒdS)Nr=)rr>r3)rrHr;r<)rrrr>Èszdesc_inline.__init__)	rr r!r"r=r#rr>r$rr)rrrG¾srGc@seZdZdZddgZdS)Ú	desc_namezÄNode for the main object name.

    For example, in the declaration of a Python class ``MyModule.MyClass``,
    the main name is ``MyClass``.

    This node always has the class ``sig-name``.
    zsig-nameZdescnameN)rr r!r"r=rrrrrIÒsrIc@seZdZdZddgZdS)Údesc_addnamezãNode for additional name parts for an object.

    For example, in the declaration of a Python class ``MyModule.MyClass``,
    the additional name part is ``MyModule.``.

    This node always has the class ``sig-prename``.
    zsig-prenameZ
descclassnameN)rr r!r"r=rrrrrJÝsrJc@seZdZdZdS)Ú	desc_typez+Node for return types or object type names.N)rr r!r"rrrrrKísrKcs&eZdZdZedœ‡fdd„Z‡ZS)Údesc_returnsz4Node for a "returns" annotation (a la -> in Python).)rcsdtƒjƒS)Nz -> )rÚastext)r)rrrrMôszdesc_returns.astext)rr r!r"r#rMr$rr)rrrLñsrLcs$eZdZdZdZ‡fdd„Z‡ZS)Údesc_parameterlistz"Node for a general parameter list.z, csdjtƒjƒƒS)Nz({}))ÚformatrrM)r)rrrrMüszdesc_parameterlist.astext)rr r!r"rCrMr$rr)rrrNøsrNc@seZdZdZdS)Údesc_parameterzNode for a single parameter.N)rr r!r"rrrrrPsrPcs*eZdZdZdZedœ‡fdd„Z‡ZS)Ú
desc_optionalz6Node for marking optional parts of the parameter list.z, )rcsdtƒjƒdS)Nú[ú])rrM)r)rrrrMszdesc_optional.astext)rr r!r"rCr#rMr$rr)rrrQsrQc@seZdZdZdS)Údesc_annotationz@Node for signature annotations (not Python 3-style annotations).N)rr r!r"rrrrrTsrTcs>eZdZUdZgZeedeeeeddœ‡fdd„
Z	‡Z
S)Údesc_sig_elementz<Common parent class of nodes for inline text of a signature.r
N)Ú	rawsourceÚtextÚchildrenÚ
attributesrcs*tƒj||f|ž|Ž|dj|jƒdS)Nr=)rr>r8r=)rrVrWrXrY)rrrr>szdesc_sig_element.__init__)r
r
)rr r!r"r=rr#rrr>r$rr)rrrUs
rUcs6eZdZdZdgZd	eeeeddœ‡fdd„
Z‡Z	S)
Údesc_sig_spacez Node for a space in a signature.Úwr
rBN)rVrWrXrYrcstƒj||f|ž|ŽdS)N)rr>)rrVrWrXrY)rrrr>(szdesc_sig_space.__init__)r
rB)
rr r!r"r=r#rrr>r$rr)rrrZ$srZc@seZdZdZdgZdS)Ú
desc_sig_namez&Node for an identifier in a signature.ÚnN)rr r!r"r=rrrrr\-sr\c@seZdZdZdgZdS)Údesc_sig_operatorz$Node for an operator in a signature.ÚoN)rr r!r"r=rrrrr^2sr^c@seZdZdZdgZdS)Údesc_sig_punctuationz$Node for punctuation in a signature.ÚpN)rr r!r"r=rrrrr`7sr`c@seZdZdZdgZdS)Údesc_sig_keywordz*Node for a general keyword in a signature.ÚkN)rr r!r"r=rrrrrb<srbc@seZdZdZdgZdS)Údesc_sig_keyword_typez;Node for a keyword which is a built-in type in a signature.ZktN)rr r!r"r=rrrrrdAsrdc@seZdZdZdgZdS)Údesc_sig_literal_numberz*Node for a numeric literal in a signature.ÚmN)rr r!r"r=rrrrreFsrec@seZdZdZdgZdS)Údesc_sig_literal_stringz)Node for a string literal in a signature.ÚsN)rr r!r"r=rrrrrgKsrgc@seZdZdZdgZdS)Údesc_sig_literal_charz,Node for a character literal in a signature.ZscN)rr r!r"r=rrrrriPsric@seZdZdZdS)ÚversionmodifiedzNode for version change entries.

    Currently used for "versionadded", "versionchanged" and "deprecated"
    directives.
    N)rr r!r"rrrrrj`srjc@seZdZdZdS)ÚseealsozCustom "see also" admonition.N)rr r!r"rrrrrkhsrkc@seZdZdZdS)ÚproductionlistzKNode for grammar production lists.

    Contains ``production`` nodes.
    N)rr r!r"rrrrrllsrlc@seZdZdZdS)Ú
productionz*Node for a single grammar production rule.N)rr r!r"rrrrrmssrmc@seZdZdZdS)ÚindexaÈNode for index entries.

    This node is created by the ``index`` directive and has one attribute,
    ``entries``.  Its value is a list of 5-tuples of ``(entrytype, entryname,
    target, ignored, key)``.

    *entrytype* is one of "single", "pair", "double", "triple".

    *key* is categorization characters (usually a single character) for
    general index page. For the details of this, please see also:
    :rst:dir:`glossary` and issue #2320.
    N)rr r!r"rrrrrnysrnc@seZdZdZdS)ÚcenteredzDeprecated.N)rr r!r"rrrrroˆsroc@seZdZdZdS)ÚackszSpecial node for "acks" lists.N)rr r!r"rrrrrpŒsrpc@seZdZdZdS)ÚhlistzjNode for "horizontal lists", i.e. lists that should be compressed to
    take up less vertical space.
    N)rr r!r"rrrrrqsrqc@seZdZdZdS)Úhlistcolz)Node for one column in a horizontal list.N)rr r!r"rrrrrr–srrc@seZdZdZdS)Úcompact_paragraphz<Node for a compact paragraph (which never makes a <p> node).N)rr r!r"rrrrrsšsrsc@seZdZdZdS)ÚglossaryzNode to insert a glossary.N)rr r!r"rrrrrtžsrtc@seZdZdZdS)ÚonlyzANode for "only" directives (conditional inclusion based on tags).N)rr r!r"rrrrru¢sruc@seZdZdZdS)Ú
start_of_filezANode to mark start of a new file, used in the LaTeX builder only.N)rr r!r"rrrrrv¨srvc@seZdZdZdS)Ú
highlightlangzcInserted to set the highlight language and line number options for
    subsequent code blocks.
    N)rr r!r"rrrrrw¬srwc@seZdZdZdS)Útabular_col_specz;Node for specifying tabular columns, used for LaTeX output.N)rr r!r"rrrrrx²srxc@seZdZdZdZdS)r
zYNode for meta directive -- same as docutils' standard meta node,
    but pickleable.
    N)rr r!r"Z
rawcontentrrrrr
¶sr
c@seZdZdZdZdS)Úpending_xrefzÍNode for cross-references that cannot be resolved without complete
    information about all documents.

    These nodes are resolved before writing output, in
    BuildEnvironment.resolve_references.
    r
N)rr r!r"rCrrrrry¿sryc@seZdZdZdS)Úpending_xref_conditiona}Node for cross-references that are used to choose appropriate
    content of the reference by conditions on the resolving phase.

    When the :py:class:`pending_xref` node contains one or more
    **pending_xref_condition** nodes, the cross-reference resolver
    should choose the content of the reference using defined conditions
    in ``condition`` attribute of each pending_xref_condition nodes::

        <pending_xref refdomain="py" reftarget="io.StringIO ...>
            <pending_xref_condition condition="resolved">
                <literal>
                    StringIO
            <pending_xref_condition condition="*">
                <literal>
                    io.StringIO

    After the processing of cross-reference resolver, one of the content node
    under pending_xref_condition node is chosen by its condition and to be
    removed all of pending_xref_condition nodes::

        # When resolved the cross-reference successfully
        <reference>
            <literal>
                StringIO

        # When resolution is failed
        <reference>
            <literal>
                io.StringIO

    .. note:: This node is only allowed to be placed under pending_xref node.
              It is not allows to place it under other nodes.  In addition,
              pending_xref node must contain only pending_xref_condition
              nodes if it contains one or more pending_xref_condition nodes.

    The pending_xref_condition node should have **condition** attribute.
    Domains can be store their individual conditions into the attribute to
    filter contents on resolving phase.  As a reserved condition name,
    ``condition="*"`` is used for the fallback of resolution failure.
    Additionally, as a recommended condition name, ``condition="resolved"``
    is used for the representation of resolstion success in the intersphinx
    module.

    .. versionadded:: 4.0
    N)rr r!r"rrrrrzÉs-rzc@seZdZdZdS)Únumber_referencez4Node for number references, similar to pending_xref.N)rr r!r"rrrrr{ùsr{c@seZdZdZdS)Údownload_referencez6Node for download references, similar to pending_xref.N)rr r!r"rrrrr|ýsr|c@seZdZdZdS)Úliteral_emphasisz{Node that behaves like `emphasis`, but further text processors are not
    applied (e.g. smartypants for HTML output).
    N)rr r!r"rrrrr}sr}c@seZdZdZdS)Úliteral_strongzyNode that behaves like `strong`, but further text processors are not
    applied (e.g. smartypants for HTML output).
    N)rr r!r"rrrrr~sr~c@seZdZdZdS)Úmanpagez Node for references to manpages.N)rr r!r"rrrrr
srr	)ÚapprcCs¤ddlm}|jtƒ|jtƒ|jtƒ|jtƒ|jtƒ|jtƒ|jt	ƒ|jt
ƒ|jtƒ|jtƒ|jt
ƒ|jtƒ|jtƒ|jtƒxtD]}|j|ƒqžW|jtƒ|jtƒ|jtƒ|jtƒ|jtƒ|jtƒ|jtƒ|jtƒ|jtƒ|jtƒ|jtƒ|jtƒ|jtƒ|jtƒ|jt ƒ|jt!ƒ|jt"ƒ|jt#ƒ|jt$ƒ|jt%ƒ|jt&ƒ|j'dkr˜|jt(ƒddddœS)Nr)réÚbuiltinT)ÚversionZparallel_read_safeZparallel_write_safe)rr))rrÚadd_noder-r?r@rErFrGrIrJrKrLrNrPrQrTÚSIG_ELEMENTSrjrkrlrmrnrorprqrrrsrtrurvrwrxryr{r|r}r~rrr
)r€rr]rrrÚsetupsV




































r†N)Wr"ÚtypingrrrrrrrZdocutils.nodesrZsphinx.applicationr	r
Z
docutils_metaÚImportErrorZ$docutils.parsers.rst.directives.htmlrrÚNoder%r,ZGeneralr-r:Z
Admonitionr?ZPartZInlineZTextElementr@ZFixedTextElementrErFrGrIrJZdesc_classnamerKrLrNrPrQrTÚinlinerUrZr\r^r`rbrdrergrir…rjrkrlrmZ	InvisiblernrorprqrrZ	paragraphrsrtrurvrwrxÚSpecialZPreBibliographicryrzÚ	referencer{r|Zemphasisr}Ústrongr~rr#r†rrrrÚ<module>sŠ(


	
	
0