ó 1Tc@sãdZddlmZddlmZddlmZmZddlm Z ddl m Z ddl mZddlmZdd lmZmZdd lmZdd lmZmZdd lmZmZdd lmZddlm Z ddl!m"Z"m#Z#e$dddgƒZ%de fd„ƒYZ&de fd„ƒYZ'de fd„ƒYZ(de fd„ƒYZ)de fd„ƒYZ*de+fd„ƒYZ,de fd „ƒYZ-d!e fd"„ƒYZ.d#efd$„ƒYZ/d%S(&sß sphinx.transforms ~~~~~~~~~~~~~~~~~ Docutils transforms used by Sphinx when reading documents. :copyright: Copyright 2007-2014 by the Sphinx team, see AUTHORS. :license: BSD, see LICENSE for details. iÿÿÿÿ(tpath(tnodes(t new_documentt relative_path(tParser(t Transform(tContentsFilter(taddnodes(t_tinit(tsplit_index_msg(ttraverse_translatable_indextextract_messages(t ustrftimet find_catalog(tdocutils_version(tall(tmake_term_from_paragraph_nodet"make_termnodes_from_paragraph_nodetversiontreleasettodaytDefaultSubstitutionscBseZdZdZd„ZRS(sL Replace some substitutions if they aren't defined in the document. iÒcCs¹|jjjj}tt|jjƒ}xŠ|jjtj ƒD]s}|d}||kr>||}|dkr•| r•t |j pŒt dƒƒ}n|j tj||ƒƒq>q>WdS(NtrefnameRs %B %d, %Y(tdocumenttsettingstenvtconfigtdefault_substitutionstsettsubstitution_defsttraverseRtsubstitution_referenceR t today_fmtRt replace_selftText(tselfRt to_handletrefRttext((s;/usr/local/lib/python2.7/site-packages/sphinx/transforms.pytapply.s   (t__name__t __module__t__doc__tdefault_priorityR((((s;/usr/local/lib/python2.7/site-packages/sphinx/transforms.pyR'stMoveModuleTargetscBseZdZdZd„ZRS(sv Move module targets that are the first thing in a section to the section title. XXX Python specific iÒcCs›x”|jjtjƒD]}}|ds,qn|jdƒr|jjtjkr|jj|ƒdkr|d|jddd+|jj |ƒqqWdS(Ntidstismodii( RRRttargetthas_keytparentt __class__tsectiontindextremove(R$tnode((s;/usr/local/lib/python2.7/site-packages/sphinx/transforms.pyR(Es (R)R*R+R,R((((s;/usr/local/lib/python2.7/site-packages/sphinx/transforms.pyR-<stHandleCodeBlockscBseZdZdZd„ZRS(s5 Several code block related transformations. iÒcCsPxI|jjtjƒD]2}td„|jDƒƒr|j|jƒqqWdS(Ncss!|]}t|tjƒVqdS(N(t isinstanceRt doctest_block(t.0tchild((s;/usr/local/lib/python2.7/site-packages/sphinx/transforms.pys Zs(RRRt block_quoteRtchildrenR"(R$R7((s;/usr/local/lib/python2.7/site-packages/sphinx/transforms.pyR(Ws (R)R*R+R,R((((s;/usr/local/lib/python2.7/site-packages/sphinx/transforms.pyR8QstSortIdscBseZdZdZd„ZRS(s@ Sort secion IDs so that the "id[0-9]+" one comes last. icCsuxn|jjtjƒD]W}t|dƒdkr|ddjdƒr|dd|ddg|d| d7} nt||ƒ}t| j| jƒj|ƒ| j| |ƒy|d}Wntk ršnXt|tjƒs³qÛnt}t| tjƒr| j}tj |j!ƒƒ}tj | j!ƒƒ‰ˆ|kr|j"dgƒ}|j#|ƒˆ|krE|j$ˆƒn|jj%j&ˆdƒ}|jj(j&ˆdƒ}| rÇ|rÇ|jj%j)ˆdƒ|jj(j)ˆdƒ|jj*j)|dƒn|jj+|ƒ‡fd†}x$|jj,|ƒD]}||dƒ})|j,t=j>ƒ}*i}0t5|)ƒt5|*ƒkr¨|j6d| ƒnd„}1x0|)D](}&|1|&ƒ}2|2r¸|&j?|0|2 W|j4| _4t-| d RAt warn_nodetautofootnote_refst footnote_refstrefnamestlistthas_namet note_refnameRRLt attributestitemsR R (=R$RRRTtdocnamet textdomaint directorytdirstcatalogt has_catalogtparserR7tmsgtmsgstrtpatcht processedt section_nodetnew_nameR^t_idtexplicitRat old_targetRbR.t termnodesRt new_termnodesR<RfRkt old_foot_refst new_foot_refstold_foot_namerefstrRjRtrefsRiR@Rmtold_refstnew_refst old_ref_namest new_ref_namestorphansRotrefname_ids_maptxref_reftarget_mapRttkeytktvRwt new_entriesttypettidtmaint msg_partst msgstr_partstpart((R`s;/usr/local/lib/python2.7/site-packages/sphinx/transforms.pyR(¡s\+                        &                   %    & (R)R*R+R,R((((s;/usr/local/lib/python2.7/site-packages/sphinx/transforms.pyR\›stRemoveTranslatableInlinecBseZdZdZd„ZRS(sC Remove inline nodes used for translation as placeholders. içcCs“ddlm}|jjj}|jj}t||ƒr>dSxN|jjt j ƒD]7}d|krT|j j |ƒ|j |j 7_ qTqTWdS(Niÿÿÿÿ(tMessageCatalogBuildert translatable(tsphinx.builders.gettextRÂRRRtapptbuilderR9RRtinlineR2R6R>(R$RÂRRÆRÇ((s;/usr/local/lib/python2.7/site-packages/sphinx/transforms.pyR(Ós  (R)R*R+R,R((((s;/usr/local/lib/python2.7/site-packages/sphinx/transforms.pyRÁÍstSphinxContentsFiltercBs eZdZd„Zd„ZRS(sx Used with BuildEnvironment.add_toc_from() to discard cross-file links within table-of-contents link nodes. cCs5|jƒ}|jjtj||ƒƒtj‚dS(N(RKR2RgRtliteraltSkipNode(R$R7R'((s;/usr/local/lib/python2.7/site-packages/sphinx/transforms.pytvisit_pending_xrefäs cCs tj‚dS(N(RRÊ(R$R7((s;/usr/local/lib/python2.7/site-packages/sphinx/transforms.pyt visit_imageés(R)R*R+RËRÌ(((s;/usr/local/lib/python2.7/site-packages/sphinx/transforms.pyRÈßs N(0R+tosRtdocutilsRtdocutils.utilsRRtdocutils.parsers.rstRRtdocutils.transformsRtdocutils.transforms.partsRtsphinxRt sphinx.localeRR R}t sphinx.utilR tsphinx.util.nodesR R tsphinx.util.osutilR Rtsphinx.util.compatRtsphinx.util.pycompatRtsphinx.domains.stdRRRRRR-R8R?RCtobjectRSR\RÁRÈ(((s;/usr/local/lib/python2.7/site-packages/sphinx/transforms.pyt s8  ÿ3