Your IP : 13.58.221.124


Current Path : /opt/alt/python38/lib64/python3.8/xml/dom/__pycache__/
Upload File :
Current File : //opt/alt/python38/lib64/python3.8/xml/dom/__pycache__/xmlbuilder.cpython-38.opt-2.pyc

U

i�fs0�@s�ddlZddlZddlZddlmZdddgZGdd�d�ZGdd�d�Zd	d
�Z	Gdd�de
�ZGdd�de
�ZGd
d�d�Z
[Gdd�d�ZGdd�d�ZdS)�N)�
NodeFilter�
DOMBuilder�DOMEntityResolver�DOMInputSourcec@sXeZdZdZdZdZdZdZdZdZ	dZ
dZdZdZ
dZdZdZdZdZdZdZdZdS)�Options�TFN)�__name__�
__module__�__qualname__�
namespaces�namespace_declarations�
validation�external_parameter_entities�external_general_entitiesZexternal_dtd_subset�validate_if_schemaZvalidate�datatype_normalization�create_entity_ref_nodes�entities�whitespace_in_element_content�cdata_sections�comments�charset_overrides_xml_encoding�infoset�supported_mediatypes_only�errorHandler�filter�rr�7/opt/alt/python38/lib64/python3.8/xml/dom/xmlbuilder.pyr
s&
rc@s&eZdZdZdZdZdZdZdZdZ	eeee	fZ
dd�Zdd	�Zd
d�Z
dd
�Zdd�Zdd�Zdd�Zdd�Zdd�Zdd�Zdgdgdgdgdgdgd gd!gd"gd#gd"d$gd%gd&gd'gd(gd)gd*gd+gd,gd-ggdd!d"d$d(d.d'd+d-g	d/gd0gd1gd2�Zd3d4�Zd5d6�Zd7d8�Zd9d:�Zd;d<�ZdS)=rNr���cCst�|_dS�N)r�_options��selfrrr�__init__:szDOMBuilder.__init__cCs|jSr!��entityResolverr#rrr�_get_entityResolver=szDOMBuilder._get_entityResolvercCs
||_dSr!r&)r$r'rrr�_set_entityResolver?szDOMBuilder._set_entityResolvercCs|jSr!�rr#rrr�_get_errorHandlerBszDOMBuilder._get_errorHandlercCs
||_dSr!r*)r$rrrr�_set_errorHandlerDszDOMBuilder._set_errorHandlercCs|jSr!�rr#rrr�_get_filterGszDOMBuilder._get_filtercCs
||_dSr!r-)r$rrrr�_set_filterIszDOMBuilder._set_filtercCs�|�|�rt|rdpd}z|jt|�|f}Wn(tk
rTtj�d|f�d�Yq�X|D]\}}t|j||�qZntj�	dt
|���dS)Nrrzunsupported feature: %rzunknown feature: )�supportsFeature�	_settings�_name_xform�KeyError�xml�dom�NotSupportedErr�setattrr"�NotFoundErr�repr)r$�name�stateZsettings�valuerrr�
setFeatureLs
��zDOMBuilder.setFeaturecCst|jt|��Sr!)�hasattrr"r2)r$r:rrrr0ZszDOMBuilder.supportsFeaturecCst|�|rdpdf}||jkS)Nrr)r2r1)r$r:r;�keyrrr�
canSetFeature]szDOMBuilder.canSetFeature�rr�rr�r
r�rr�rr�rr�rr�rr�rr�rr�rr�rr�rr�rr�rr�rr�rr�rr�rr�rr)rr�rr�rr�rr)rArBrCrDrErFrGrHrIrJrKrLrMrNrOrPrQrRrSrT)rr)rrrUrVrWcCs�t|�}zt|j|�WStk
r�|dkrp|j}|joj|joj|joj|joj|jph|j	ph|j
ph|jph|jYSt
j�dt|���YnXdS)Nrzfeature %s not known)r2�getattrr"�AttributeErrorrrrrrrrrrr4r5r8r9)r$r:Zxname�optionsrrr�
getFeature�s0��������	zDOMBuilder.getFeaturecCs.|jr|j�d|�}nt��d|�}|�|�Sr!)r'�
resolveEntityr�parse)r$�uri�inputrrr�parseURI�szDOMBuilder.parseURIcCsRt�|j�}|j|_|j|_|j}|dkrF|jrFddl}|j�|j�}|�	||�S�Nr)
�copyr"rr�
byteStream�systemId�urllib.request�requestZurlopen�_parse_bytestream)r$r_rZ�fp�urllibrrrr]�szDOMBuilder.parsecCs||jkrtd��td��dS)Nznot a legal actionzHaven't written this yet...)�_legal_actions�
ValueError�NotImplementedError)r$r_Zcnode�actionrrr�parseWithContext�s
zDOMBuilder.parseWithContextcCs ddl}|jj�|�}|�|�Sra)Zxml.dom.expatbuilderr5ZexpatbuilderZmakeBuilderZ	parseFile)r$�streamrZr4Zbuilderrrrrg�szDOMBuilder._parse_bytestream)rr	r
r'rrZACTION_REPLACEZACTION_APPEND_AS_CHILDRENZACTION_INSERT_AFTERZACTION_INSERT_BEFORErjr%r(r)r+r,r.r/r=r0r@r1r[r`r]rnrgrrrrr-s���������������������������=
cCs|���dd�S)N�-�_)�lower�replace)r:rrrr2�sr2c@s0eZdZdZdd�Zdd�Zdd�Zdd	�Zd
S)r)�_openerc
Cs�t�}||_||_|���|�|_|�|�|_ddl}ddl	}|j
�|�}|\}}}	}
}}|	r�|	�d�s�|�
|	�d}	|||	|
||f}|j
�|�|_|S)Nr�/)r�publicIdrd�_get_opener�openrc�_guess_media_encoding�encoding�	posixpathZurllib.parser]Zurlparse�endswith�dirnameZ
urlunparse�baseURI)
r$rvrd�sourcer{ri�partsZschemeZnetloc�pathZparamsZqueryZfragmentrrrr\�szDOMEntityResolver.resolveEntitycCs2z|jWStk
r,|��|_|jYSXdSr!)rtrY�_create_openerr#rrrrw�s

zDOMEntityResolver._get_openercCsddl}|j��Sra)rerfZbuild_opener)r$rirrrr��sz DOMEntityResolver._create_openercCsF|j��}d|krB|��D]&}|�d�r|�dd�d��SqdS)NzContent-Typezcharset=�=r)rc�infoZgetplist�
startswith�splitrr)r$rr�Zparamrrrry�s


z'DOMEntityResolver._guess_media_encodingN)rr	r
�	__slots__r\rwr�ryrrrrr�s
c@s�eZdZdZdd�Zdd�Zdd�Zdd	�Zd
d�Zdd
�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd�Zdd�Zdd�Zd S)!r�rc�characterStream�
stringDatarzrvrdr~cCs.d|_d|_d|_d|_d|_d|_d|_dSr!r�r#rrrr%szDOMInputSource.__init__cCs|jSr!�rcr#rrr�_get_byteStreamszDOMInputSource._get_byteStreamcCs
||_dSr!r�)r$rcrrr�_set_byteStreamszDOMInputSource._set_byteStreamcCs|jSr!�r�r#rrr�_get_characterStreamsz#DOMInputSource._get_characterStreamcCs
||_dSr!r�)r$r�rrr�_set_characterStreamsz#DOMInputSource._set_characterStreamcCs|jSr!�r�r#rrr�_get_stringDataszDOMInputSource._get_stringDatacCs
||_dSr!r�)r$�datarrr�_set_stringDataszDOMInputSource._set_stringDatacCs|jSr!�rzr#rrr�
_get_encodingszDOMInputSource._get_encodingcCs
||_dSr!r�)r$rzrrr�
_set_encodingszDOMInputSource._set_encodingcCs|jSr!�rvr#rrr�
_get_publicId"szDOMInputSource._get_publicIdcCs
||_dSr!r�)r$rvrrr�
_set_publicId$szDOMInputSource._set_publicIdcCs|jSr!�rdr#rrr�
_get_systemId'szDOMInputSource._get_systemIdcCs
||_dSr!r�)r$rdrrr�
_set_systemId)szDOMInputSource._set_systemIdcCs|jSr!�r~r#rrr�_get_baseURI,szDOMInputSource._get_baseURIcCs
||_dSr!r��r$r^rrr�_set_baseURI.szDOMInputSource._set_baseURIN)rr	r
r�r%r�r�r�r�r�r�r�r�r�r�r�r�r�r�rrrrrs 	c@s:eZdZdZdZdZdZejZ	dd�Z
dd�Zd	d
�ZdS)�DOMBuilderFilterrrrr cCs|jSr!)�
whatToShowr#rrr�_get_whatToShowCsz DOMBuilderFilter._get_whatToShowcCs|jSr!��
FILTER_ACCEPT�r$Zelementrrr�
acceptNodeFszDOMBuilderFilter.acceptNodecCs|jSr!r�r�rrr�startContainerIszDOMBuilderFilter.startContainerN)
rr	r
r�Z
FILTER_REJECTZFILTER_SKIPZFILTER_INTERRUPTrZSHOW_ALLr�r�r�r�rrrrr�2s
r�c@s@eZdZdZdd�Zdd�Zdd�Zdd	�Zd
d�Zdd
�Z	dS)�
DocumentLSFcCsdS)NFrr#rrr�
_get_asyncTszDocumentLS._get_asynccCs|rtj�d��dS)Nz.asynchronous document loading is not supported)r4r5r6)r$�flagrrr�
_set_asyncWs�zDocumentLS._set_asynccCstd��dS)Nz'haven't figured out what this means yet�rlr#rrr�abort\s�zDocumentLS.abortcCstd��dS�Nzhaven't written this yetr�r�rrr�loadbszDocumentLS.loadcCstd��dSr�r�)r$rrrr�loadXMLeszDocumentLS.loadXMLcCs*|dkr|}n|j|k	r"tj���|��Sr!)Z
ownerDocumentr4r5ZWrongDocumentErrZtoxml)r$Zsnoderrr�saveXMLhs


zDocumentLS.saveXMLN)
rr	r
Zasync_r�r�r�r�r�r�rrrrr�Osr�c@s,eZdZdZdZdd�Zdd�Zdd�Zd	S)
�DOMImplementationLSrrcCsF|dk	rtj�d��||jkr$t�S||jkr:tj�d��td��dS)NzschemaType not yet supportedz'asynchronous builders are not supportedzunknown value for mode)r4r5r6�MODE_SYNCHRONOUSr�MODE_ASYNCHRONOUSrk)r$�modeZ
schemaTyperrr�createDOMBuilderts�

�z$DOMImplementationLS.createDOMBuildercCstd��dS)Nz-the writer interface hasn't been written yet!r�r#rrr�createDOMWriters�z#DOMImplementationLS.createDOMWritercCst�Sr!)rr#rrr�createDOMInputSource�sz(DOMImplementationLS.createDOMInputSourceN)rr	r
r�r�r�r�r�rrrrr�ps
r�)rb�warningsZxml.domr4Zxml.dom.NodeFilterr�__all__rrr2�objectrrr�r�r�rrrr�<module>s
 %,1!

?>