mς hγΈEc@shdZdZdklZlZlZdefd„ƒYZdfd„ƒYZdefd„ƒYZd S( s9 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 Reader may choose to perform on the parsed document, depending on the input context. A Docutils Reader may also perform Reader-specific transforms before or after performing these standard transforms. treStructuredText(s languagessApplicationErrors TransformSpectTransformErrorcBstZRS(N(t__name__t __module__(((t;/data/zmath/zope/lib/python/docutils/transforms/__init__.pyR"st TransformcBs)tZdZeZed„Zd„ZRS(s; Docutils transform component abstract base class. cCs.||_||_ti|iiƒ|_dS(sA Initial setup for in-place document transforms. N(tdocumenttselft startnodet languagest get_languagetsettingst language_codetlanguage(RRR((Rt__init__.s   cKstdƒ‚dS(s5Override to apply the transform to the document tree.s"subclass must override this methodN(tNotImplementedError(Rtkwargs((Rtapply?s(RRt__doc__tNonetdefault_priorityRR(((RR%s  t TransformercBsStZdZd„Zed„Zd„Zed„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|_h|_d|_dS(Ni(Rt transformstunknown_reference_resolversRtappliedtsortedt componentstserialno(RR((RRKs      cKsR|djo |i}n|i|ƒ}|ii||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( tpriorityRttransform_classRRtget_priority_stringtpriority_stringRtappendRR(RRRRR((Rt add_transformds   cCsLx<|D]4}|i|iƒ}|ii||dhfƒqWd|_ dS(s3Store multiple transforms, with default priorities.iN( ttransform_listRRRRRRR RR(RR"RR((Rtadd_transformsrs  cCs[|i}|djo |i}n|i|ƒ}|i i |||hfƒd|_ dS(s4Store a transform with an associated `pending` node.iN( tpendingt transformRRRRRRRRR R(RR$RRR((Rt add_pending{s   cCs |id7_d||ifS(s” Return a string, `priority` combined with `self.serialno`. This ensures FIFO order on transforms with identical priority. is %03d-%03dN(RRR(RR((RR…scCsίxE|D]=}|djoqn|i|iƒƒ||i|i