AlkantarClanX12

Your IP : 3.129.247.250


Current Path : /proc/self/root/lib/python2.7/site-packages/pip/_vendor/html5lib/treebuilders/
Upload File :
Current File : //proc/self/root/lib/python2.7/site-packages/pip/_vendor/html5lib/treebuilders/etree.pyo

�
��abc@`s�ddlmZmZmZddlmZddlZddlmZddlm	Z	ddlm
Z
dd	l
mZdd
lm
Z
ejd�Zed�Ze
e�ZdS(
i(tabsolute_importtdivisiontunicode_literals(t	text_typeNi(tbasei(t	_ihatexml(t	constants(t
namespaces(tmoduleFactoryFactoryu
{([^}]*)}(.*)c
`s���jd�j�dtjf�fd��Y�d�f�fd��Y�d�f�fd��Y�d�f�fd	��Y�d
�f�fd��Y��fd��	��fd
�}dtjf��������	fd��Y}t�S(NuasdtElementc`s�eZd�fd�Zd�Zd�Zd�Zeee�Zd�Z	d�Z
ee
e	�Zd�Zd�Z
eee
�Zd�Zd	�Zeee�Zd
�Zd�Zd�Zd
�Zdd�Zd�Zd�ZRS(c`s�||_||_�j|j||��|_|dkrUtd|jf|_n|j|jf|_d|_g|_	g|_
dS(Nuhtml(t_namet
_namespaceR	t_getETreeTagt_elementtNoneRt	nameTupletparentt_childNodest_flags(tselftnamet	namespace(tElementTree(sK/usr/lib/python2.7/site-packages/pip/_vendor/html5lib/treebuilders/etree.pyt__init__s				cS`s)|dkr|}nd||f}|S(Nu{%s}%s(R(RRRt	etree_tag((sK/usr/lib/python2.7/site-packages/pip/_vendor/html5lib/treebuilders/etree.pyR#s	cS`s+||_|j|j|j�|j_dS(N(R
RRR
ttag(RR((sK/usr/lib/python2.7/site-packages/pip/_vendor/html5lib/treebuilders/etree.pyt_setName*s	cS`s|jS(N(R
(R((sK/usr/lib/python2.7/site-packages/pip/_vendor/html5lib/treebuilders/etree.pyt_getName.scS`s+||_|j|j|j�|j_dS(N(RRR
R
R(RR((sK/usr/lib/python2.7/site-packages/pip/_vendor/html5lib/treebuilders/etree.pyt
_setNamespace3s	cS`s|jS(N(R(R((sK/usr/lib/python2.7/site-packages/pip/_vendor/html5lib/treebuilders/etree.pyt
_getNamespace7scS`s
|jjS(N(R
tattrib(R((sK/usr/lib/python2.7/site-packages/pip/_vendor/html5lib/treebuilders/etree.pyt_getAttributes<scS`s�x-t|jjj��D]}|jj|=qWx]|j�D]O\}}t|t�rsd|d|df}n|}|jj||�q=WdS(Nu{%s}%sii(tlistR
Rtkeystitemst
isinstancettupletset(Rt
attributestkeytvalueR((sK/usr/lib/python2.7/site-packages/pip/_vendor/html5lib/treebuilders/etree.pyt_setAttributes?scS`s|jS(N(R(R((sK/usr/lib/python2.7/site-packages/pip/_vendor/html5lib/treebuilders/etree.pyt_getChildNodesMscS`s2|j2g|_x|D]}|j|�qWdS(N(R
RtinsertChild(RR(telement((sK/usr/lib/python2.7/site-packages/pip/_vendor/html5lib/treebuilders/etree.pyt_setChildNodesPs	
cS`st|jjpt|j��S(u,Return true if the node has children or text(tboolR
ttexttlen(R((sK/usr/lib/python2.7/site-packages/pip/_vendor/html5lib/treebuilders/etree.pyt
hasContentXscS`s0|jj|�|jj|j�||_dS(N(RtappendR
R(Rtnode((sK/usr/lib/python2.7/site-packages/pip/_vendor/html5lib/treebuilders/etree.pytappendChild\scS`s>t|j�j|j�}|jj||j�||_dS(N(R R
tindextinsertR(RR3trefNodeR5((sK/usr/lib/python2.7/site-packages/pip/_vendor/html5lib/treebuilders/etree.pytinsertBeforeascS`s0|jj|�|jj|j�d|_dS(N(RtremoveR
RR(RR3((sK/usr/lib/python2.7/site-packages/pip/_vendor/html5lib/treebuilders/etree.pytremoveChildfscS`s-t|j�s?|jjs*d|j_n|jj|7_n�|dkr�|jdjsnd|jd_n|jdj|7_n�t|j�}|j|j�}|dkr�|j|djs�d|j|d_n|j|dj|7_n-|jjsd|j_n|jj|7_dS(Nui����ii(R0R
R/RttailR R5(RtdataR8tchildrenR5((sK/usr/lib/python2.7/site-packages/pip/_vendor/html5lib/treebuilders/etree.pyt
insertTextks"cS`sLt|�|j|j�}x*|jj�D]\}}||j|<q+W|S(N(ttypeRRR&R"(RR,RR(((sK/usr/lib/python2.7/site-packages/pip/_vendor/html5lib/treebuilders/etree.pyt	cloneNode�scS`s�|jr+|jdjj|jj7_nH|jjsFd|j_n|jjdk	rs|jj|jj7_nd|j_tjj||�dS(Ni����u(t
childNodesR
R;R/RRtNodetreparentChildren(Rt	newParent((sK/usr/lib/python2.7/site-packages/pip/_vendor/html5lib/treebuilders/etree.pyRC�s	"N(t__name__t
__module__RRRRRtpropertyRRRRRR)R&R*R-RAR1R4R8R:R>R@RC((R(sK/usr/lib/python2.7/site-packages/pip/_vendor/html5lib/treebuilders/etree.pyR	s*
														tCommentc`s8eZ�fd�Zd�Zd�Zeee�ZRS(c`s1�j|�|_d|_g|_g|_dS(N(RHR
RRRR(RR<(R(sK/usr/lib/python2.7/site-packages/pip/_vendor/html5lib/treebuilders/etree.pyR�s		cS`s
|jjS(N(R
R/(R((sK/usr/lib/python2.7/site-packages/pip/_vendor/html5lib/treebuilders/etree.pyt_getData�scS`s||j_dS(N(R
R/(RR(((sK/usr/lib/python2.7/site-packages/pip/_vendor/html5lib/treebuilders/etree.pyt_setData�s(RERFRRIRJRGR<((R(sK/usr/lib/python2.7/site-packages/pip/_vendor/html5lib/treebuilders/etree.pyRH�s		tDocumentTypec`sYeZ�fd�Zd�Zd�Zeee�Zd�Zd�Zeee�Z	RS(c`s2�j|d�||j_||_||_dS(Nu
<!DOCTYPE>(RR
R/tpublicIdtsystemId(RRRLRM(R	(sK/usr/lib/python2.7/site-packages/pip/_vendor/html5lib/treebuilders/etree.pyR�s	cS`s|jjdd�S(NupublicIdu(R
tget(R((sK/usr/lib/python2.7/site-packages/pip/_vendor/html5lib/treebuilders/etree.pyt_getPublicId�scS`s&|dk	r"|jjd|�ndS(NupublicId(RR
R%(RR(((sK/usr/lib/python2.7/site-packages/pip/_vendor/html5lib/treebuilders/etree.pyt_setPublicId�scS`s|jjdd�S(NusystemIdu(R
RN(R((sK/usr/lib/python2.7/site-packages/pip/_vendor/html5lib/treebuilders/etree.pyt_getSystemId�scS`s&|dk	r"|jjd|�ndS(NusystemId(RR
R%(RR(((sK/usr/lib/python2.7/site-packages/pip/_vendor/html5lib/treebuilders/etree.pyt_setSystemId�s(
RERFRRORPRGRLRQRRRM((R	(sK/usr/lib/python2.7/site-packages/pip/_vendor/html5lib/treebuilders/etree.pyRK�s				tDocumentc`seZ�fd�ZRS(c`s�j|d�dS(Nu
DOCUMENT_ROOT(R(R(R	(sK/usr/lib/python2.7/site-packages/pip/_vendor/html5lib/treebuilders/etree.pyR�s(RERFR((R	(sK/usr/lib/python2.7/site-packages/pip/_vendor/html5lib/treebuilders/etree.pyRS�stDocumentFragmentc`seZ�fd�ZRS(c`s�j|d�dS(NuDOCUMENT_FRAGMENT(R(R(R	(sK/usr/lib/python2.7/site-packages/pip/_vendor/html5lib/treebuilders/etree.pyR�s(RERFR((R	(sK/usr/lib/python2.7/site-packages/pip/_vendor/html5lib/treebuilders/etree.pyRT�sc`s8g�d���fd���|d�dj��S(Nic`sVt|d�s|j�}n|jdkr�|jd�sK|jd�r�|jd�p]d}|jd�prd}�jd|j||f�q��jd|jf�nM|jdkrM�jd	�|jdk	r��jd
d|d|jf�n|jdk	rtd
��nt|d�r�t	|j
�r�td��q�n�|j�kr}�jdd||jf�ntj|j�}|dkr�|j}n/|j
�\}}tj|}d||f}�jdd||f�t|d�r�g}x�|j
j�D]r\}}	tj|�}|dk	ro|j
�\}}tj|}d||f}
n|}
|j|
|	f�qWx?t|�D].\}}	�jdd|d||	f�q�Wn|jr��jd
d|d|jf�n|d7}x|D]}�||�q
W|jrR�jd
d|d|jf�ndS(Nutagu
<!DOCTYPE>upublicIdusystemIduu<!DOCTYPE %s "%s" "%s">u
<!DOCTYPE %s>u
DOCUMENT_ROOTu	#documentu|%s"%s"u iuDocument node cannot have tailuattribu$Document node cannot have attributesu|%s<!-- %s -->u%s %su|%s<%s>u
|%s%s="%s"(thasattrtgetrootRRNR2R/RR;t	TypeErrorR0Rt
tag_regexptmatchtgroupsRtprefixesR"tsorted(R,tindentRLRMtnsmatchRtnstprefixR&R(tattr_stringtchild(tElementTreeCommentTypetrvtserializeElement(sK/usr/lib/python2.7/site-packages/pip/_vendor/html5lib/treebuilders/etree.pyRe�sZ	
%!

)	%

	u
(tjoin(R,(Rc(RdResK/usr/lib/python2.7/site-packages/pip/_vendor/html5lib/treebuilders/etree.pyttestSerializer�s7
c`sDg�tj�������fd���|�dj��S(u4Serialize an element and its child nodes to a stringc`smt|�j�r!|j�}n|jdkr�|jd�sN|jd�r�|jd�p`d}|jd�pud}�jd|j||f�qM�jd|jf�n�|jdkrL|jdk	r��j|j�n|jdk	rt	d��nt
|d	�r.t|j�r.t	d
��nx|D]}�|�q5Wn|j�kru�jd|jf�n�|js��jd�j
|j�f�n^d
jg|jj�D]%\}}d�j
|�|f^q��}�jd|j|f�|jr�j|j�nx|D]}�|�q"W�jd|jf�|jri�j|j�ndS(Nu
<!DOCTYPE>upublicIdusystemIduu<!DOCTYPE %s PUBLIC "%s" "%s">u
<!DOCTYPE %s>u
DOCUMENT_ROOTuDocument node cannot have tailuattribu$Document node cannot have attributesu	<!--%s-->u<%s>u u%s="%s"u<%s %s>u</%s>(R#RRVRRNR2R/RR;RWRUR0RtfromXmlNameRfR"(R,RLRMRbRR(tattr(RRctfilterRdRe(sK/usr/lib/python2.7/site-packages/pip/_vendor/html5lib/treebuilders/etree.pyRes@	
	#	;	
	u(Rt
InfosetFilterRf(R,(RRc(RjRdResK/usr/lib/python2.7/site-packages/pip/_vendor/html5lib/treebuilders/etree.pyttostrings
-
tTreeBuilderc`sSeZ�Z�Z�Z�Z�Z�Z�fd�Z�fd�Z	d�Z
RS(c`s
�|�S(N((RR,(Rg(sK/usr/lib/python2.7/site-packages/pip/_vendor/html5lib/treebuilders/etree.pyRgAsc`sP�r|jjS|jdk	r9|jjjd|j�S|jjjd�SdS(Nu{%s}htmluhtml(tdocumentR
tdefaultNamespaceRtfind(R(tfullTree(sK/usr/lib/python2.7/site-packages/pip/_vendor/html5lib/treebuilders/etree.pytgetDocumentDs
cS`stjj|�jS(N(RRmtgetFragmentR
(R((sK/usr/lib/python2.7/site-packages/pip/_vendor/html5lib/treebuilders/etree.pyRsNs(RERFt
documentClasstdoctypeClasstelementClasstcommentClasst
fragmentClasstimplementationRgRrRs((RHRSRTRKR	tElementTreeImplementationRqRg(sK/usr/lib/python2.7/site-packages/pip/_vendor/html5lib/treebuilders/etree.pyRm9s
(RHRRRBRmtlocals(RzRqRlRm((
RHRSRTRKR	RRcRzRqRgsK/usr/lib/python2.7/site-packages/pip/_vendor/html5lib/treebuilders/etree.pytgetETreeBuilders~>64(t
__future__RRRtpip._vendor.sixRtretRRRRt_utilsRtcompileRXtFalseR|tgetETreeModule(((sK/usr/lib/python2.7/site-packages/pip/_vendor/html5lib/treebuilders/etree.pyt<module>s�D