Your IP : 18.191.171.86


Current Path : /opt/alt/python35/lib64/python3.5/xml/etree/__pycache__/
Upload File :
Current File : //opt/alt/python35/lib64/python3.5/xml/etree/__pycache__/ElementTree.cpython-35.opt-2.pyc



���]���@sqdddddddddd	d
ddd
ddddddddgZdZddlZddlZddlZddlZddlZddlmZGdd	�d	e	�Z
dd�ZGdd�d�Zidd
�Z
ddd�Zdd d�ZeZGd!d�d�ZGd"d�d�Zejd#d$��Zdd%d&�Zd'd(�Zd)d*d+d,d-d.d/d0d1d2d3d4d5f
Zyee�ZWnek
r�YnXd6d7�Zd8d9�Zd:ed;ed<eiZd=d�Zd>d:d?d;d@dAdBdCdDdEdFdGdHdIiZee_dJdK�ZdLdM�Z dNdO�Z!dPdQ�Z"dddRdSdTd�Z#GdUdV�dVej$�Z%dddRdSdWd�Z&dXd�Z'ddYd�Z(dddZd�Z)Gd[d\�d\�Z*Gd]d^�d^�Z+dd_d�Z,dd`d�Z-e,Z.ddad�Z/Gdbd�d�Z0Gdcd�d�Z1yeZ2dddl3TWne4k
rlYnXdS)e�Comment�dump�Element�ElementTree�
fromstring�fromstringlist�	iselement�	iterparse�parse�
ParseError�PI�ProcessingInstruction�QName�
SubElement�tostring�tostringlist�TreeBuilder�VERSION�XML�XMLID�	XMLParser�register_namespacez1.3.0�N�)�ElementPathc@seZdZdS)r
N)�__name__�
__module__�__qualname__�rr�0/opt/alt/python35/lib64/python3.5/ElementTree.pyr
gs	cCs
t|d�S)N�tag)�hasattr)�elementrrrrusc@s�eZdZdZdZdZdZidd�Zdd�Zdd�Z	dd	�Z
d
d�Zdd
�Zdd�Z
dd�Zdd�Zdd�Zdd�Zdd�Zdd�Zdd�Zdd�Zdd d!�Zddd"d#�Zdd$d%�Zdd&d'�Zd(d)�Zdd*d+�Zd,d-�Zd.d/�Zd0d1�Zdd2d3�Zdd4d5�Z d6d7�Z!dS)8rNcKs`t|t�s(td|jjf��|j�}|j|�||_||_g|_	dS)Nzattrib must be dict, not %s)
�
isinstance�dict�	TypeError�	__class__r�copy�updater�attrib�	_children)�selfrr(�extrarrr�__init__�s
		zElement.__init__cCs d|jj|jt|�fS)Nz<%s %r at %#x>)r%rr�id)r*rrr�__repr__�szElement.__repr__cCs|j||�S)N)r%)r*rr(rrr�makeelement�s	zElement.makeelementcCsD|j|j|j�}|j|_|j|_||dd�<|S)N)r/rr(�text�tail)r*�elemrrrr&�s
zElement.copycCs
t|j�S)N)�lenr))r*rrr�__len__�szElement.__len__cCs)tjdtdd�t|j�dkS)NzyThe behavior of this method will change in future versions.  Use specific 'len(elem)' or 'elem is not None' test instead.�
stacklevel�r)�warnings�warn�
FutureWarningr3r))r*rrr�__bool__�s
zElement.__bool__cCs|j|S)N)r))r*�indexrrr�__getitem__�szElement.__getitem__cCs||j|<dS)N)r))r*r;r!rrr�__setitem__�szElement.__setitem__cCs|j|=dS)N)r))r*r;rrr�__delitem__�szElement.__delitem__cCs!|j|�|jj|�dS)N)�_assert_is_elementr)�append)r*�
subelementrrrr@�s
zElement.appendcCs2x|D]}|j|�qW|jj|�dS)N)r?r)�extend)r*�elementsr!rrrrB�s
zElement.extendcCs$|j|�|jj||�dS)N)r?r)�insert)r*r;rArrrrD�s
zElement.insertcCs,t|t�s(tdt|�j��dS)Nzexpected an Element, not %s)r"�_Element_Pyr$�typer)r*�errrr?�szElement._assert_is_elementcCs|jj|�dS)N)r)�remove)r*rArrrrHs
zElement.removecCstjdtdd�|jS)NzaThis method will be removed in future versions.  Use 'list(elem)' or iteration over elem instead.r5r6)r7r8�DeprecationWarningr))r*rrr�getchildrens
zElement.getchildrencCstj|||�S)N)r�find)r*�path�
namespacesrrrrK s	zElement.findcCstj||||�S)N)r�findtext)r*rL�defaultrMrrrrN+szElement.findtextcCstj|||�S)N)r�findall)r*rLrMrrrrP9s	zElement.findallcCstj|||�S)N)r�iterfind)r*rLrMrrrrQDs	zElement.iterfindcCs*|jj�g|_d|_|_dS)N)r(�clearr)r0r1)r*rrrrROs
	z
Element.clearcCs|jj||�S)N)r(�get)r*�keyrOrrrrSZszElement.getcCs||j|<dS)N)r()r*rT�valuerrr�setgszElement.setcCs
|jj�S)N)r(�keys)r*rrrrWqszElement.keyscCs
|jj�S)N)r(�items)r*rrrrXzs	z
Element.itemsccs\|dkrd}|dks-|j|kr2|Vx#|jD]}|j|�EdHq<WdS)N�*)rr)�iter)r*rrGrrrrZ�szElement.itercCs)tjdtdd�t|j|��S)NzbThis method will be removed in future versions.  Use 'elem.iter()' or 'list(elem.iter())' instead.r5r6)r7r8�PendingDeprecationWarning�listrZ)r*rrrr�getiterator�s
zElement.getiteratorccsu|j}t|t�r)|dk	r)dS|j}|r=|Vx1|D])}|j�EdH|j}|rD|VqDWdS)N)rr"�strr0�itertextr1)r*r�trGrrrr_�s		
	zElement.itertext)"rrrrr(r0r1r,r.r/r&r4r:r<r=r>r@rBrDr?rHrJrKrNrPrQrRrSrVrWrXrZr]r_rrrrrzs>	





		cKs<|j�}|j|�|j||�}|j|�|S)N)r&r'r/r@)�parentrr(r+r!rrrr�s


cCstt�}||_|S)N)rrr0)r0r!rrrr�s		cCs3tt�}||_|r/|jd||_|S)N� )rrr0)�targetr0r!rrrr�s

	c@seZdZddd�Zdd�Zdd�Zdd	�Zd
d�Zdd
�Zdd�Z	dd�Z
dd�ZdS)r
NcCs#|rd||f}||_dS)Nz{%s}%s)r0)r*Ztext_or_urirrrrr,�szQName.__init__cCs|jS)N)r0)r*rrr�__str__�sz
QName.__str__cCsd|jj|jfS)Nz<%s %r>)r%rr0)r*rrrr.szQName.__repr__cCs
t|j�S)N)�hashr0)r*rrr�__hash__szQName.__hash__cCs,t|t�r|j|jkS|j|kS)N)r"r
r0)r*�otherrrr�__le__szQName.__le__cCs,t|t�r|j|jkS|j|kS)N)r"r
r0)r*rgrrr�__lt__	szQName.__lt__cCs,t|t�r|j|jkS|j|kS)N)r"r
r0)r*rgrrr�__ge__
szQName.__ge__cCs,t|t�r|j|jkS|j|kS)N)r"r
r0)r*rgrrr�__gt__szQName.__gt__cCs,t|t�r|j|jkS|j|kS)N)r"r
r0)r*rgrrr�__eq__szQName.__eq__)rrrr,rdr.rfrhrirjrkrlrrrrr
�sc@s�eZdZdddd�Zdd�Zdd�Zddd	�Zdd
d�Zddd
�Zddd�Z	dddd�Z
ddd�Zddd�Zdddddddd�Z
dd�ZdS)rNcCs ||_|r|j|�dS)N)�_rootr	)r*r!�filerrrr,(s	zElementTree.__init__cCs|jS)N)rm)r*rrr�getroot.szElementTree.getrootcCs
||_dS)N)rm)r*r!rrr�_setroot2szElementTree._setrootc
Cs�d}t|d�s*t|d�}d}z�|dkrjt�}t|d�rj|j|�|_|jSx'|jd�}|s�P|j|�qmW|j�|_|jSWd|r�|j�XdS)NF�read�rbT�_parse_wholei)r �openrrsrmrq�feed�close)r*�source�parser�close_source�datarrrr	<s&	zElementTree.parsecCs|jj|�S)N)rmrZ)r*rrrrrZas
zElementTree.itercCs)tjdtdd�t|j|��S)NzbThis method will be removed in future versions.  Use 'tree.iter()' or 'list(tree.iter())' instead.r5r6)r7r8r[r\rZ)r*rrrrr]ns
zElementTree.getiteratorcCsM|dd�dkr:d|}tjd|tdd�|jj||�S)Nr�/�.z�This search is broken in 1.3 and earlier, and will be fixed in a future version.  If you rely on the current behaviour, change it to %rr5r6)r7r8r9rmrK)r*rLrMrrrrKws

zElementTree.findcCsP|dd�dkr:d|}tjd|tdd�|jj|||�S)Nrr{r|z�This search is broken in 1.3 and earlier, and will be fixed in a future version.  If you rely on the current behaviour, change it to %rr5r6)r7r8r9rmrN)r*rLrOrMrrrrN�s

zElementTree.findtextcCsM|dd�dkr:d|}tjd|tdd�|jj||�S)Nrr{r|z�This search is broken in 1.3 and earlier, and will be fixed in a future version.  If you rely on the current behaviour, change it to %rr5r6)r7r8r9rmrP)r*rLrMrrrrP�s

zElementTree.findallcCsM|dd�dkr:d|}tjd|tdd�|jj||�S)Nrr{r|z�This search is broken in 1.3 and earlier, and will be fixed in a future version.  If you rely on the current behaviour, change it to %rr5r6)r7r8r9rmrQ)r*rLrMrrrrQ�s

zElementTree.iterfind�short_empty_elementsTcCs7|sd}n|tkr+td|��|sL|dkrFd}nd}|j�}t||���}|dkr�|s�|dkr�|dkr�|}	|dkr�ddl}
|
j�}	|d|	f�|d	kr�t||j�n>t|j|�\}}t|}
|
||j||d
|�WdQRXdS)N�xmlzunknown method %r�c14n�utf-8�us-ascii�unicoderz$<?xml version='1.0' encoding='%s'?>
r0r})r�r�r�)	�
_serialize�
ValueError�lower�_get_writer�locale�getpreferredencoding�_serialize_textrm�_namespaces)r*�file_or_filename�encodingZxml_declaration�default_namespace�methodr}Z	enc_lower�writeZdeclared_encodingr��qnamesrMZ	serializerrrr��s2		
zElementTree.writecCs|j|dd�S)Nr�r)r�)r*rnrrr�
write_c14n	szElementTree.write_c14n)rrrr,rorpr	rZr]rKrNrPrQr�r�rrrrrs 
%
	5ccs|y
|j}Wnatk
rp|dkr;t|d�}nt|dd|dd�}|�
|jVWdQRXYnX|dkr�|Vn�tj���}t|tj�r�|}n�t|tj�r�tj	|�}|j
|j�nUtj�}dd�|_||_y|j
|_
|j|_Wntk
r7YnXtj|d|dddd	�}|j
|j�|jVWdQRXdS)
Nr��wr��errors�xmlcharrefreplacecSsdS)NTrrrrr�<lambda>2sz_get_writer.<locals>.<lambda>�newline�
)r��AttributeErrorrt�
contextlib�	ExitStackr"�io�BufferedIOBase�	RawIOBase�BufferedWriter�callback�detach�writable�seekable�tell�
TextIOWrapper)r�r�r�rn�stackrrrr�s>

			
	r�cs�ddi�i��r"d��<���fdd�}xK|j�D]=}|j}t|t�r�|j�kr�||j�nVt|t�r�|�kr�||�n.|dk	r�|tk	r�|tk	r�t|�xs|j	�D]e\}}t|t�r|j}|�kr!||�t|t�r�|j�kr�||j�q�W|j}t|t�rG|j�krG||j�qGW��fS)N�csy�|dd�dkr�|dd�jdd�\}}�j|�}|dkr�tj|�}|dkr�dt��}|dkr�|�|<|r�d||f�|<q�|�|<n�r�td��|�|<Wntk
r�t|�YnXdS)Nr�{�}zns%dr~z%s:%sz<cannot use non-qualified names with default_namespace option)�rsplitrS�_namespace_mapr3r�r$�_raise_serialization_error)Zqname�urir�prefix)r�rMr�rr�	add_qnameOs&"

	
z_namespaces.<locals>.add_qname)
rZrr"r
r0r^rrr�rX)r2r�r�rrTrUr0r)r�rMr�rr�Ds4
	
$
	
	r�cKsJ|j}|j}|tkr/|d|�n�|tkrL|d|�n�||}|dkr�|rx|t|��x�|D]}t|||dd|�qWn�|d|�t|j��}	|	s�|r�|r0xVt|j�ddd��D]6\}
}|rd|}|d	|t	|
�f�q�Wxut|	�D]g\}}
t
|t�ra|j}t
|
t�r�||
j}
nt	|
�}
|d
|||
f�q=W|s�t|�s�|r |d�|r�|t|��x'|D]}t|||dd|�q�W|d|d�n
|d
�|j
rF|t|j
��dS)Nz	<!--%s-->z<?%s?>r}�<rTcSs|dS)Nrr)�xrrrr��sz _serialize_xml.<locals>.<lambda>�:z
 xmlns%s="%s"z %s="%s"�>z</z />)rr0rr�
_escape_cdata�_serialize_xmlr\rX�sorted�_escape_attribr"r
r3r1)r�r2r�rMr}�kwargsrr0rGrX�v�krrrr��sT		


	


	r�Zarea�baseZbasefont�br�col�frame�hrZimg�inputZisindex�link�metaZparamcKsa|j}|j}|tkr5|dt|��n|tkrX|dt|��n�||}|dkr�|r�|t|��x�|D]}t|||d�q�Wn�|d|�t|j��}|s�|r�|r6xVt|j�ddd��D]6\}	}
|
rd|
}
|d|
t	|	�f�q�Wxut|�D]g\}
}	t
|
t�rg|
j}
t
|	t�r�||	j}	nt|	�}	|d	||
|	f�qCW|d
�|j
�}|r�|dks�|dkr�||�n|t|��x!|D]}t|||d�qW|tkrA|d
|d
�|jr]|t|j��dS)Nz	<!--%s-->z<?%s?>r�rTcSs|dS)Nrr)r�rrrr��sz!_serialize_html.<locals>.<lambda>r�z
 xmlns%s="%s"z %s="%s"r�Zscript�stylez</)rr0rr�r�_serialize_htmlr\rXr�r�r"r
�_escape_attrib_htmlr��
HTML_EMPTYr1)r�r2r�rMr�rr0rGrXr�r�Zltagrrrr��sT		


	


	r�cCs;x|j�D]}||�q
W|jr7||j�dS)N)r_r1)r�r2�partrrrr��s	r�r~�htmlr0cCsntjd|�rtd��x?ttj��D]+\}}||ksU||kr1t|=q1W|t|<dS)Nzns\d+$z'Prefix format reserved for internal use)�re�matchr�r\r�rX)r�r�r�r�rrrr�sz$http://www.w3.org/XML/1998/namespacezhttp://www.w3.org/1999/xhtmlz+http://www.w3.org/1999/02/22-rdf-syntax-ns#Zrdfz http://schemas.xmlsoap.org/wsdl/Zwsdlz http://www.w3.org/2001/XMLSchemaZxsz)http://www.w3.org/2001/XMLSchema-instanceZxsiz http://purl.org/dc/elements/1.1/ZdccCs#td|t|�jf��dS)Nzcannot serialize %r (type %s))r$rFr)r0rrrr�sr�cCs�ybd|kr!|jdd�}d|kr?|jdd�}d|kr]|jdd�}|SWn"ttfk
r�t|�YnXdS)N�&z&amp;r�z&lt;r�z&gt;)�replacer$r�r�)r0rrrr�#sr�cCs!y�d|kr!|jdd�}d|kr?|jdd�}d|kr]|jdd�}d|kr{|jdd�}d	|kr�|jd	d
�}d|kr�|jdd
�}d
|kr�|jd
d�}d
|kr�|jd
d�}|SWn"ttfk
rt|�YnXdS)Nr�z&amp;r�z&lt;r�z&gt;�"z&quot;z
r��
z&#10;�	z&#09;)r�r$r�r�)r0rrrr�3s(r�cCs�ybd|kr!|jdd�}d|kr?|jdd�}d|kr]|jdd�}|SWn"ttfk
r�t|�YnXdS)Nr�z&amp;r�z&gt;r�z&quot;)r�r$r�r�)r0rrrr�Osr�r}TcCsP|dkrtj�n	tj�}t|�j||d|d|�|j�S)Nr�r�r})r��StringIO�BytesIOrr��getvalue)r!r�r�r}�streamrrrr^s$c@sLeZdZdd�Zdd�Zdd�Zdd�Zd	d
�ZdS)�_ListDataStreamcCs
||_dS)N)�lst)r*r�rrrr,ssz_ListDataStream.__init__cCsdS)NTr)r*rrrr�vsz_ListDataStream.writablecCsdS)NTr)r*rrrr�ysz_ListDataStream.seekablecCs|jj|�dS)N)r�r@)r*�brrrr�|sz_ListDataStream.writecCs
t|j�S)N)r3r�)r*rrrr�sz_ListDataStream.tellN)rrrr,r�r�r�r�rrrrr�qs
r�cCs8g}t|�}t|�j||d|d|�|S)Nr�r})r�rr�)r!r�r�r}r�r�rrrr�s
cCskt|t�st|�}|jtjdd�|j�j}|sW|ddkrgtjjd�dS)Nr�r�rr����)r"rr��sys�stdoutror1)r2r1rrrr�scCst�}|j||�|S)N)rr	)rwrx�treerrrr	�s		cCscd}t|d�s*t|d�}d}yt||||�SWn|rW|j��YnXdS)NFrqrrT)r rt�_IterParseIteratorrv)rw�eventsrxryrrrr�s
c@sUeZdZddddd�Zdd�Zdd�Zd	d
�Zdd�ZdS)
�
XMLPullParserN�_parsercCsYg|_d|_|p'tdt��|_|dkr?d}|jj|j|�dS)Nrrc�end)r�)�
_events_queue�_indexrrr��
_setevents)r*r�r�rrrr,�s		zXMLPullParser.__init__cCsq|jdkrtd��|rmy|jj|�Wn5tk
rl}z|jj|�WYdd}~XnXdS)Nz!feed() called after end of stream)r�r�ru�SyntaxErrorr�r@)r*rz�excrrrru�szXMLPullParser.feedcCs|jj�}d|_|S)N)r�rv)r*�rootrrr�_close_and_return_root�s	z$XMLPullParser._close_and_return_rootcCs|j�dS)N)r�)r*rrrrv�szXMLPullParser.closeccs�|j}x�|j}y||j}d||j<Wntk
rHPYnX|d7}|dt|�kr�g|d|�<d|_n	||_t|t�r�|�q|VqWdS)Nrr6r)r�r��
IndexErrorr3r"�	Exception)r*r�r;�eventrrr�read_events�s 		


		zXMLPullParser.read_events)rrrr,rur�rvr�rrrrr��s

r�c@s7eZdZddd�Zdd�Zdd�ZdS)	r�FcCs>td|d|�|_||_||_d|_|_dS)Nr�r�)r�r��_file�_close_filer�rm)r*rwr�rxryrrrr,s		z_IterParseIterator.__init__c	Cs�y�xox|jj�D]}|SW|jjdkr4P|jjd�}|r_|jj|�q|jj�|_qW|j|_Wn!|jr�|jj	��YnX|jr�|jj	�t
�dS)N�ii@)r�r�r�rqrur�rmr�r�rv�
StopIteration)r*r�rzrrr�__next__s$	
	
z_IterParseIterator.__next__cCs|S)Nr)r*rrr�__iter__/sz_IterParseIterator.__iter__N)rrrr,r�r�rrrrr�sr�cCs/|stdt��}|j|�|j�S)Nrc)rrrurv)r0rxrrrr3s
cCsw|stdt��}|j|�|j�}i}x3|j�D]%}|jd�}|rD|||<qDW||fS)Nrcr-)rrrurvrZrS)r0rxr�Zidsr2r-rrrrDs

cCs@|stdt��}x|D]}|j|�qW|j�S)Nrc)rrrurv)Zsequencerxr0rrrr\s
	
c@s[eZdZddd�Zdd�Zdd�Zdd	�Zd
d�Zdd
�ZdS)rNcCsCg|_g|_d|_d|_|dkr6t}||_dS)N)�_data�_elem�_last�_tailr�_factory)r*Zelement_factoryrrrr,{s				zTreeBuilder.__init__cCs|jS)N)r�)r*rrrrv�szTreeBuilder.closecCs[|jrW|jdk	rNdj|j�}|jrB||j_n||j_g|_dS)Nr�)r�r��joinr�r1r0)r*r0rrr�_flush�s		zTreeBuilder._flushcCs|jj|�dS)N)r�r@)r*rzrrrrz�szTreeBuilder.datacCs]|j�|j||�|_}|jr@|jdj|�|jj|�d|_|S)Nrrr�)r�r�r�r�r@r�)r*rZattrsr2rrr�start�s
		zTreeBuilder.startcCs,|j�|jj�|_d|_|jS)Nr)r�r��popr�r�)r*rrrrr��s
	zTreeBuilder.end)	rrrr,rvr�rzr�r�rrrrrns
	c@s�eZdZddddd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Zdd�Z	dd�Z
e
Zdd�Zdd�Z
dS)rrNcCs�yddlm}WnCtk
rYyddl}Wntk
rTtd��YnXYnX|j|d�}|dkr�t�}||_|_||_|_	|j
|_i|_|j
|_t|d�r�|j|_t|d�r�|j|_t|d�r|j|_t|d�r.|j|_t|d	�rI|j|_d
|_d
|_d
|_d|_i|_yd|j|_ Wnt!k
r�YnXdS)Nr)�expatz7No module named expat; use SimpleXMLTreeBuilder insteadr�r�r�rz�comment�pirzExpat %d.%d.%d)"�xml.parsersr��ImportErrorZpyexpatZParserCreaterrxr�rc�_target�error�_error�_names�_defaultZDefaultHandlerExpandr �_start�StartElementHandler�_end�EndElementHandlerrzZCharacterDataHandlerr�ZCommentHandlerr�ZProcessingInstructionHandlerZbuffer_text�ordered_attributes�specified_attributes�_doctype�entity�version_info�versionr�)r*r�rcr�r�rxrrrr,�sF

							
zXMLParser.__init__cCs�|j}|j}x�|D]�}|dkrad|_d|_|||jdd�}||_q|dkr�|||jdd�}||_q|dkr�||dd�}||_q|d	kr�||d
d�}||_	qt
d|��qWdS)Nr�rcSs|||||�f�dS)Nr)rZ	attrib_inr�r@r�rrr�handler�sz%XMLParser._setevents.<locals>.handlerr�cSs||||�f�dS)Nr)rr�r@r�rrrr
szstart-nscSs&|||pd|pdff�dS)Nr�r)r�r�r�r@rrrr
szend-nscSs||df�dS)Nr)r�r�r@rrrr
	szunknown event %r)r�r@rrrrrrZStartNamespaceDeclHandlerZEndNamespaceDeclHandlerr�)r*Zevents_queueZevents_to_reportrxr@Z
event_namer
rrrr��s(		
		zXMLParser._seteventscCs7t|�}|j|_|j|jf|_|�dS)N)r
�code�lineno�offsetZposition)r*rU�errrrr�_raiseerrorszXMLParser._raiseerrorcCsSy|j|}Wn;tk
rN|}d|kr=d|}||j|<YnX|S)Nr�r�)r�KeyError)r*rT�namerrr�_fixnames

zXMLParser._fixnamecCss|j}||�}i}|r`x<tdt|�d�D]"}||d||||�<q:W|jj||�S)Nrr6r)r�ranger3rcr�)r*rZ	attr_listZfixnamer(�irrrr s	 zXMLParser._startcCs|jj|j|��S)N)rcr�r)r*rrrrr,szXMLParser._endcCs�|dd�}|dkr�y|jj}Wntk
rDdSYnXy||j|dd��Wq�tk
r�ddlm}|jd||jj	|jj
f�}d|_|jj	|_|jj
|_
|�Yq�Xn�|dkr|dd�d	krg|_n}|jdk	r�|d
kr7d|_dS|j�}|sMdS|jj|�t|j�}|dkr�|jd}|dkr�|d
kr�|j\}}}	}
|	r|	dd�}	n7|dkr�|dkr�|j\}}}
d}	ndSt|jd�r7|jj||	|
dd��nL|j|jkr�|j||	|
dd��|j||	|
dd��d|_dS)Nrr�r)r�z'undefined entity %s: line %d, column %d�r��	z	<!DOCTYPEr�r6ZPUBLIC�ZSYSTEM��doctyper�r�r�r�r�)rcrzr�r
rr�r�r�rxZErrorLineNumberZErrorColumnNumberrrrr	�stripr@r3r r�_XMLParser__doctype)r*r0r�Zdata_handlerr�r�nrFr�pubid�systemrrrr/sZ
	
	"	
	#zXMLParser._defaultcCstjdt�dS)Nz[This method of XMLParser is deprecated.  Define doctype() method on the TreeBuilder target.)r7r8rI)r*rr r!rrrrcszXMLParser.doctypecCsSy|jj|d�Wn5|jk
rN}z|j|�WYdd}~XnXdS)Nr)rx�Parserr)r*rzr�rrrrusszXMLParser.feedcCs�y|jjdd�Wn5|jk
rN}z|j|�WYdd}~XnXz0y|jj}Wntk
rvYnX|�SWd|`|`|`|`XdS)Nr�r)	rxr"rrrcrvr�r�r�)r*r�Z
close_handlerrrrrvzs 
zXMLParser.close)rrrr,r�rrrrrrrrurvrrrrr�s*!4)rY)5�__all__rr�r�r7r�r�r�rr�r
rrrrrrr
r�contextmanagerr�r�r�r�rV�	NameErrorr�r�r�rr�r�r�r�r�rr�r�rrr	rr�r�rrrrrrrE�_elementtreer�rrrr�<module>Ks�	�@0�4=2
2			E$K�


?>