ó V!¶\c@skdZdZddlmZmZmZdefd„ƒYZdd d„ƒYZdefd „ƒYZd S( s¨ This package contains modules for standard tree transforms available to Docutils components. Tree transforms serve a variety of purposes: - To tie up certain syntax-specific "loose ends" that remain after the initial parsing of the input plaintext. These transforms are used to supplement a limited syntax. - To automate the internal linking of the document tree (hyperlink references, footnote references, etc.). - To extract useful information from the document tree. These transforms may be used to construct (for example) indexes and tables of contents. Each transform is an optional step that a Docutils component may choose to perform on the parsed document. treStructuredTextiÿÿÿÿ(t languagestApplicationErrort TransformSpectTransformErrorcBseZRS((t__name__t __module__(((s@/tmp/pip-install-usGedi/docutils/docutils/transforms/__init__.pyRst TransformcBs)eZdZdZdd„Zd„ZRS(s; Docutils transform component abstract base class. cCs4||_||_tj|jj|jƒ|_dS(sA Initial setup for in-place document transforms. N(tdocumentt startnodeRt get_languagetsettingst language_codetreportertlanguage(tselfRR ((s@/tmp/pip-install-usGedi/docutils/docutils/transforms/__init__.pyt__init__*s   cKstdƒ‚dS(s5Override to apply the transform to the document tree.s"subclass must override this methodN(tNotImplementedError(Rtkwargs((s@/tmp/pip-install-usGedi/docutils/docutils/transforms/__init__.pytapply;sN(RRt__doc__tNonetdefault_priorityRR(((s@/tmp/pip-install-usGedi/docutils/docutils/transforms/__init__.pyR!s t TransformercBsSeZdZd„Zdd„Zd„Zdd„Zd„Zd„Z d„Z RS( s‘ Stores transforms (`Transform` classes) and applies them to document trees. Also keeps track of components by component type name. cCsCg|_g|_||_g|_d|_i|_d|_dS(Ni(t transformstunknown_reference_resolversRtappliedtsortedt componentstserialno(RR((s@/tmp/pip-install-usGedi/docutils/docutils/transforms/__init__.pyRGs       cKsP|dkr|j}n|j|ƒ}|jj||d|fƒd|_dS(s+ Store a single transform. Use `priority` to override the default. `kwargs` is a dictionary whose contents are passed as keyword arguments to the `apply` method of the transform. This can be used to pass application-specific data to the transform instance. iN(RRtget_priority_stringRtappendR(Rttransform_classtpriorityRtpriority_string((s@/tmp/pip-install-usGedi/docutils/docutils/transforms/__init__.pyt add_transform`s    cCsLx<|D]4}|j|jƒ}|jj||difƒqWd|_dS(s3Store multiple transforms, with default priorities.iN(RRRRRR(Rttransform_listR R"((s@/tmp/pip-install-usGedi/docutils/docutils/transforms/__init__.pytadd_transformsns    cCsY|j}|dkr!|j}n|j|ƒ}|jj|||ifƒd|_dS(s4Store a transform with an associated `pending` node.iN(t transformRRRRRR(RtpendingR!R R"((s@/tmp/pip-install-usGedi/docutils/docutils/transforms/__init__.pyt add_pendingws    cCs |jd7_d||jfS(s” Return a string, `priority` combined with `self.serialno`. This ensures FIFO order on transforms with identical priority. is %03d-%03d(R(RR!((s@/tmp/pip-install-usGedi/docutils/docutils/transforms/__init__.pyRscCsÍxC|D];}|dkrqn|j|jƒƒ||j|js