Viewing File: /usr/lib64/python2.7/site-packages/lxml/ElementInclude.pyc

ó
œ]Nc@s"dZddlmZddlZy$ddlmZddlmZWn1ek
ryddl	mZddl
mZnXyeWn!ek
r¥ddl
mZnXdZedZed	Zd
ejfd„ƒYZdd„Zddd
„Zd„Zddd„Zdddd„ZdS(s
Limited XInclude support for the ElementTree package.

While lxml.etree has full support for XInclude (see
`etree.ElementTree.xinclude()`), this module provides a simpler, pure
Python, ElementTree compatible implementation that supports a simple
form of custom URL resolvers.
iÿÿÿÿ(tetreeN(turljoin(turlopen(tSets!{http://www.w3.org/2001/XInclude}tincludetfallbacktFatalIncludeErrorcBseZRS((t__name__t
__module__(((s9/usr/lib64/python2.7/site-packages/lxml/ElementInclude.pyRMscCskt|dƒ}|dkr3tj|ƒjƒ}n*|jƒ}|sNd}n|j|ƒ}|jƒ|S(Ntrbtxmlsutf-8(topenRtparsetgetroottreadtdecodetclose(threfRtencodingtfiletdata((s9/usr/lib64/python2.7/site-packages/lxml/ElementInclude.pytdefault_loader]s	
cCs‰|dkr'tj||ƒjƒ}n^d|krBt|ƒ}nt|dƒ}|jƒ}|jƒ|svd}n|j|ƒ}|S(NR
s://R	sutf-8(RRR
RRRRR(RRRtparserRtf((s9/usr/lib64/python2.7/site-packages/lxml/ElementInclude.pyt_lxml_default_loaderms
	csdd‡fd†}|S(Ncsˆ|||ƒS(N((RRRR(tloader(s9/usr/lib64/python2.7/site-packages/lxml/ElementInclude.pytload€s(tNone(RR((Rs9/usr/lib64/python2.7/site-packages/lxml/ElementInclude.pyt_wrap_et_loaderscCs’|dkr]t|dƒr0|}|jƒ}n|jƒ}t|dƒr{|jj}q{nt|dƒr{|jƒ}nt||d|ƒdS(NR
tdocinfotbase_url(RthasattrR
tgetroottreeRtURLt_include(telemRRttree((s9/usr/lib64/python2.7/site-packages/lxml/ElementInclude.pyR‘scCs»|dk	rt|ƒ}nt}|dkr9tƒ}n|jƒj}t|jdƒƒ}xW|D]O}|jt	krQt
||jdƒƒ}|jddƒ}	|jƒ}
|	dkr{||krÚt
d|ƒ‚n|j|ƒ|||	d|ƒ}|dkr!t
d||	fƒ‚nt|||ƒ}|jrX|jpHd|j|_n|
dkrh|S|
j||ƒq³|	d	kr>|||	d
|jd
ƒƒ}|dkrÊt
d||	fƒ‚n|jƒ}
|
dk	rû|
jpîd||
_n3|
dkr|S|
jpd||jp'd|
_|
j|ƒq³t
d|	ƒ‚qd|jtkr |jƒ}
|
dk	r³|
jt	kr³t
d|jƒ‚q³qdt
d
|jƒ‚qdW|S(Ns"{http://www.w3.org/2001/XInclude}*RRR
s recursive include of %r detectedRscannot load %r as %rtttextRs)unknown parse type in xi:include tag (%r)s0xi:fallback tag must be child of xi:include (%r)s0Invalid element found in XInclude namespace (%r)(RRRtsetR RtlisttiterttagtXINCLUDE_INCLUDERtgett	getparentRtaddR"ttailtreplacetgetpreviousR&tremovetXINCLUDE_FALLBACK(R#Rt
_parent_hrefsRtload_includeRtinclude_elementsteRRtparenttnodeR&tpredecessor((s9/usr/lib64/python2.7/site-packages/lxml/ElementInclude.pyR"žsd

	#(t__doc__tlxmlRtcopyturlparseRturllib2RtImportErrorturllib.parseturllib.requestR't	NameErrortsetsRtXINCLUDER+R3tLxmlSyntaxErrorRRRRRRR"(((s9/usr/lib64/python2.7/site-packages/lxml/ElementInclude.pyt<module>3s*



	
Back to Directory File Manager