Mini Shell

Direktori : /lib64/python3.9/xml/dom/__pycache__/
Upload File :
Current File : //lib64/python3.9/xml/dom/__pycache__/xmlbuilder.cpython-39.pyc

a

�DOgc0�@s�dZddlZddlZddlmZgd�ZGdd�d�ZGdd�d�Zd	d
�Z	Gdd�de
�ZGd
d�de
�ZGdd�d�Z
[Gdd�d�ZGdd�d�ZdS)z4Implementation of the DOM Level 3 'LS-Load' feature.�N)�
NodeFilter)�
DOMBuilder�DOMEntityResolver�DOMInputSourcec@s\eZdZdZdZdZdZdZdZdZ	dZ
dZdZdZ
dZdZdZdZdZdZdZdZdZdS)�Optionsz�Features object that has variables set for each DOMBuilder feature.

    The DOMBuilder class uses an instance of this class to pass settings to
    the ExpatBuilder class.
    �TFN)�__name__�
__module__�__qualname__�__doc__�
namespaces�namespace_declarations�
validation�external_parameter_entities�external_general_entitiesZexternal_dtd_subset�validate_if_schema�validate�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�*/usr/lib64/python3.9/xml/dom/xmlbuilder.pyrs(	rc@seZdZdZdZdZdZdZdZdZ	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-gggd.�d/gd0gd1gd2�Zd3d4�Zd5d6�Zd7d8�Zd9d:�Zd;d<�ZdS)=rNr���cCst�|_dS�N)r�_options��selfrrr�__init__9szDOMBuilder.__init__cCs|jSr#��entityResolverr%rrr�_get_entityResolver<szDOMBuilder._get_entityResolvercCs
||_dSr#r()r&r)rrr�_set_entityResolver>szDOMBuilder._set_entityResolvercCs|jSr#�rr%rrr�_get_errorHandlerAszDOMBuilder._get_errorHandlercCs
||_dSr#r,)r&rrrr�_set_errorHandlerCszDOMBuilder._set_errorHandlercCs|jSr#�rr%rrr�_get_filterFszDOMBuilder._get_filtercCs
||_dSr#r/)r&rrrr�_set_filterHszDOMBuilder._set_filtercCs�|�|�rr|rdpd}z|jt|�|f}Wn&tyRtj�d|f�d�Yq�0|D]\}}t|j||�qXntj�	dt
|���dS)Nrrzunsupported feature: %rzunknown feature: )�supportsFeature�	_settings�_name_xform�KeyError�xml�dom�NotSupportedErr�setattrr$�NotFoundErr�repr)r&�name�stateZsettings�valuerrr�
setFeatureKs
��zDOMBuilder.setFeaturecCst|jt|��Sr#)�hasattrr$r4)r&r<rrrr2YszDOMBuilder.supportsFeaturecCst|�|rdpdf}||jvS)Nrr)r4r3)r&r<r=�keyrrr�
canSetFeature\szDOMBuilder.canSetFeature�r
r�r
r�rr�rr�rr�rr�rr�rr�rr�rr�rr�rr�rr�rr�rr�rr�rr�rr�rr�rr)	rCrJrKrMrQ)rrrPrTrV�rr�rr�rr)rCrDrErFrGrHrIrJrKrLrMrNrOrPrQrRrSrTrUrV)rr)rrrWrXrYcCs�t|�}zt|j|�WSty�|dkrn|j}|joh|joh|joh|joh|jpf|j	pf|j
pf|jpf|jYSt
j�dt|���Yn0dS)Nrzfeature %s not known)r4�getattrr$�AttributeErrorrrrrr
rrrrr6r7r:r;)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}|durF|jrFddl}|j�|j�}|�	||�S�Nr)
�copyr$rr�
byteStream�systemId�urllib.request�request�urlopen�_parse_bytestream)r&rar\�fp�urllibrrrr_�szDOMBuilder.parsecCs||jvrtd��td��dS)Nznot a legal actionzHaven't written this yet...)�_legal_actions�
ValueError�NotImplementedError)r&raZcnode�actionrrr�parseWithContext�s
zDOMBuilder.parseWithContextcCs ddl}|jj�|�}|�|�Src)Zxml.dom.expatbuilderr7ZexpatbuilderZmakeBuilderZ	parseFile)r&�streamr\r6Zbuilderrrrrj�szDOMBuilder._parse_bytestream)rr	r
r)rrZACTION_REPLACEZACTION_APPEND_AS_CHILDRENZACTION_INSERT_AFTERZACTION_INSERT_BEFORErmr'r*r+r-r.r0r1r?r2rBr3r]rbr_rqrjrrrrr,s��������������������������=
rcCs|���dd�S)N�-�_)�lower�replace)r<rrrr4�sr4c@s0eZdZdZdd�Zdd�Zdd�Zdd	�Zd
S)r)�_openerc
Cs�|dusJ�t�}||_||_|���|�|_|�|�|_ddl}ddl	}|j
�|�}|\}}}	}
}}|	r�|	�d�s�|�
|	�d}	|||	|
||f}|j
�|�|_|S)Nr�/)r�publicIdrf�_get_opener�openre�_guess_media_encoding�encoding�	posixpath�urllib.parser_�urlparse�endswith�dirname�
urlunparse�baseURI)
r&ryrf�sourcer~rl�parts�scheme�netloc�path�params�query�fragmentrrrr^�szDOMEntityResolver.resolveEntitycCs0z|jWSty*|��|_|jYS0dSr#)rwr[�_create_openerr%rrrrz�s

zDOMEntityResolver._get_openercCsddl}|j��Src)rgrhZbuild_opener)r&rlrrrr��sz DOMEntityResolver._create_openercCsF|j��}d|vrB|��D]&}|�d�r|�dd�d��SqdS)NzContent-Typezcharset=�=r)re�infoZgetplist�
startswith�splitru)r&r�r�Zparamrrrr|�s


z'DOMEntityResolver._guess_media_encodingN)rr	r
�	__slots__r^rzr�r|rrrrr�s
rc@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�re�characterStream�
stringDatar}ryrfr�cCs.d|_d|_d|_d|_d|_d|_d|_dSr#r�r%rrrr'szDOMInputSource.__init__cCs|jSr#�rer%rrr�_get_byteStream
szDOMInputSource._get_byteStreamcCs
||_dSr#r�)r&rerrr�_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#�r}r%rrr�
_get_encodingszDOMInputSource._get_encodingcCs
||_dSr#r�)r&r}rrr�
_set_encodingszDOMInputSource._set_encodingcCs|jSr#�ryr%rrr�
_get_publicId!szDOMInputSource._get_publicIdcCs
||_dSr#r�)r&ryrrr�
_set_publicId#szDOMInputSource._set_publicIdcCs|jSr#�rfr%rrr�
_get_systemId&szDOMInputSource._get_systemIdcCs
||_dSr#r�)r&rfrrr�
_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 	rc@s>eZdZdZdZdZdZdZej	Z
dd�Zdd	�Zd
d�Z
dS)
�DOMBuilderFilterzSElement filter which can be used to tailor construction of
    a DOM instance.
    rr r!r"cCs|jSr#)�
whatToShowr%rrr�_get_whatToShowBsz DOMBuilderFilter._get_whatToShowcCs|jSr#��
FILTER_ACCEPT�r&�elementrrr�
acceptNodeEszDOMBuilderFilter.acceptNodecCs|jSr#r�r�rrr�startContainerHszDOMBuilderFilter.startContainerN)rr	r
rr�Z
FILTER_REJECTZFILTER_SKIPZFILTER_INTERRUPTrZSHOW_ALLr�r�r�r�rrrrr�1s	r�c@sDeZdZdZdZdd�Zdd�Zdd�Zd	d
�Zdd�Z	d
d�Z
dS)�
DocumentLSz=Mixin to create documents that conform to the load/save spec.FcCsdS)NFrr%rrr�
_get_asyncSszDocumentLS._get_asynccCs|rtj�d��dS)Nz.asynchronous document loading is not supported)r6r7r8)r&�flagrrr�
_set_asyncVs�zDocumentLS._set_asynccCstd��dS)Nz'haven't figured out what this means yet�ror%rrr�abort[s�zDocumentLS.abortcCstd��dS�Nzhaven't written this yetr�r�rrr�loadaszDocumentLS.loadcCstd��dSr�r�)r&r�rrr�loadXMLdszDocumentLS.loadXMLcCs*|dur|}n|j|ur"tj���|��Sr#)Z
ownerDocumentr6r7ZWrongDocumentErrZtoxml)r&Zsnoderrr�saveXMLgs


zDocumentLS.saveXMLN)rr	r
rZasync_r�r�r�r�r�r�rrrrr�Nsr�c@s,eZdZdZdZdd�Zdd�Zdd�Zd	S)
�DOMImplementationLSrr cCsF|durtj�d��||jkr$t�S||jkr:tj�d��td��dS)NzschemaType not yet supportedz'asynchronous builders are not supportedzunknown value for mode)r6r7r8�MODE_SYNCHRONOUSr�MODE_ASYNCHRONOUSrn)r&�modeZ
schemaTyperrr�createDOMBuilderss�

�z$DOMImplementationLS.createDOMBuildercCstd��dS)Nz-the writer interface hasn't been written yet!r�r%rrr�createDOMWriter~s�z#DOMImplementationLS.createDOMWritercCst�Sr#)rr%rrr�createDOMInputSource�sz(DOMImplementationLS.createDOMInputSourceN)rr	r
r�r�r�r�r�rrrrr�os
r�)rrdZxml.domr6Zxml.dom.NodeFilterr�__all__rrr4�objectrrr�r�r�rrrr�<module>s %,1!

Zerion Mini Shell 1.0