Your IP : 52.15.113.71


Current Path : /opt/alt/python311/lib64/python3.11/xml/dom/__pycache__/
Upload File :
Current File : //opt/alt/python311/lib64/python3.11/xml/dom/__pycache__/xmlbuilder.cpython-311.pyc

�

c��fc0����dZddlZddlZddlmZgd�ZGd�d��ZGd�d��Zd	�Z	Gd
�de
��ZGd�d
e
��ZGd�d��Z
[Gd�d��ZGd�d��ZdS)z4Implementation of the DOM Level 3 'LS-Load' feature.�N)�
NodeFilter)�
DOMBuilder�DOMEntityResolver�DOMInputSourcec�^�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_entities�external_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���9/opt/alt/python311/lib64/python3.11/xml/dom/xmlbuilder.pyrrs����������J�!���J�"&�� $�������H�"��"���H�$(�!��N��H�%)�"��G� %���L�
�F�F�Fr"rc
�D�eZdZdZdZdZdZdZdZdZ	eeee	fZ
d�Zd�Zd�Z
d	�Zd
�Zd�Zd�Zd
�Zd�Zd�Ziddg�ddg�ddg�ddg�ddg�ddg�ddg�ddg�ddg�ddg�dddg�ddg�ddg�ddg�ddg�ddg�d d g�d!gd"gd#gggd$�d%gd&gd'gd(��Zd)�Zd*�Zd+�Zd,�Zd-�ZdS).rNr	���c�,�t��|_dS�N)r�_options��selfs r#�__init__zDOMBuilder.__init__9s���	�	��
�
�
r"c��|jSr)��entityResolverr+s r#�_get_entityResolverzDOMBuilder._get_entityResolver<s���"�"r"c��||_dSr)r/)r,r0s  r#�_set_entityResolverzDOMBuilder._set_entityResolver>s��,����r"c��|jSr)�rr+s r#�_get_errorHandlerzDOMBuilder._get_errorHandlerAs��� � r"c��||_dSr)r5)r,rs  r#�_set_errorHandlerzDOMBuilder._set_errorHandlerCs��(����r"c��|jSr)�r r+s r#�_get_filterzDOMBuilder._get_filterFs
���{�r"c��||_dSr)r:)r,r s  r#�_set_filterzDOMBuilder._set_filterHs
������r"c�r�|�|��rt|rdpd}	|jt|��|f}|D]\}}t|j||���dS#t
$r$tj�d|����d�wxYwtj�	dt|��z���)Nr	rzunsupported feature: zunknown feature: )�supportsFeature�	_settings�_name_xform�setattrr*�KeyError�xml�dom�NotSupportedErr�NotFoundErr�repr)r,�name�state�settings�values     r#�
setFeaturezDOMBuilder.setFeatureKs�������%�%�	H��K�a�$�1�E�
8��>�;�t�+<�+<�e�*D�E��
$,�8�8�K�D�%��D�M�4��7�7�7�7�8�8��	�
C�
C�
C��g�-�-�-�15��7�9�9�>B�C�
C�����'�%�%�&9�D��J�J�&F�G�G�Gs�A�.Bc�F�t|jt|����Sr))�hasattrr*rA)r,rIs  r#r?zDOMBuilder.supportsFeatureYs���t�}�k�$�&7�&7�8�8�8r"c�>�t|��|rdpdf}||jvS)Nr	r)rAr@)r,rIrJ�keys    r#�
canSetFeaturezDOMBuilder.canSetFeature\s*���4� � �%�+�A�"2��3���d�n�$�$r"�rr)rr	)rr)rr)rr	)rr)rr	�rr�rr)rr	�rr)rr	)rr�rr	�rr)rr	)rr�rr	�rr�rr	)	rSrTrUrVrX)rr	rWrYr[�rr�rr�rr	)rYrZr[)rr)rr	r\r]r^c�d�t|��}	t|j|��S#t$r|dkrI|j}|jo8|jo1|jo*|jo#|jp|j	p|j
p
|jp|jcYStj�dt!|��z���wxYw)Nrzfeature %s not known)rA�getattrr*�AttributeErrorrrrrrrrrrrDrErGrH)r,rI�xname�optionss    r#�
getFeaturezDOMBuilder.getFeature�s����D�!�!��	K��4�=�%�0�0�0���	K�	K�	K��y� � ��-���6�<�#�A�<�#�,�<�$�B�<�")�!?�";�$+�$>�";�$+�$C�";�%,�$4�";�%,�$:�	<�	=�=�=��'�%�%�&<�t�D�z�z�&I�J�J�J�	K���s�&�AB/�?0B/c��|jr|j�d|��}n"t���d|��}|�|��Sr))r0�
resolveEntityr�parse)r,�uri�inputs   r#�parseURIzDOMBuilder.parseURI�sU����	A��'�5�5�d�C�@�@�E�E�%�'�'�5�5�d�C�@�@�E��z�z�%� � � r"c��tj|j��}|j|_|j|_|j}|�*|jr#ddl}|j�|j��}|�	||��S�Nr)
�copyr*r r�
byteStream�systemId�urllib.request�request�urlopen�_parse_bytestream)r,rirc�fp�urllibs     r#rgzDOMBuilder.parse�st���)�D�M�*�*������#�0���
�
��
�:�'�*�:�!�!�!�!���'�'���7�7�B��%�%�b�'�2�2�2r"c�P�||jvrtd���td���)Nznot a legal actionzHaven't written this yet...)�_legal_actions�
ValueError�NotImplementedError)r,ri�cnode�actions    r#�parseWithContextzDOMBuilder.parseWithContext�s.����,�,�,��1�2�2�2�!�"?�@�@�@r"c�r�ddl}|jj�|��}|�|��Srl)�xml.dom.expatbuilderrE�expatbuilder�makeBuilder�	parseFile)r,�streamrcrD�builders     r#rszDOMBuilder._parse_bytestream�s:��#�#�#�#��'�&�2�2�7�;�;��� � ��(�(�(r")r
rrr0rr �ACTION_REPLACE�ACTION_APPEND_AS_CHILDREN�ACTION_INSERT_AFTER�ACTION_INSERT_BEFORErwr-r1r3r6r8r;r=rMr?rRr@rdrjrgr|rsr!r"r#rr,s��������N��L�
�F��N� !������$�&?�)�+?�A�N�"�"�"�#�#�#�-�-�-�!�!�!�)�)�)�������H�H�H�9�9�9�%�%�%�;�%�)�(+�;�	&�)�(+�;�
	���;�	)�,�+.�;�	)�,�+.�;�	+�.�-0�;�	+�.�-0�;�	"�%�$'�;�"	'�*�),�#;�&	'�*�),�';�*	�*���+;�0	���1;�4	-�0�/2�5;�8	-�0�/2�9;�<	�!� #�=;�@	�!� #�A;�D	���E;�J
��
2�03�
2�03��	3�	3�	3�
-�+.�
��
��s;�;�;�I�zK�K�K�$!�!�!�3�3�3�A�A�A�
)�)�)�)�)r"rc�R�|����dd��S)N�-�_)�lower�replace)rIs r#rArA�s ���:�:�<�<����S�)�)�)r"c�*�eZdZdZd�Zd�Zd�Zd�ZdS)r)�_openerc���|�J�t��}||_||_|����|��|_|�|��|_ddl}ddl	}|j
�|��}|\}}}	}
}}|	rT|	�d��s?|�
|	��dz}	|||	|
||f}|j
�|��|_|S)Nr�/)r�publicIdro�_get_opener�openrn�_guess_media_encoding�encoding�	posixpath�urllib.parserg�urlparse�endswith�dirname�
urlunparse�baseURI)
r,r�ro�sourcer�ru�parts�scheme�netloc�path�params�query�fragments
             r#rfzDOMEntityResolver.resolveEntity�s���#�#�#��!�!��"���"��� �,�,�.�.�3�3�H�=�=����4�4�V�<�<���	'�&�&�&�&�&�&�&���%�%�h�/�/��8=�5����f�e�X��	<��
�
�c�*�*�	<��$�$�T�*�*�S�0�D��F�D�&�%��A�E�#�\�4�4�U�;�;�F�N��
r"c�r�	|jS#t$r#|���|_|jcYSwxYwr))r�ra�_create_openerr+s r#r�zDOMEntityResolver._get_opener�sK��	 ��<����	 �	 �	 ��.�.�0�0�D�L��<����	 ���s�	�*6�6c�<�ddl}|j���Srl)rprq�build_opener)r,rus  r#r�z DOMEntityResolver._create_opener�s"�������~�*�*�,�,�,r"c��|j���}d|vr\|���D]I}|�d��r0|�dd��d���cS�HdSdS)NzContent-Typezcharset=�=r	)rn�info�getplist�
startswith�splitr�)r,r�r��params    r#r�z'DOMEntityResolver._guess_media_encoding�s���� �%�%�'�'���T�!�!������
:�
:���#�#�J�/�/�:� �;�;�s�A�.�.�q�1�7�7�9�9�9�9�9�:�"�!�
:�
:r"N)r
rr�	__slots__rfr�r�r�r!r"r#rr�sU�������I����, � � �-�-�-�:�:�:�:�:r"rc�l�eZdZdZd�Zd�Zd�Zd�Zd�Zd�Z	d�Z
d	�Zd
�Zd�Z
d�Zd
�Zd�Zd�Zd�ZdS)r�rn�characterStream�
stringDatar�r�ror�c�h�d|_d|_d|_d|_d|_d|_d|_dSr)r�r+s r#r-zDOMInputSource.__init__s8�����#��������
���
���
�����r"c��|jSr)�rnr+s r#�_get_byteStreamzDOMInputSource._get_byteStream
�
����r"c��||_dSr)r�)r,rns  r#�_set_byteStreamzDOMInputSource._set_byteStreams
��$����r"c��|jSr)�r�r+s r#�_get_characterStreamz#DOMInputSource._get_characterStreams���#�#r"c��||_dSr)r�)r,r�s  r#�_set_characterStreamz#DOMInputSource._set_characterStreams��.����r"c��|jSr)�r�r+s r#�_get_stringDatazDOMInputSource._get_stringDatar�r"c��||_dSr)r�)r,�datas  r#�_set_stringDatazDOMInputSource._set_stringDatas
������r"c��|jSr)�r�r+s r#�
_get_encodingzDOMInputSource._get_encoding�
���}�r"c��||_dSr)r�)r,r�s  r#�
_set_encodingzDOMInputSource._set_encoding�
�� ��
�
�
r"c��|jSr)�r�r+s r#�
_get_publicIdzDOMInputSource._get_publicId!r�r"c��||_dSr)r�)r,r�s  r#�
_set_publicIdzDOMInputSource._set_publicId#r�r"c��|jSr)�ror+s r#�
_get_systemIdzDOMInputSource._get_systemId&r�r"c��||_dSr)r�)r,ros  r#�
_set_systemIdzDOMInputSource._set_systemId(r�r"c��|jSr)�r�r+s r#�_get_baseURIzDOMInputSource._get_baseURI+s
���|�r"c��||_dSr)r��r,rhs  r#�_set_baseURIzDOMInputSource._set_baseURI-s
������r"N)r
rrr�r-r�r�r�r�r�r�r�r�r�r�r�r�r�r�r!r"r#rrs�������@�I�������%�%�%�$�$�$�/�/�/����������!�!�!����!�!�!����!�!�!��������r"rc�B�eZdZdZdZdZdZdZej	Z
d�Zd�Zd�Z
d	S)
�DOMBuilderFilterzSElement filter which can be used to tailor construction of
    a DOM instance.
    r	r%r&r'c��|jSr))�
whatToShowr+s r#�_get_whatToShowz DOMBuilderFilter._get_whatToShowBr�r"c��|jSr)��
FILTER_ACCEPT�r,�elements  r#�
acceptNodezDOMBuilderFilter.acceptNodeE����!�!r"c��|jSr)r�r�s  r#�startContainerzDOMBuilderFilter.startContainerHr�r"N)r
rrr
r��
FILTER_REJECT�FILTER_SKIP�FILTER_INTERRUPTr�SHOW_ALLr�r�r�r�r!r"r#r�r�1sj���������M��M��K����$�J����"�"�"�"�"�"�"�"r"r�c�:�eZdZdZdZd�Zd�Zd�Zd�Zd�Z	d�Z
d	S)
�
DocumentLSz=Mixin to create documents that conform to the load/save spec.Fc��dS)NFr!r+s r#�
_get_asynczDocumentLS._get_asyncSs���ur"c�H�|rtj�d���dS)Nz.asynchronous document loading is not supported)rDrErF)r,�flags  r#�
_set_asynczDocumentLS._set_asyncVs7���	B��'�)�)�@�B�B�
B�	B�	Br"c� �td���)Nz'haven't figured out what this means yet�ryr+s r#�abortzDocumentLS.abort[s��"�5�7�7�	7r"c� �td����Nzhaven't written this yetr�r�s  r#�loadzDocumentLS.loada���!�"<�=�=�=r"c� �td���r�r�)r,r�s  r#�loadXMLzDocumentLS.loadXMLdr�r"c��|�|}n'|j|urtj����|���Sr))�
ownerDocumentrDrE�WrongDocumentErr�toxml)r,�snodes  r#�saveXMLzDocumentLS.saveXMLgs>���=��E�E�
�
 ��
,�
,��'�*�*�,�,�,��{�{�}�}�r"N)r
rrr
�async_r�r�r�r�r�rr!r"r#r�r�Ns|������G�G�
�F����B�B�B�
7�7�7�>�>�>�>�>�>�����r"r�c�(�eZdZdZdZd�Zd�Zd�ZdS)�DOMImplementationLSr	r%c���|�tj�d���||jkrt	��S||jkrtj�d���t
d���)NzschemaType not yet supportedz'asynchronous builders are not supportedzunknown value for mode)rDrErF�MODE_SYNCHRONOUSr�MODE_ASYNCHRONOUSrx)r,�mode�
schemaTypes   r#�createDOMBuilderz$DOMImplementationLS.createDOMBuilderssw���!��'�)�)�.�0�0�
0��4�(�(�(��<�<���4�)�)�)��'�)�)�9�;�;�
;��1�2�2�2r"c� �td���)Nz-the writer interface hasn't been written yet!r�r+s r#�createDOMWriterz#DOMImplementationLS.createDOMWriter~s��!�;�=�=�	=r"c��t��Sr))rr+s r#�createDOMInputSourcez(DOMImplementationLS.createDOMInputSource�s�����r"N)r
rrr
rrrrr!r"r#rrosM����������	3�	3�	3�=�=�=� � � � � r"r)r
rm�xml.domrD�xml.dom.NodeFilterr�__all__rrrA�objectrrr�r�rr!r"r#�<module>rs���:�:���������)�)�)�)�)�)�@�
?�
?����������@a)�a)�a)�a)�a)�a)�a)�a)�H*�*�*�):�):�):�):�):��):�):�):�X.�.�.�.�.�V�.�.�.�b"�"�"�"�"�"�"�"�4���������B � � � � � � � � � r"

?>