Your IP : 18.223.241.235


Current Path : /opt/alt/python312/lib64/python3.12/xml/dom/__pycache__/
Upload File :
Current File : //opt/alt/python312/lib64/python3.12/xml/dom/__pycache__/xmlbuilder.cpython-312.opt-2.pyc

�

�Q�fc0����	ddlZddlZddlmZgd�ZGd�d�ZGd�d�Zd�ZGd	�d
e	�Z
Gd�de	�ZGd
�d�Z[Gd�d�Z
Gd�d�Zy)�N)�
NodeFilter)�
DOMBuilder�DOMEntityResolver�DOMInputSourcec�Z�eZdZ	dZdZdZdZdZdZdZ	dZ
dZdZdZ
dZdZdZdZdZdZdZdZy)�Options�TFN)�__name__�
__module__�__qualname__�
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/python312/lib64/python3.12/xml/dom/xmlbuilder.pyrrsr����J�!���J�"&�� $�������H�"��"���H�$(�!��N��H�%)�"��G� %���L�
�Fr!rc
�B�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-�Zy).rNr	���c�"�t�|_y�N)r�_options��selfs r"�__init__zDOMBuilder.__init__9s���	��
r!c��|jSr(��entityResolverr*s r"�_get_entityResolverzDOMBuilder._get_entityResolver<s���"�"�"r!c��||_yr(r.)r+r/s  r"�_set_entityResolverzDOMBuilder._set_entityResolver>s
��,��r!c��|jSr(�rr*s r"�_get_errorHandlerzDOMBuilder._get_errorHandlerAs��� � � r!c��||_yr(r4)r+rs  r"�_set_errorHandlerzDOMBuilder._set_errorHandlerCs
��(��r!c��|jSr(�rr*s r"�_get_filterzDOMBuilder._get_filterFs���{�{�r!c��||_yr(r9)r+rs  r"�_set_filterzDOMBuilder._set_filterHs	����r!c�h�|j|�rG|xrdxsd}	|jt|�|f}|D]\}}t|j||��ytjjdt|�z��#t
$r$tjjd|���d�wxYw)Nr	rzunsupported feature: zunknown feature: )�supportsFeature�	_settings�_name_xform�setattrr)�KeyError�xml�dom�NotSupportedErr�NotFoundErr�repr)r+�name�state�settings�values     r"�
setFeaturezDOMBuilder.setFeatureKs�������%��K�a�$�1�E�
8��>�>�;�t�+<�e�*D�E��
$,�K�D�%��D�M�M�4��7�$,��'�'�%�%�&9�D��J�&F�G�G���
C��g�g�-�-�15�7�9�>B�C�
C�s�B�-B1c�@�t|jt|��Sr()�hasattrr)r@)r+rHs  r"r>zDOMBuilder.supportsFeatureYs���t�}�}�k�$�&7�8�8r!c�H�t|�|xrdxsdf}||jvS)Nr	r)r@r?)r+rHrI�keys    r"�
canSetFeaturezDOMBuilder.canSetFeature\s)���4� �%�+�A�"2��3���d�n�n�$�$r!�rr)rr	)rr)rr)rr	)rr)rr	�rr�rr)rr	�rr)rr	)rr�rr	�rr)rr	)rr�rr	�rr�rr	)	rRrSrTrUrW)rr	rVrXrZ�rr�r
r�r
r	)rXrYrZ)rr)rr	r[r\r]c���t|�}	t|j|�S#t$r�|dk(r�|j}|jxro|j
xra|jxrS|jxrE|jxs6|jxs(|jxs|jxs|jcYStjjdt!|�z��wxYw)Nrzfeature %s not known)r@�getattrr)�AttributeErrorrrrrrrrrrrCrDrFrG)r+rH�xname�optionss    r"�
getFeaturezDOMBuilder.getFeature�s����D�!��	K��4�=�=�%�0�0���	K��y� ��-�-���6�6�<�#�A�A�<�#�,�,�<�$�B�B�<�")�!?�!?�";�$+�$>�$>�";�$+�$C�$C�";�%,�$4�$4�";�%,�$:�$:�	<�	=��'�'�%�%�&<�t�D�z�&I�J�J�	K�s�#�BC(�<,C(c��|jr|jjd|�}nt�jd|�}|j|�Sr()r/�
resolveEntityr�parse)r+�uri�inputs   r"�parseURIzDOMBuilder.parseURI�sG������'�'�5�5�d�C�@�E�%�'�5�5�d�C�@�E��z�z�%� � r!c�.�tj|j�}|j|_|j|_|j}|�5|j
r)ddl}|jj|j
�}|j||�S�Nr)
�copyr)rr�
byteStream�systemId�urllib.request�request�urlopen�_parse_bytestream)r+rhrb�fp�urllibs     r"rfzDOMBuilder.parse�ss���)�)�D�M�M�*�������#�0�0���
�
�
��
�:�'�*�*�!����'�'����7�B��%�%�b�'�2�2r!c�J�||jvrtd��td��)Nznot a legal actionzHaven't written this yet...)�_legal_actions�
ValueError�NotImplementedError)r+rh�cnode�actions    r"�parseWithContextzDOMBuilder.parseWithContext�s(����,�,�,��1�2�2�!�"?�@�@r!c�v�ddl}|jjj|�}|j	|�Srk)�xml.dom.expatbuilderrD�expatbuilder�makeBuilder�	parseFile)r+�streamrbrC�builders     r"rrzDOMBuilder._parse_bytestream�s0��#��'�'�&�&�2�2�7�;��� � ��(�(r!)r
rrr/rr�ACTION_REPLACE�ACTION_APPEND_AS_CHILDREN�ACTION_INSERT_AFTER�ACTION_INSERT_BEFORErvr,r0r2r5r7r:r<rLr>rQr?rcrirfr{rrr r!r"rr,s���N��L�
�F��N� !������$�&?�)�+?�A�N�"�#�-�!�)���H�9�%�;�%�)�(+�;�	&�)�(+�;�
	���;�	)�,�+.�;�	)�,�+.�;�	+�.�-0�;�	+�.�-0�;�	"�%�$'�;�"	'�*�),�#;�&	'�*�),�';�*	�*���+;�0	���1;�4	-�0�/2�5;�8	-�0�/2�9;�<	�!� #�=;�@	�!� #�A;�D	���E;�J
��
2�03�
2�03��	3�
-�+.�
��
��s;�I�zK�$!�3�A�
)r!rc�B�|j�jdd�S)N�-�_)�lower�replace)rHs r"r@r@�s���:�:�<����S�)�)r!c�(�eZdZdZd�Zd�Zd�Zd�Zy)r)�_openerc��t�}||_||_|j�j	|�|_|j
|�|_ddl}ddl	}|jj|�}|\}}}	}
}}|	rM|	jd�s<|j|	�dz}	|||	|
||f}|jj|�|_|S)Nr�/)r�publicIdrn�_get_opener�openrm�_guess_media_encoding�encoding�	posixpath�urllib.parserf�urlparse�endswith�dirname�
urlunparse�baseURI)
r+r�rn�sourcer�rt�parts�scheme�netloc�path�params�query�fragments
             r"rezDOMEntityResolver.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�|�	|jS#t$r$|j�|_|jcYSwxYwr()r�r`�_create_openerr*s r"r�zDOMEntityResolver._get_opener�s:��	 ��<�<����	 ��.�.�0�D�L��<�<��	 �s��*;�;c�>�ddl}|jj�Srk)rorp�build_opener)r+rts  r"r�z DOMEntityResolver._create_opener�s����~�~�*�*�,�,r!c���|jj�}d|vrL|j�D]8}|jd�s�|j	dd�dj�cSyy)NzContent-Typezcharset=�=r	)rm�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�)�"r!N)r
rr�	__slots__rer�r�r�r r!r"rr�s���I��, �-�:r!rc�j�eZdZdZd�Zd�Zd�Zd�Zd�Zd�Z	d�Z
d	�Zd
�Zd�Z
d�Zd
�Zd�Zd�Zd�Zy)r�rm�characterStream�
stringDatar�r�rnr�c�f�d|_d|_d|_d|_d|_d|_d|_yr(r�r*s r"r,zDOMInputSource.__init__s4�����#��������
���
���
���r!c��|jSr(�rmr*s r"�_get_byteStreamzDOMInputSource._get_byteStream
������r!c��||_yr(r�)r+rms  r"�_set_byteStreamzDOMInputSource._set_byteStreams	��$��r!c��|jSr(�r�r*s r"�_get_characterStreamz#DOMInputSource._get_characterStreams���#�#�#r!c��||_yr(r�)r+r�s  r"�_set_characterStreamz#DOMInputSource._set_characterStreams
��.��r!c��|jSr(�r�r*s r"�_get_stringDatazDOMInputSource._get_stringDatar�r!c��||_yr(r�)r+�datas  r"�_set_stringDatazDOMInputSource._set_stringDatas	����r!c��|jSr(�r�r*s r"�
_get_encodingzDOMInputSource._get_encoding����}�}�r!c��||_yr(r�)r+r�s  r"�
_set_encodingzDOMInputSource._set_encoding�	�� ��
r!c��|jSr(�r�r*s r"�
_get_publicIdzDOMInputSource._get_publicId!r�r!c��||_yr(r�)r+r�s  r"�
_set_publicIdzDOMInputSource._set_publicId#r�r!c��|jSr(�rnr*s r"�
_get_systemIdzDOMInputSource._get_systemId&r�r!c��||_yr(r�)r+rns  r"�
_set_systemIdzDOMInputSource._set_systemId(r�r!c��|jSr(�r�r*s r"�_get_baseURIzDOMInputSource._get_baseURI+s���|�|�r!c��||_yr(r��r+rgs  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"rrsU��@�I���%�$�/����!��!��!��r!rc�H�eZdZ	dZdZdZdZejZ	d�Z
d�Zd�Zy)	�DOMBuilderFilterr	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��
FILTER_REJECT�FILTER_SKIP�FILTER_INTERRUPTr�SHOW_ALLr�r�r�r�r r!r"r�r�1s8����M��M��K����$�$�J��"�"r!r�c�6�eZdZ	dZd�Zd�Zd�Zd�Zd�Zd�Z	y)	�
DocumentLSFc��y)NFr r*s r"�
_get_asynczDocumentLS._get_asyncSs��r!c�F�|rtjjd��y)Nz.asynchronous document loading is not supported)rCrDrE)r+�flags  r"�
_set_asynczDocumentLS._set_asyncVs&����'�'�)�)�@�B�
B�r!c��td��)Nz'haven't figured out what this means yet�rxr*s r"�abortzDocumentLS.abort[s��"�5�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��|�|}|j	�S|j|urtjj��|j	�Sr()�
ownerDocumentrCrD�WrongDocumentErr�toxml)r+�snodes  r"�saveXMLzDocumentLS.saveXMLgsI���=��E��{�{�}���
 �
 ��
,��'�'�*�*�,�,��{�{�}�r!N)
r
rr�async_r�r�r�r�r�rr r!r"r�r�Ns)��G�
�F��B�
7�>�>�r!r�c�&�eZdZdZdZd�Zd�Zd�Zy)�DOMImplementationLSr	r$c���|�tjjd��||jk(r
t	�S||j
k(rtjjd��t
d��)NzschemaType not yet supportedz'asynchronous builders are not supportedzunknown value for mode)rCrDrE�MODE_SYNCHRONOUSr�MODE_ASYNCHRONOUSrw)r+�mode�
schemaTypes   r"�createDOMBuilderz$DOMImplementationLS.createDOMBuilderssl���!��'�'�)�)�.�0�
0��4�(�(�(��<���4�)�)�)��'�'�)�)�9�;�
;��1�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	r
r
rrr r!r"rros������	3�=� r!r)rl�xml.domrC�xml.dom.NodeFilterr�__all__rrr@�objectrrr�r�rr r!r"�<module>rst��:���)�@����@a)�a)�H*�):��):�X.�V�.�b"�"�4���B � r!

?>