V!\c@sdZdZddlZddlZddlZddlZddlZddlZdefdYZ ej dfkrde fdYZ ne Z d Z d e e fd YZd e fd YZdefdYZdefdYZdfdYZdfdYZdfdYZdfdYZdfdYZdfdYZdefdYZd fd!YZd"fd#YZd$efd%YZd&efd'YZd(efd)YZd*efd+YZd,efd-YZd.fd/YZ d0fd1YZ!d2efd3YZ"d4efd5YZ#d6fd7YZ$d8eeefd9YZ%d:eeefd;YZ&d<eeefd=YZ'd>eefd?YZ(d@eefdAYZ)dBeefdCYZ*dDeefdEYZ+dFeefdGYZ,dHeefdIYZ-dJeefdKYZ.dLeefdMYZ/dNeefdOYZ0dPeefdQYZ1dReefdSYZ2dTeefdUYZ3dVeefdWYZ4dXeefdYYZ5dZeefd[YZ6d\eefd]YZ7d^eefd_YZ8d`eefdaYZ9dbeefdcYZ:ddeefdeYZ;dfeefdgYZ<dheefdiYZ=djeefdkYZ>dleefdmYZ?dne efdoYZ@dpeefdqYZAdre efdsYZBdte efduYZCdve efdwYZDdxe efdyYZEdzeefd{YZFd|e efd}YZGd~e efdYZHde efdYZIde efdYZJde efdYZKde efdYZLdeefdYZMde efdYZNde efdYZOde efdYZPdeefdYZQdeefdYZRdeefdYZSdeefdYZTde efdYZUdeefdYZVde efdYZWdeefdYZXdeefdYZYdeefdYZZdeefdYZ[deefdYZ\deefdYZ]deefdYZ^deefdYZ_deefdYZ`deefdYZadeeefdYZbdeeefdYZcdeee!ee#fdYZddeeee$e#fdYZedeeee$e#fdYZfde efdYZgdeefdYZhde efdYZide efdYZjdeefdYZkde efdYZlde efdYZmde efdYZnde efdYZode efdYZpde efdYZqdeeeefdYZrdeeefdYZsdee!eefdYZtde!efdYZude!efdYZvde!efdYZwdee!e"efdYZxde!e"efdYZyde!e"efdYZzde!efdYZ{de!efdYZ|de!efdYZ}de!efdYZ~de!efdYZde!efdYZde!efdYZdee!efdYZde!efdYZde!efdYZde!efdYZdjZdfdYZdefdYZdefdYZdZdZdZdZeedefdYZdefdYZd efd YZd efd YZd efdYZdefdYZdefdYZdefdYZdZejdZejdZi!dd6dd6dd6dd6d d!6d"d#6d$d%6d$d&6d'd(6dd)6d*d+6d,d-6d d.6d/d06d1d26d"d36d"d46d5d66d7d86d9d:6d7d;6d d<6d/d=6d"d>6d?d@6d'dA6dBdC6d7dD6dEdF6d?dG6dHdI6dJdK6d5dL6ZidMdN6dOdP6dQdR6dSdT6dUdV6ZdWZdXZdYZdZZd[ZdS(\s Docutils document tree element class library. Classes in CamelCase are abstract base classes or auxiliary classes. The one exception is `Text`, for a text (PCDATA) node; uppercase is used to differentiate from element classes. Classes in lower_case_with_underscores are element classes, matching the XML element generic identifiers in the DTD_. The position of each node (the level at which it can occur) is significant and is represented by abstract base classes (`Root`, `Structural`, `Body`, `Inline`, etc.). Certain transformations will be easier because we can use ``isinstance(node, base_class)`` to determine the position of the node in the hierarchy. .. _DTD: http://docutils.sourceforge.net/docs/ref/docutils.dtd treStructuredTextiNtNodecBseZdZdZdZdZdZdZe j dkrHdZ nddZ dddZ dZd Zd Zd Zd Zd ZdZdeeeedZdeeeedZRS(s0Abstract base class of nodes in a document tree.cCstS(s8 Node instances are always true, even if they're empty. A node is more than a simple container. Its boolean "truth" does not depend on having one or more subnodes in the doctree. Use `len()` to check node length. Use `None` to represent a boolean false value. (tTrue(tself((s2/tmp/pip-install-usGedi/docutils/docutils/nodes.pyt __nonzero__4s icCst|jdS(Ntraw_unicode_escape(tunicodetencode(R((s2/tmp/pip-install-usGedi/docutils/docutils/nodes.pyt__str__BscCs:|dkr!ddljj}n|j}|j|S(s6Return a DOM **fragment** representation of this Node.iN(tNonetxml.dom.minidomtdomtminidomtDocumentt _dom_node(RR tdomroot((s2/tmp/pip-install-usGedi/docutils/docutils/nodes.pytasdomEs  s icCs tdS(ss Return an indented pseudo-XML representation, for test purposes. Override in subclasses. N(tNotImplementedError(Rtindenttlevel((s2/tmp/pip-install-usGedi/docutils/docutils/nodes.pytpformatLscCs tdS(sReturn a copy of self.N(R(R((s2/tmp/pip-install-usGedi/docutils/docutils/nodes.pytcopyTscCs tdS(s3Return a deep copy of self (also copying children).N(R(R((s2/tmp/pip-install-usGedi/docutils/docutils/nodes.pytdeepcopyXscCsg||_|jrc|j|_|jdkr?|jj|_n|jdkrc|jj|_qcndS(N(tparenttdocumenttsourceR tcurrent_sourcetlinet current_line(Rtchild((s2/tmp/pip-install-usGedi/docutils/docutils/nodes.pyt setup_child\s   cCst}|jjjd|jjyy|j|Wn(ttfk rQ|St k ranX|j }y/x(|D]}|j |rvt }PqvqvWWnt k rnXWntk rt }nX|S(s Traverse a tree of `Node` objects, calling the `dispatch_visit()` method of `visitor` when entering each node. (The `walkabout()` method is similar, except it also calls the `dispatch_departure()` method before exiting each node.) This tree traversal supports limited in-place tree modifications. Replacing one node with one or more nodes is OK, as is removing an element. However, if the node removed or replaced occurs after the current node, the old node will still be traversed, and any new nodes will not. Within ``visit`` methods (and ``depart`` methods for `walkabout()`), `TreePruningException` subclasses may be raised (`SkipChildren`, `SkipSiblings`, `SkipNode`, `SkipDeparture`). Parameter `visitor`: A `NodeVisitor` object, containing a ``visit`` implementation for each `Node` subclass encountered. Return true if we should stop the traversal. s6docutils.nodes.Node.walk calling dispatch_visit for %s(tFalseRtreportertdebugt __class__t__name__tdispatch_visitt SkipChildrentSkipNodet SkipDeparturetchildrentwalkRt SkipSiblingst StopTraversal(RtvisitortstopR(R((s2/tmp/pip-install-usGedi/docutils/docutils/nodes.pyR)es,       cCst}t}|jjjd|jjyy|j|Wn(tk rQ|St k rgt}nX|j }y/x(|D]}|j |r|t}Pq|q|WWnt k rnXWn't k rntk rt}nX|r|jjjd|jj|j|n|S(s Perform a tree traversal similarly to `Node.walk()` (which see), except also call the `dispatch_departure()` method before exiting each node. Parameter `visitor`: A `NodeVisitor` object, containing a ``visit`` and ``depart`` implementation for each `Node` subclass encountered. Return true if we should stop the traversal. s;docutils.nodes.Node.walkabout calling dispatch_visit for %ss?docutils.nodes.Node.walkabout calling dispatch_departure for %s(RRRR R!R"R#R$R&R'R(t walkaboutR*R%R+tdispatch_departure(RR,t call_departR-R(R((s2/tmp/pip-install-usGedi/docutils/docutils/nodes.pyR.s<            cCsSg}t||r%|j|nx'|jD]}|j|j|q/W|S(s:Specialized traverse() that only supports instance checks.(t isinstancetappendR(textendt_fast_traverse(RtclstresultR((s2/tmp/pip-install-usGedi/docutils/docutils/nodes.pyR4s cCs>g}|j|x$|jD]}|j|jqW|S(s:Specialized traverse() that doesn't check for a condition.(R2R(R3t _all_traverse(RR6R((s2/tmp/pip-install-usGedi/docutils/docutils/nodes.pyR7s  c Cs|rt}n|r`|r`| r`|dkr8|jSt|tjtfr`|j|Snt|tjtfr|}|d}ng}|r|dks||r|j|n|rt |j rxB|D]7}|j |j dtdtdt dt d|qWn|s'|r|} x| jr| jj| } xJ| j| dD]7} |j | j dtd|dt dt d|q]W|sPq0| j} q0Wn|S( s Return an iterable containing * self (if include_self is true) * all descendants in tree traversal order (if descend is true) * all siblings (if siblings is true) and their descendants (if also descend is true) * the siblings of the parent (if ascend is true) and their descendants (if also descend is true), and so on If `condition` is not None, the iterable contains only nodes for which ``condition(node)`` is true. If `condition` is a node class ``cls``, it is equivalent to a function consisting of ``return isinstance(node, cls)``. If ascend is true, assume siblings to be true as well. For example, given the following tree:: <--- emphasis.traverse() and <--- strong.traverse() are called. Foo Bar Baz Then list(emphasis.traverse()) equals :: [, , <#text: Foo>, <#text: Bar>] and list(strong.traverse(ascend=True)) equals :: [, <#text: Foo>, <#text: Bar>, , <#text: Baz>] cSs t||S(N(R1(tnodet node_class((s2/tmp/pip-install-usGedi/docutils/docutils/nodes.pyt conditionst include_selftdescendtsiblingstascendR:iN(RR R7R1ttypest ClassTypettypeR4R2tlenR(R3ttraverseRRtindex( RR:R;R<R=R>R9trRR8RDtsibling((s2/tmp/pip-install-usGedi/docutils/docutils/nodes.pyRCs>%        c CsO|jd|d|d|d|d|}y |dSWntk rJdSXdS(s Return the first node in the iterable returned by traverse(), or None if the iterable is empty. Parameter list is the same as of traverse. Note that include_self defaults to 0, though. R:R;R<R=R>iN(RCt IndexErrorR (RR:R;R<R=R>titerable((s2/tmp/pip-install-usGedi/docutils/docutils/nodes.pyt next_nodes    N(i(R#t __module__t__doc__R RRRRRtsyst version_infoRRRRRRR)R.R4R7RRRCRI(((s2/tmp/pip-install-usGedi/docutils/docutils/nodes.pyR$s*      . +  J it reprunicodecBseZdZdZRS(sU A unicode sub-class that removes the initial u from unicode's repr. cCstj|dS(Ni(Rt__repr__(R((s2/tmp/pip-install-usGedi/docutils/docutils/nodes.pyRO1s(R#RJRKRO(((s2/tmp/pip-install-usGedi/docutils/docutils/nodes.pyRN,scCs2tjdkr.t|tr.|jddS|S(s4 Failsave conversion of `unicode` to `str`. itasciitbackslashreplace(i(RLRMR1RR(ts((s2/tmp/pip-install-usGedi/docutils/docutils/nodes.pyt ensure_str9stTextcBseZdZdZdZejdkr6ddZn ddZddZ ddZ d Z d Z d Z d Zd ZdddZddZddZRS(s Instances are terminal nodes (leaves) containing text only; no child nodes or attributes. Initialize by passing a string to the constructor. Access the text itself with the `astext` method. s#texticCs.t|trtdntj||S(s7Prevent the rawsource argument from propagating to str.sexpecting str data, not bytes(R1tbytest TypeErrorRNt__new__(R5tdatat rawsource((s2/tmp/pip-install-usGedi/docutils/docutils/nodes.pyRWPscCstj||S(s7Prevent the rawsource argument from propagating to str.(RNRW(R5RXRY((s2/tmp/pip-install-usGedi/docutils/docutils/nodes.pyRWVstcCs ||_dS(N(RY(RRXRY((s2/tmp/pip-install-usGedi/docutils/docutils/nodes.pyt__init__Zs icCsD|}t||kr-||d d}nd|jt|fS(Nis ...s<%s: %r>(RBttagnameRN(RtmaxlenRX((s2/tmp/pip-install-usGedi/docutils/docutils/nodes.pyt shortrepr_scCs|jddS(NR]iD(R^(R((s2/tmp/pip-install-usGedi/docutils/docutils/nodes.pyROescCs|jt|S(N(tcreateTextNodeR(RR((s2/tmp/pip-install-usGedi/docutils/docutils/nodes.pyRhscCs t|S(N(RN(R((s2/tmp/pip-install-usGedi/docutils/docutils/nodes.pytastextkscCs|jt|d|jS(NRY(R"RNRY(R((s2/tmp/pip-install-usGedi/docutils/docutils/nodes.pyRwscCs |jS(N(R(R((s2/tmp/pip-install-usGedi/docutils/docutils/nodes.pyRzss icCsIg}||}x)|jD]}|j||dqWdj|S(Ns RZ(t splitlinesR2tjoin(RRRR6R((s2/tmp/pip-install-usGedi/docutils/docutils/nodes.pyR}s  cCs|jtj||S(N(R"RNtrstrip(Rtchars((s2/tmp/pip-install-usGedi/docutils/docutils/nodes.pyRcscCs|jtj||S(N(R"RNtlstrip(RRd((s2/tmp/pip-install-usGedi/docutils/docutils/nodes.pyRes((iN(R#RJRKR\R(RLRMR RWR[R^RORR`RRRRcRe(((s2/tmp/pip-install-usGedi/docutils/docutils/nodes.pyRTBs         tElementcBseZdZdEZdFZeeZedGZdHZdZ dd Z d Z d Z d Z d ZejdIkreZndHdZdZdZdZdZdZdZdZdZdZdZdZdZdZdHdZ dZ!dZ"dHd Z#e!Z$e!Zdd!Z%d"Z&d#Z'd$Z(d%d&Z)d'Z*d(Z+d)Z,d*Z-d+Z.d,Z/e0d-Z1e0d.Z2d/Z3d0Z4d1Z5e5e0e6d2Z7e0e6d3Z8e0e6d4Z9e0e6d5Z:e6d6Z;d7Z<d8Z=d9Z>d:ej?d;Z@d:ej?d<ZAd=d:d>ZBd?ZCd@ZDdAZEdHdHdBZFeGdCZHeGdDZIRS(Js `Element` is the superclass to all specific elements. Elements contain attributes and child nodes. Elements emulate dictionaries for attributes, indexing by attribute name (a string). To set the attribute 'att' to 'value', do:: element['att'] = 'value' There are two special attributes: 'ids' and 'names'. Both are lists of unique identifiers, and names serve as human interfaces to IDs. Names are case- and whitespace-normalized (see the fully_normalize_name() function), and IDs conform to the regular expression ``[a-z](-?[a-z0-9]+)*`` (see the make_id() function). Elements also emulate lists for child nodes (element nodes and/or text nodes), indexing by integer. To get the first child node, use:: element[0] Elements may be constructed using the ``+=`` operator. To add one new child node to element, do:: element += node This is equivalent to ``element.append(node)``. To add a list of multiple child nodes at once, use the same ``+=`` operator:: element += [node1, node2] This is equivalent to ``element.extend([node1, node2])``. tidstclassestnamestdupnamestbackrefsRs RZcOs||_g|_|j|i|_x|jD]}g|j|s; s<%s: %s>(R(R^RBR"R#RbRS(RRXtctn((s2/tmp/pip-install-usGedi/docutils/docutils/nodes.pyROs  1cCsS|drDd|jjdjg|dD]}t|^q'fSd|jSdS(NRis <%s "%s"...>s; s<%s...>(R"R#RbRSR\(RR}((s2/tmp/pip-install-usGedi/docutils/docutils/nodes.pyR^s  .cCsY|jrKd|jdjg|jD]}t|^q%|jfS|jSdS(Nu%s%s%sRZ(R(tstarttagRbRtendtagtemptytag(RR|((s2/tmp/pip-install-usGedi/docutils/docutils/nodes.pyt __unicode__s   (icCs|dkrt}n|jg}x|jD]\}}|dkr]|jd|q.nt|trg|D]}td|f^qs}dj|}n t |}||}|jd||fq.Wddj|S(Ns %s="True"s%sRru%s=%su<%s>u ( R tpseudo_quoteattrR\RtR2R1RuRvRbR(Rt quoteattrtpartstnameRqR{tvalues((s2/tmp/pip-install-usGedi/docutils/docutils/nodes.pyR~s    &  cCs d|jS(Ns(R\(R((s2/tmp/pip-install-usGedi/docutils/docutils/nodes.pyR#scCsDddj|jgg|jD]\}}d||f^qS(Nu<%s/>u s%s="%s"(RbR\Rt(RR}R{((s2/tmp/pip-install-usGedi/docutils/docutils/nodes.pyR&scCs t|jS(N(RBR((R((s2/tmp/pip-install-usGedi/docutils/docutils/nodes.pyt__len__+scCs)t|tr||jkS||jkS(N(R1t basestringRlR((Rtkey((s2/tmp/pip-install-usGedi/docutils/docutils/nodes.pyt __contains__.s cCst|tr|j|St|tr4|j|St|tjru|jdksat d|j|j |j !St ddS(Niscannot handle slice with stridesFelement index must be an integer, a slice, or an attribute name string(Ni( R1RRltintR(R?t SliceTypetstepR tAssertionErrortstartR-RV(RR((s2/tmp/pip-install-usGedi/docutils/docutils/nodes.pyt __getitem__5s  cCst|tr%||jt||j||jj|dgj||j|dS(NR4(R$RRR2R5(RR;((s2/tmp/pip-install-usGedi/docutils/docutils/nodes.pytnote_footnote_refs  cCs|jj|dS(N(R R2(Rtcitation((s2/tmp/pip-install-usGedi/docutils/docutils/nodes.pyt note_citationscCs>|j||jj|dgj||j|dS(NR4(R$RRR2R5(RR;((s2/tmp/pip-install-usGedi/docutils/docutils/nodes.pytnote_citation_refs  cCst|}||jkrm|jjd|d|}|dkrP||7}n|j|}t||n||j|<||jt|R?R@RBRCRJRLRPRRRSRURRV(((s2/tmp/pip-install-usGedi/docutils/docutils/nodes.pyRs< Y  ' *                      ttitlecBseZRS((R#RJ(((s2/tmp/pip-install-usGedi/docutils/docutils/nodes.pyRWstsubtitlecBseZRS((R#RJ(((s2/tmp/pip-install-usGedi/docutils/docutils/nodes.pyRXstrubriccBseZRS((R#RJ(((s2/tmp/pip-install-usGedi/docutils/docutils/nodes.pyRYstdocinfocBseZRS((R#RJ(((s2/tmp/pip-install-usGedi/docutils/docutils/nodes.pyRZstauthorcBseZRS((R#RJ(((s2/tmp/pip-install-usGedi/docutils/docutils/nodes.pyR[stauthorscBseZRS((R#RJ(((s2/tmp/pip-install-usGedi/docutils/docutils/nodes.pyR\st organizationcBseZRS((R#RJ(((s2/tmp/pip-install-usGedi/docutils/docutils/nodes.pyR]staddresscBseZRS((R#RJ(((s2/tmp/pip-install-usGedi/docutils/docutils/nodes.pyR^stcontactcBseZRS((R#RJ(((s2/tmp/pip-install-usGedi/docutils/docutils/nodes.pyR_stversioncBseZRS((R#RJ(((s2/tmp/pip-install-usGedi/docutils/docutils/nodes.pyR`strevisioncBseZRS((R#RJ(((s2/tmp/pip-install-usGedi/docutils/docutils/nodes.pyRaststatuscBseZRS((R#RJ(((s2/tmp/pip-install-usGedi/docutils/docutils/nodes.pyRbstdatecBseZRS((R#RJ(((s2/tmp/pip-install-usGedi/docutils/docutils/nodes.pyRcst copyrightcBseZRS((R#RJ(((s2/tmp/pip-install-usGedi/docutils/docutils/nodes.pyRdsRcBseZdZdZRS(cCsHt|j s't|jdt r=|jdtn|jdS(Ni(RBR(R1theaderR(R((s2/tmp/pip-install-usGedi/docutils/docutils/nodes.pyt get_headers'cCsEt|j s't|jdt r:|jtn|jdS(Ni(RBR(R1tfooterR2(R((s2/tmp/pip-install-usGedi/docutils/docutils/nodes.pyt get_footers'(R#RJRfRh(((s2/tmp/pip-install-usGedi/docutils/docutils/nodes.pyRs RecBseZRS((R#RJ(((s2/tmp/pip-install-usGedi/docutils/docutils/nodes.pyResRgcBseZRS((R#RJ(((s2/tmp/pip-install-usGedi/docutils/docutils/nodes.pyRgstsectioncBseZRS((R#RJ(((s2/tmp/pip-install-usGedi/docutils/docutils/nodes.pyRisttopiccBseZdZRS(s Topics are terminal, "leaf" mini-sections, like block quotes with titles, or textual figures. A topic is just like a section, except that it has no subsections, and it doesn't have to conform to section placement rules. Topics are allowed wherever body elements (list, table, etc.) are allowed, but only at the top level of a section or document. Topics cannot nest inside topics, sidebars, or body elements; you can't have a topic inside a table, list, block quote, etc. (R#RJRK(((s2/tmp/pip-install-usGedi/docutils/docutils/nodes.pyRjs tsidebarcBseZdZRS(s Sidebars are like miniature, parallel documents that occur inside other documents, providing related or reference material. A sidebar is typically offset by a border and "floats" to the side of the page; the document's main text may flow around it. Sidebars can also be likened to super-footnotes; their content is outside of the flow of the document's main text. Sidebars are allowed wherever body elements (list, table, etc.) are allowed, but only at the top level of a section or document. Sidebars cannot nest inside sidebars, topics, or body elements; you can't have a sidebar inside a table, list, block quote, etc. (R#RJRK(((s2/tmp/pip-install-usGedi/docutils/docutils/nodes.pyRkst transitioncBseZRS((R#RJ(((s2/tmp/pip-install-usGedi/docutils/docutils/nodes.pyRl"st paragraphcBseZRS((R#RJ(((s2/tmp/pip-install-usGedi/docutils/docutils/nodes.pyRm)stcompoundcBseZRS((R#RJ(((s2/tmp/pip-install-usGedi/docutils/docutils/nodes.pyRn*st containercBseZRS((R#RJ(((s2/tmp/pip-install-usGedi/docutils/docutils/nodes.pyRo+st bullet_listcBseZRS((R#RJ(((s2/tmp/pip-install-usGedi/docutils/docutils/nodes.pyRp,stenumerated_listcBseZRS((R#RJ(((s2/tmp/pip-install-usGedi/docutils/docutils/nodes.pyRq-st list_itemcBseZRS((R#RJ(((s2/tmp/pip-install-usGedi/docutils/docutils/nodes.pyRr.stdefinition_listcBseZRS((R#RJ(((s2/tmp/pip-install-usGedi/docutils/docutils/nodes.pyRs/stdefinition_list_itemcBseZRS((R#RJ(((s2/tmp/pip-install-usGedi/docutils/docutils/nodes.pyRt0sttermcBseZRS((R#RJ(((s2/tmp/pip-install-usGedi/docutils/docutils/nodes.pyRu1st classifiercBseZRS((R#RJ(((s2/tmp/pip-install-usGedi/docutils/docutils/nodes.pyRv2st definitioncBseZRS((R#RJ(((s2/tmp/pip-install-usGedi/docutils/docutils/nodes.pyRw3st field_listcBseZRS((R#RJ(((s2/tmp/pip-install-usGedi/docutils/docutils/nodes.pyRx4stfieldcBseZRS((R#RJ(((s2/tmp/pip-install-usGedi/docutils/docutils/nodes.pyRy5st field_namecBseZRS((R#RJ(((s2/tmp/pip-install-usGedi/docutils/docutils/nodes.pyRz6st field_bodycBseZRS((R#RJ(((s2/tmp/pip-install-usGedi/docutils/docutils/nodes.pyR{7stoptioncBseZdZRS(RZ(R#RJR(((s2/tmp/pip-install-usGedi/docutils/docutils/nodes.pyR|:stoption_argumentcBseZdZRS(cCs|jddtj|S(Nt delimiterRr(RRR`(R((s2/tmp/pip-install-usGedi/docutils/docutils/nodes.pyR`As(R#RJR`(((s2/tmp/pip-install-usGedi/docutils/docutils/nodes.pyR}?st option_groupcBseZdZRS(s, (R#RJR(((s2/tmp/pip-install-usGedi/docutils/docutils/nodes.pyREst option_listcBseZRS((R#RJ(((s2/tmp/pip-install-usGedi/docutils/docutils/nodes.pyRJstoption_list_itemcBseZdZRS(s (R#RJR(((s2/tmp/pip-install-usGedi/docutils/docutils/nodes.pyRMst option_stringcBseZRS((R#RJ(((s2/tmp/pip-install-usGedi/docutils/docutils/nodes.pyRRst descriptioncBseZRS((R#RJ(((s2/tmp/pip-install-usGedi/docutils/docutils/nodes.pyRSst literal_blockcBseZRS((R#RJ(((s2/tmp/pip-install-usGedi/docutils/docutils/nodes.pyRTst doctest_blockcBseZRS((R#RJ(((s2/tmp/pip-install-usGedi/docutils/docutils/nodes.pyRUst math_blockcBseZRS((R#RJ(((s2/tmp/pip-install-usGedi/docutils/docutils/nodes.pyRVst line_blockcBseZRS((R#RJ(((s2/tmp/pip-install-usGedi/docutils/docutils/nodes.pyRWsRcBseZdZRS(N(R#RJR R(((s2/tmp/pip-install-usGedi/docutils/docutils/nodes.pyRZst block_quotecBseZRS((R#RJ(((s2/tmp/pip-install-usGedi/docutils/docutils/nodes.pyR_st attributioncBseZRS((R#RJ(((s2/tmp/pip-install-usGedi/docutils/docutils/nodes.pyR`st attentioncBseZRS((R#RJ(((s2/tmp/pip-install-usGedi/docutils/docutils/nodes.pyRastcautioncBseZRS((R#RJ(((s2/tmp/pip-install-usGedi/docutils/docutils/nodes.pyRbstdangercBseZRS((R#RJ(((s2/tmp/pip-install-usGedi/docutils/docutils/nodes.pyRcsREcBseZRS((R#RJ(((s2/tmp/pip-install-usGedi/docutils/docutils/nodes.pyREdst importantcBseZRS((R#RJ(((s2/tmp/pip-install-usGedi/docutils/docutils/nodes.pyRestnotecBseZRS((R#RJ(((s2/tmp/pip-install-usGedi/docutils/docutils/nodes.pyRfsttipcBseZRS((R#RJ(((s2/tmp/pip-install-usGedi/docutils/docutils/nodes.pyRgsthintcBseZRS((R#RJ(((s2/tmp/pip-install-usGedi/docutils/docutils/nodes.pyRhstwarningcBseZRS((R#RJ(((s2/tmp/pip-install-usGedi/docutils/docutils/nodes.pyRist admonitioncBseZRS((R#RJ(((s2/tmp/pip-install-usGedi/docutils/docutils/nodes.pyRjstcommentcBseZRS((R#RJ(((s2/tmp/pip-install-usGedi/docutils/docutils/nodes.pyRkstsubstitution_definitioncBseZRS((R#RJ(((s2/tmp/pip-install-usGedi/docutils/docutils/nodes.pyRlsR1cBseZRS((R#RJ(((s2/tmp/pip-install-usGedi/docutils/docutils/nodes.pyR1msR9cBseZRS((R#RJ(((s2/tmp/pip-install-usGedi/docutils/docutils/nodes.pyR9nsRAcBseZRS((R#RJ(((s2/tmp/pip-install-usGedi/docutils/docutils/nodes.pyRAostlabelcBseZRS((R#RJ(((s2/tmp/pip-install-usGedi/docutils/docutils/nodes.pyRpstfigurecBseZRS((R#RJ(((s2/tmp/pip-install-usGedi/docutils/docutils/nodes.pyRqstcaptioncBseZRS((R#RJ(((s2/tmp/pip-install-usGedi/docutils/docutils/nodes.pyRrstlegendcBseZRS((R#RJ(((s2/tmp/pip-install-usGedi/docutils/docutils/nodes.pyRssttablecBseZRS((R#RJ(((s2/tmp/pip-install-usGedi/docutils/docutils/nodes.pyRtsttgroupcBseZRS((R#RJ(((s2/tmp/pip-install-usGedi/docutils/docutils/nodes.pyRustcolspeccBseZRS((R#RJ(((s2/tmp/pip-install-usGedi/docutils/docutils/nodes.pyRvsttheadcBseZRS((R#RJ(((s2/tmp/pip-install-usGedi/docutils/docutils/nodes.pyRwsttbodycBseZRS((R#RJ(((s2/tmp/pip-install-usGedi/docutils/docutils/nodes.pyRxstrowcBseZRS((R#RJ(((s2/tmp/pip-install-usGedi/docutils/docutils/nodes.pyRystentrycBseZRS((R#RJ(((s2/tmp/pip-install-usGedi/docutils/docutils/nodes.pyRzsR+cBs#eZdZddZdZRS(s System message element. Do not instantiate this class directly; use ``document.reporter.info/warning/error/severe()`` instead. cOs\|r%td|}|f|}nytj|d||Wnd|fGHnXdS(NRZssystem_message: children=%r(RmRfR[(RRQR(Rltp((s2/tmp/pip-install-usGedi/docutils/docutils/nodes.pyR[s cCs>|jdd}d|d||d|dtj|fS(NRRZu%s:%s: (%s/%s) %sRRAR(RRfR`(RR((s2/tmp/pip-install-usGedi/docutils/docutils/nodes.pyR`sN(R#RJRKR R[R`(((s2/tmp/pip-install-usGedi/docutils/docutils/nodes.pyR+}s RNcBs5eZdZdddZdddZdZRS(sF The "pending" element is used to encapsulate a pending operation: the operation (transform), the point at which to apply it, and any data it requires. Only the pending operation's location within the document is stored in the public document tree (by the "pending" object itself); the operation and its data are stored in the "pending" object's internal instance attributes. For example, say you want a table of contents in your reStructuredText document. The easiest way to specify where to put it is from within the document, with a directive:: .. contents:: But the "contents" directive can't do its work until the entire document has been parsed and possibly transformed to some extent. So the directive code leaves a placeholder behind that will trigger the second phase of its processing, something like this:: + internal attributes Use `document.note_pending()` so that the `docutils.transforms.Transformer` stage of processing can run all pending transforms. RZcOs2tj||||||_|p(i|_dS(N(RfR[t transformtdetails(RRRRYR(Rl((s2/tmp/pip-install-usGedi/docutils/docutils/nodes.pyR[s s ic Csdd|jj|jjfdg}|jj}|jx|D]\}}t|tr|jdd|f|j g|j j D]}dd|f^qqE|r9t|t r9t|dtr9|jdd|fxa|D]<}|j g|j j D]}dd|f^qqWqE|jdd||fqEWt j |||djg|D]}d |||f^qvS( Ns.. internal attributes:s .transform: %s.%ss .details:s%7s%s:RZs%9s%sis %7s%s: %rs %s%s (RRJR#RRnRR1RR2R3RRaRuRfRb( RRRt internalsRRRqRR{((s2/tmp/pip-install-usGedi/docutils/docutils/nodes.pyRs*     0  4 cCs"|j|j|j|j|jS(N(R"RRRYRl(R((s2/tmp/pip-install-usGedi/docutils/docutils/nodes.pyRsN(R#RJRKR R[RR(((s2/tmp/pip-install-usGedi/docutils/docutils/nodes.pyRNs  trawcBseZdZRS(s@ Raw data that is to be passed untouched to the Writer. (R#RJRK(((s2/tmp/pip-install-usGedi/docutils/docutils/nodes.pyRstemphasiscBseZRS((R#RJ(((s2/tmp/pip-install-usGedi/docutils/docutils/nodes.pyRststrongcBseZRS((R#RJ(((s2/tmp/pip-install-usGedi/docutils/docutils/nodes.pyRstliteralcBseZRS((R#RJ(((s2/tmp/pip-install-usGedi/docutils/docutils/nodes.pyRst referencecBseZRS((R#RJ(((s2/tmp/pip-install-usGedi/docutils/docutils/nodes.pyRstfootnote_referencecBseZRS((R#RJ(((s2/tmp/pip-install-usGedi/docutils/docutils/nodes.pyRstcitation_referencecBseZRS((R#RJ(((s2/tmp/pip-install-usGedi/docutils/docutils/nodes.pyRstsubstitution_referencecBseZRS((R#RJ(((s2/tmp/pip-install-usGedi/docutils/docutils/nodes.pyRsttitle_referencecBseZRS((R#RJ(((s2/tmp/pip-install-usGedi/docutils/docutils/nodes.pyRst abbreviationcBseZRS((R#RJ(((s2/tmp/pip-install-usGedi/docutils/docutils/nodes.pyRstacronymcBseZRS((R#RJ(((s2/tmp/pip-install-usGedi/docutils/docutils/nodes.pyRst superscriptcBseZRS((R#RJ(((s2/tmp/pip-install-usGedi/docutils/docutils/nodes.pyRst subscriptcBseZRS((R#RJ(((s2/tmp/pip-install-usGedi/docutils/docutils/nodes.pyRstmathcBseZRS((R#RJ(((s2/tmp/pip-install-usGedi/docutils/docutils/nodes.pyRstimagecBseZdZRS(cCs|jddS(NtaltRZ(R(R((s2/tmp/pip-install-usGedi/docutils/docutils/nodes.pyR`s(R#RJR`(((s2/tmp/pip-install-usGedi/docutils/docutils/nodes.pyRstinlinecBseZRS((R#RJ(((s2/tmp/pip-install-usGedi/docutils/docutils/nodes.pyRst problematiccBseZRS((R#RJ(((s2/tmp/pip-install-usGedi/docutils/docutils/nodes.pyRst generatedcBseZRS((R#RJ(((s2/tmp/pip-install-usGedi/docutils/docutils/nodes.pyRss< Text abbreviation acronym address admonition attention attribution author authors block_quote bullet_list caption caution citation citation_reference classifier colspec comment compound contact container copyright danger date decoration definition definition_list definition_list_item description docinfo doctest_block document emphasis entry enumerated_list error field field_body field_list field_name figure footer footnote footnote_reference generated header hint image important inline label legend line line_block list_item literal literal_block math math_block note option option_argument option_group option_list option_list_item option_string organization paragraph pending problematic raw reference revision row rubric section sidebar status strong subscript substitution_definition substitution_reference subtitle superscript system_message table target tbody term tgroup thead tip title title_reference topic transition version warningt NodeVisitorcBsAeZdZdZdZdZdZdZdZRS(s "Visitor" pattern [GoF95]_ abstract superclass implementation for document tree traversals. Each node class has corresponding methods, doing nothing by default; override individual methods for specific and useful behaviour. The `dispatch_visit()` method is called by `Node.walk()` upon entering a node. `Node.walkabout()` also calls the `dispatch_departure()` method before exiting a node. The dispatch methods call "``visit_`` + node class name" or "``depart_`` + node class name", resp. This is a base class for visitors whose ``visit_...`` & ``depart_...`` methods should be implemented for *all* node types encountered (such as for `docutils.writers.Writer` subclasses). Unimplemented methods will raise exceptions. For sparse traversals, where only certain node types are of interest, subclass `SparseNodeVisitor` instead. When (mostly or entirely) uniform processing is desired, subclass `GenericNodeVisitor`. .. [GoF95] Gamma, Helm, Johnson, Vlissides. *Design Patterns: Elements of Reusable Object-Oriented Software*. Addison-Wesley, Reading, MA, USA, 1995. cCs ||_dS(N(R(RR((s2/tmp/pip-install-usGedi/docutils/docutils/nodes.pyR[LscCsO|jj}t|d||j}|jjjd|j|f||S(s Call self."``visit_`` + node class name" with `node` as parameter. If the ``visit_...`` method does not exist, call self.unknown_visit. tvisit_s;docutils.nodes.NodeVisitor.dispatch_visit calling %s for %s(R"R#Rt unknown_visitRR R!(RR8t node_nametmethod((s2/tmp/pip-install-usGedi/docutils/docutils/nodes.pyR$Os   cCsO|jj}t|d||j}|jjjd|j|f||S(s Call self."``depart_`` + node class name" with `node` as parameter. If the ``depart_...`` method does not exist, call self.unknown_departure. tdepart_s?docutils.nodes.NodeVisitor.dispatch_departure calling %s for %s(R"R#Rtunknown_departureRR R!(RR8RR((s2/tmp/pip-install-usGedi/docutils/docutils/nodes.pyR/\s   cCsJ|jjjs$|jj|jkrFtd|j|jjfndS(sk Called when entering unknown `Node` types. Raise an exception unless overridden. s!%s visiting unknown node type: %sN(RRtstrict_visitorR"R#toptionalR(RR8((s2/tmp/pip-install-usGedi/docutils/docutils/nodes.pyRis cCsJ|jjjs$|jj|jkrFtd|j|jjfndS(si Called before exiting unknown `Node` types. Raise exception unless overridden. s"%s departing unknown node type: %sN(RRRR"R#RR(RR8((s2/tmp/pip-install-usGedi/docutils/docutils/nodes.pyRus (( R#RJRKRR[R$R/RR(((s2/tmp/pip-install-usGedi/docutils/docutils/nodes.pyR%s  tSparseNodeVisitorcBseZdZRS(s Base class for sparse traversals, where only certain node types are of interest. When ``visit_...`` & ``depart_...`` methods should be implemented for *all* node types (such as for `docutils.writers.Writer` subclasses), subclass `NodeVisitor` instead. (R#RJRK(((s2/tmp/pip-install-usGedi/docutils/docutils/nodes.pyRstGenericNodeVisitorcBs eZdZdZdZRS(s Generic "Visitor" abstract superclass, for simple traversals. Unless overridden, each ``visit_...`` method calls `default_visit()`, and each ``depart_...`` method (when using `Node.walkabout()`) calls `default_departure()`. `default_visit()` (and `default_departure()`) must be overridden in subclasses. Define fully generic visitors by overriding `default_visit()` (and `default_departure()`) only. Define semi-generic visitors by overriding individual ``visit_...()`` (and ``depart_...()``) methods also. `NodeVisitor.unknown_visit()` (`NodeVisitor.unknown_departure()`) should be overridden for default behavior. cCs tdS(s)Override for generic, uniform traversals.N(R(RR8((s2/tmp/pip-install-usGedi/docutils/docutils/nodes.pyt default_visitscCs tdS(s)Override for generic, uniform traversals.N(R(RR8((s2/tmp/pip-install-usGedi/docutils/docutils/nodes.pytdefault_departures(R#RJRKRR(((s2/tmp/pip-install-usGedi/docutils/docutils/nodes.pyRs cCs|j|dS(N(R(RR8((s2/tmp/pip-install-usGedi/docutils/docutils/nodes.pyt_call_default_visitscCs|j|dS(N(R(RR8((s2/tmp/pip-install-usGedi/docutils/docutils/nodes.pyt_call_default_departurescCsdS(N((RR8((s2/tmp/pip-install-usGedi/docutils/docutils/nodes.pyt_nopscCsex^|D]V}ttd|tttd|tttd|tttd|tqWdS(s%Save typing with dynamic assignments:RRN(tsetattrRRRRR(Rit_name((s2/tmp/pip-install-usGedi/docutils/docutils/nodes.pyt_add_node_class_namess  tTreeCopyVisitorcBs2eZdZdZdZdZdZRS(sQ Make a complete copy of a tree or branch, including element attributes. cCs&tj||g|_g|_dS(N(RR[t parent_stackR(RR((s2/tmp/pip-install-usGedi/docutils/docutils/nodes.pyR[s cCs |jdS(Ni(R(R((s2/tmp/pip-install-usGedi/docutils/docutils/nodes.pyt get_tree_copyscCs<|j}|jj||jj|j||_dS(s9Copy the current node, and make it the new acting parent.N(RRR2R(RR8tnewnode((s2/tmp/pip-install-usGedi/docutils/docutils/nodes.pyRs cCs|jj|_dS(s#Restore the previous acting parent.N(RRR(RR8((s2/tmp/pip-install-usGedi/docutils/docutils/nodes.pyRs(R#RJRKR[RRR(((s2/tmp/pip-install-usGedi/docutils/docutils/nodes.pyRs    tTreePruningExceptioncBseZdZRS(s Base class for `NodeVisitor`-related tree pruning exceptions. Raise subclasses from within ``visit_...`` or ``depart_...`` methods called from `Node.walk()` and `Node.walkabout()` tree traversals to prune the tree traversed. (R#RJRK(((s2/tmp/pip-install-usGedi/docutils/docutils/nodes.pyRsR%cBseZdZRS(s Do not visit any children of the current node. The current node's siblings and ``depart_...`` method are not affected. (R#RJRK(((s2/tmp/pip-install-usGedi/docutils/docutils/nodes.pyR%sR*cBseZdZRS(s Do not visit any more siblings (to the right) of the current node. The current node's children and its ``depart_...`` method are not affected. (R#RJRK(((s2/tmp/pip-install-usGedi/docutils/docutils/nodes.pyR*sR&cBseZdZRS(sq Do not visit the current node's children, and do not call the current node's ``depart_...`` method. (R#RJRK(((s2/tmp/pip-install-usGedi/docutils/docutils/nodes.pyR&sR'cBseZdZRS(s Do not call the current node's ``depart_...`` method. The current node's children and siblings are not affected. (R#RJRK(((s2/tmp/pip-install-usGedi/docutils/docutils/nodes.pyR'st NodeFoundcBseZdZRS(s Raise to indicate that the target of a search has been found. This exception must be caught by the client; it is not caught by the traversal code. (R#RJRK(((s2/tmp/pip-install-usGedi/docutils/docutils/nodes.pyR sR+cBseZdZRS(s= Stop the traversal alltogether. The current node's ``depart_...`` method is not affected. The parent nodes ``depart_...`` methods are also called as usual. No other nodes are visited. This is an alternative to NodeFound that does not cause exception handling to trickle up to the caller. (R#RJRK(((s2/tmp/pip-install-usGedi/docutils/docutils/nodes.pyR+scCs|j}t|ts*|j}n|jt}|jt}tjd|j ddjd}t j ddj |j }tj d|}t|S(s Convert `string` into an identifier and return it. Docutils identifiers will conform to the regular expression ``[a-z](-?[a-z0-9]+)*``. For CSS compatibility, identifiers (the "class" and "id" attributes) should have no underscores, colons, or periods. Hyphens may be used. - The `HTML 4.01 spec`_ defines identifiers based on SGML tokens: ID and NAME tokens must begin with a letter ([A-Za-z]) and may be followed by any number of letters, digits ([0-9]), hyphens ("-"), underscores ("_"), colons (":"), and periods ("."). - However the `CSS1 spec`_ defines identifiers based on the "name" token, a tighter interpretation ("flex" tokenizer notation; "latin1" and "escape" 8-bit characters have been replaced with entities):: unicode \[0-9a-f]{1,4} latin1 [¡-ÿ] escape {unicode}|\[ -~¡-ÿ] nmchar [-a-z0-9]|{latin1}|{escape} name {nmchar}+ The CSS1 "nmchar" rule does not include underscores ("_"), colons (":"), or periods ("."), therefore "class" and "id" attributes should not contain these characters. They should be replaced with hyphens ("-"). Combined with HTML's requirements (the first character must be a letter; no "unicode", "latin1", or "escape" characters), this results in the ``[a-z](-?[a-z0-9]+)*`` pattern. .. _HTML 4.01 spec: http://www.w3.org/TR/html401 .. _CSS1 spec: http://www.w3.org/TR/REC-CSS1 tNFKDRPtignoret-RrRZ(RoR1Rtdecodet translatet_non_id_translate_digraphst_non_id_translatet unicodedatat normalizeRt _non_id_charstsubRbtsplitt_non_id_at_endsR(tstringR((s2/tmp/pip-install-usGedi/docutils/docutils/nodes.pyR !s# !s [^a-z0-9]+s ^[-0-9]+|-+$uoiudiuhi'uii1uliButigubiiuciiufiukiiuniupiiiuyiuziugii%i4i5i6uji7i<usi?i@ueiGiIuqiKuriMiOusziuaeiuoeiSudbi8uqpi9cCs/|dj||dj|d|_dS(NRjRii(R2RR(R8R((s2/tmp/pip-install-usGedi/docutils/docutils/nodes.pyR*scCsdj|jjS(s.Return a case- and whitespace-normalized name.Rr(RbRoR(R((s2/tmp/pip-install-usGedi/docutils/docutils/nodes.pyRFscCsdj|jS(s$Return a whitespace-normalized name.Rr(RbR(R((s2/tmp/pip-install-usGedi/docutils/docutils/nodes.pyRDscCs|jddjddS(sDEscape string values that are elements of a list, for serialization.s\s\\Rrs\ (R(Rq((s2/tmp/pip-install-usGedi/docutils/docutils/nodes.pyRvscCsd|S(sQuote attributes for pseudo-xmls"%s"((Rq((s2/tmp/pip-install-usGedi/docutils/docutils/nodes.pyRs(RKt __docformat__RLtostreRR?RtobjectRRMRRNRSRTRfRRRRRRRRRRRRRRRRRRRRRRRWRXRYRZR[R\R]R^R_R`RaRbRcRdRReRgRiRjRkRlRmRnRoRpRqRrRsRtRuRvRwRxRyRzR{R|R}RRRRRRRRRRRRRRRRERRRRRRRRR1R9RARRRRRRRRRRRR+RNRRRRRRRRRRRRRRRRRRRtnode_class_namesRRRRRRRRt ExceptionRR%R*R&R'RR+R tcompileRRRRR*RFRDRvR(((s2/tmp/pip-install-usGedi/docutils/docutils/nodes.pyts        L   J """E " ]             1