ReddlmZmZmZddlmZddlZddlmZddl m Z ddl m Z ej d Zd Ze eZdS) )absolute_importdivisionunicode_literals) OrderedDictN) string_types)base)moduleFactoryFactoryz {([^}]*)}(.*)c|}|djGfddtj}t S)Nasdc0eZdZdZfdZdZdZdZdS)#getETreeBuilder..TreeWalkeraGiven the particular ElementTree representation, this implementation, to avoid using recursion, returns "nodes" as tuples with the following content: 1. The current element 2. The index of the element relative to its parent 3. A stack of ancestor elements 4. A flag "text", "tail" or None to indicate if the current node is a text node; either the text or tail of the current element (1) c t|tr)|\}}}}|dvrtjt ||fS|}t |ds|}|jdvr tjfS|jdkr;tj |j | d| dfS|j krtj |j fSt|jtsJt|jt|j}|r|\}}n d}|j}t%}t'|jD]V\} } t| }|r.| ||d|df<O| |d| f<Wtj|||t1|p|j fS) Ntexttailtag) DOCUMENT_ROOTDOCUMENT_FRAGMENTz publicIdsystemIdrr ) isinstancetupler TEXTgetattrhasattrgetrootrDOCUMENTDOCTYPErgetCOMMENTrtype tag_regexpmatchgroupsrlistattribitemsgroupELEMENTlen) selfnodeelt_flagr% namespacerattrsnamevalueElementTreeCommentTypes /builddir/build/BUILDROOT/alt-python311-pip-21.3.1-3.el8.x86_64/opt/alt/python311/lib/python3.11/site-packages/pip/_vendor/html5lib/treewalkers/etree.pygetNodeDetailsz2getETreeBuilder..TreeWalker.getNodeDetails s$&& "&Q4+++9gc4&8&888D4'' &||~~xAAA ''\)) di,,dhhz.B.BDD333|TY.."$(L99II4>>III"((22#%*\\^^NIss $I(C# #' (9(9(;(;#<#<44KD%&,,T22E4BGu{{1~~u{{1~~>??.3tTl++ is4yy5DI77ct|tr|\}}}}n |dgdf\}}}}|dvrdS|jr|||dfSt|r!|||dd|dfSdS)Nrrr)rrrr,appendr-r.elementkeyparentsr1s r7 getFirstChildz1getETreeBuilder..TreeWalker.getFirstChildHs$&& C.2+gtt.2D"d.B+gt'''t< "C&88\\ NN7+++"1:q'4774r9cBt|tr|\}}}}ndS|dkr2t|r!|||dd|dfSdS|jr |dkr|||dfS|t|ddz kr|d|dz|dz|dfSdS)Nrrrr)rrr,r;rr<s r7getNextSiblingz2getETreeBuilder..TreeWalker.getNextSiblingYs$&& .2+gtttv~~w<< NN7+++"1:q'4774< DFNN"C&883wr{++a///"2;sQw/q'4GG4r9cDt|tr|\}}}}ndS|dkr |s|S|||dfS|}|s|St|d|dksJ|t|d||dfS)NrrBr)rrpopr'countindex)r-r.r=r>r?r1parents r7 getParentNodez1getETreeBuilder..TreeWalker.getParentNodems$&& .2+gtttv~~7"N"C$66 R!M ,,226::a????!4 #4#4#:#:6#B#BGTQQr9N)__name__ __module__ __qualname____doc__r8r@rCrI)r6sr7 TreeWalkerrsk & 7& 7& 7& 7& 7P   "   ( R R R R Rr9rN)Commentrr NonRecursiveTreeWalkerlocals)ElementTreeImplementation ElementTreerNr6s @r7getETreeBuilderrTsv+K(0077;lRlRlRlRlRlRlRT0lRlRlR\ 88Or9) __future__rrr collectionsrrepip._vendor.sixrr _utilsr compiler$rTgetETreeModuler9r7r^sBBBBBBBBBB###### (((((()))))) RZ ( ( rrrj&%o66r9