Viewing File: /opt/alt/python35/lib/python3.5/site-packages/pip/_vendor/html5lib/treewalkers/etree.pyo

ó
“tÆ_c@`sddlmZmZmZddlmZddlZddlmZddl	m
Z
ddlmZej
d	ƒZd
„ZeeƒZdS(i(tabsolute_importtdivisiontunicode_literals(tOrderedDictN(tstring_typesi(tbasei(tmoduleFactoryFactoryu
{([^}]*)}(.*)c`s>|}|jdƒj‰dtjf‡fd†ƒY}tƒS(Nuasdt
TreeWalkerc`s8eZdZ‡fd†Zd„Zd„Zd„ZRS(uËGiven 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`s·t|tƒrL|\}}}}|dkrCtjt||ƒfS|}nt|dƒsj|jƒ}n|jdkrƒtjfS|jdkrºtj	|j
|jdƒ|jdƒfS|jˆkrÙtj|j
fSt
j|jƒ}|r|jƒ\}}nd}|j}tƒ}xmt|jjƒƒD]V\}	}
t
j|	ƒ}|rz|
||jd	ƒ|jd
ƒf<q4|
|d|	f<q4Wtj|||t|ƒp¯|j
fSdS(
Nutextutailutagu
DOCUMENT_ROOTuDOCUMENT_FRAGMENTu
<!DOCTYPE>upublicIdusystemIdii(utextutail(u
DOCUMENT_ROOTuDOCUMENT_FRAGMENT(t
isinstancettupleRtTEXTtgetattrthasattrtgetrootttagtDOCUMENTtDOCTYPEttexttgettCOMMENTt
tag_regexptmatchtgroupstNoneRtlisttattribtitemstgrouptELEMENTtlen(tselftnodeteltt_tflagRt	namespaceRtattrstnametvalue(tElementTreeCommentType(sW/opt/alt/python35/lib/python3.5/site-packages/pip/_vendor/html5lib/treewalkers/etree.pytgetNodeDetails s6	
		"%cS`s t|tƒr$|\}}}}n|dgdf\}}}}|dkrRdS|jrk|||dfSt|ƒr˜|j|ƒ|dd|dfSdSdS(Nutextutaili(utextutail(RR	RRRtappend(RRtelementtkeytparentsR"((sW/opt/alt/python35/lib/python3.5/site-packages/pip/_vendor/html5lib/treewalkers/etree.pyt
getFirstChildHs	
cS`sÏt|tƒr$|\}}}}ndS|dkrht|ƒra|j|ƒ|dd|dfSdSnc|jr|dkr|||dfS|t|dƒdkrÇ|d|d|d|dfSdSdS(Nutextiutailiÿÿÿÿi(RR	RRR)ttail(RRR*R+R,R"((sW/opt/alt/python35/lib/python3.5/site-packages/pip/_vendor/html5lib/treewalkers/etree.pytgetNextSiblingYs
 cS`sŽt|tƒr$|\}}}}ndS|dkrQ|s>|S|||dfSn9|jƒ}|sg|S|t|dƒj|ƒ|dfSdS(Nutextiÿÿÿÿ(RR	RtpopRtindex(RRR*R+R,R"tparent((sW/opt/alt/python35/lib/python3.5/site-packages/pip/_vendor/html5lib/treewalkers/etree.pyt
getParentNodems(t__name__t
__module__t__doc__R(R-R/R3((R'(sW/opt/alt/python35/lib/python3.5/site-packages/pip/_vendor/html5lib/treewalkers/etree.pyRs

(		(tCommentRRtNonRecursiveTreeWalkertlocals(tElementTreeImplementationtElementTreeR((R'sW/opt/alt/python35/lib/python3.5/site-packages/pip/_vendor/html5lib/treewalkers/etree.pytgetETreeBuildersn(t
__future__RRRtcollectionsRtretpip._vendor.sixRtRt_utilsRtcompileRR<tgetETreeModule(((sW/opt/alt/python35/lib/python3.5/site-packages/pip/_vendor/html5lib/treewalkers/etree.pyt<module>s	u
Back to Directory File Manager