Edit File: saxutils.cpython-311.opt-1.pyc
� �����f�/�����������������������������d�Z�ddlZddlZddlZddlZddlZddlmZ�ddlm Z �d��Z i�fd�Zi�fd�Zi�fd �Z d ��Z�G�d��dej��������������������Z�G�d ��de j��������������������Zdd�ZdS�)znA library of useful helper classes to the SAX classes, for the convenience of application and driver writers. �����N����)�handler)� xmlreaderc������������������f�����|������������������������������������D�]\��}}|����������������������||������������}��|�S�)z2Replace substrings of a string using a dictionary.)�items�replace)�s�d�key�values��� �7/opt/alt/python311/lib64/python3.11/xml/sax/saxutils.py�__dict_replacer������s7�������g�g�i�i��"��"� ��U� �I�I�c�5�!�!����H�����c�����������������������|�����������������������dd������������}�|�����������������������dd������������}�|�����������������������dd������������}�|rt����������|�|������������}�|�S�)z�Escape &, <, and > in a string of data. You can escape other strings of data by passing a dictionary as the optional entities parameter. The keys and values must all be strings; each key will be replaced with its corresponding value. �&�&�>�>�<�<�r���r�����data�entitiess��� r ����escaper������sY��������<�<��W�%�%�D��<�<��V�$�$�D��<�<��V�$�$�D���.��d�H�-�-���Kr���c�����������������������|�����������������������dd������������}�|�����������������������dd������������}�|rt����������|�|������������}�|�����������������������dd������������S�)a ��Unescape &, <, and > in a string of data. You can unescape other strings of data by passing a dictionary as the optional entities parameter. The keys and values must all be strings; each key will be replaced with its corresponding value. r���r���r���r���r���r���r���r���s��� r ����unescaper���"���sU��������<�<���$�$�D��<�<���$�$�D���.��d�H�-�-���<�<���%�%�%r���c�����������������������i�|�dddd��}t����������|�|������������}�d|�v�r$d|�v�rd|����������������������dd������������z��}�nd |�z��}�nd|�z��}�|�S�) a���Escape and quote an attribute value. Escape &, <, and > in a string of data, then quote it for use as an attribute value. The " character will be escaped as well, if necessary. You can escape other strings of data by passing a dictionary as the optional entities parameter. The keys and values must all be strings; each key will be replaced with its corresponding value. z z z	)� � � �"�'z"%s"z"z'%s')r���r���r���s��� r ���� quoteattrr$���0���sr�������G�(�F�'��v�F�F�F�H��$��!�!�D� �d�{�{��$�;�;��D�L�L��h�7�7�7�D�D��D�=�D�D���}���Kr���c����������������������������dd�l�}|j��������S�t������������t����������j��������������������r��S�t������������t ����������j��������t ����������j��������f������������r��S�t������������t����������j��������������������r"�G���fd�d������������}�|��������������}d��|_ ��������nQt����������j ����������������������}d��|_����������j��������|_�������� ���j ��������|_ ����������j��������|_��������n#�t����������$�r�Y�nw�xY�wt����������j��������||ddd� ������������S�) Nr���c��������������������(������e�Zd�Z��j��������Z��fd�ZdS�)� _gettextwriter.<locals>._wrapperc������������������$������t�����������|������������S��N)�getattr)�self�name�outs��� �r ����__getattr__z,_gettextwriter.<locals>._wrapper.__getattr__Z���s��������s�D�)�)�)r���N)�__name__� __module__�__qualname__� __class__r.���)r-���s����r ����_wrapperr'���X���s5���������������� �I� *�� *�� *�� *�� *�� *�� *r���r3���c������������������������d�S�r)�����r5���r���r ����<lambda>z _gettextwriter.<locals>.<lambda>]���s������t��r���c������������������������dS�)NTr5���r5���r���r ���r6���z _gettextwriter.<locals>.<lambda>b���s������$��r����xmlcharrefreplacer���T)�encoding�errors�newline� write_through)�sys�stdout� isinstance�io� TextIOBase�codecs�StreamWriter�StreamReaderWriter� RawIOBase�close�BufferedIOBase�writable�write�seekable�tell�AttributeError� TextIOWrapper)r-���r9���r=���r3����buffers���` r ����_gettextwriterrO���G���s8������ �{�� � � ��z���#�r�}�%�%���� ��#��+�V�-F�G�H�H���� ���#�r�|�$�$��� *�� *�� *�� *�� *�� *�� *�� *�� *�� *�������#�|������"�$�$��&�,����y��� ��"�l�F�O��(�F�K�K���� �� �� ��D� ���� ��F�X�#6�$(�*.�0��0��0��0s����7C�� C�Cc��������������������f�����e�Zd�Zdd�Zd��Zdd�Zd��Zd��Zd ��Zd ��Z d��Z d��Zd ��Zd��Z d��Zd��Zd��ZdS�)�XMLGeneratorN� iso-8859-1Fc�����������������������t�����������j�����������������������������|��������������t����������||������������}|j��������|�_��������|j��������|�_��������i�g|�_��������|�j��������d���������|�_ ��������g�|�_ ��������||�_��������||�_��������d|�_ ��������d�S�)N���F)r����ContentHandler�__init__rO���rI����_write�flush�_flush�_ns_contexts�_current_context�_undeclared_ns_maps� _encoding�_short_empty_elements�_pending_start_element)r+���r-���r9����short_empty_elementss��� r ���rV���zXMLGenerator.__init__r���sy��������'�'��-�-�-��S�(�+�+���i����i����D��� $� 1�"� 5���#%�� �!���%9��"�&+��#�#�#r���c�����������������������|d���������r:d|d���������k����rd|d���������z���S�|�j���������|d������������������}|r|dz���|d���������z���S�|d���������S�)z7Builds a qualified name from a (ns_url, localname) pairr���z$http://www.w3.org/XML/1998/namespacezxml:r����:)r[���)r+���r,����prefixs��� r ����_qnamezXMLGenerator._qname~���sc��������7�� .� �6��a��@�@���Q��'�'��*�4��7�3�F��� .���|�d�1�g�-�-��A�w�r���c������������������P�����|�j���������r|����������������������d�������������d|�_���������d�S�d�S�)Nr���F�r_���rW���)r+���� endElements��� r ����_finish_pending_start_elementz*XMLGenerator._finish_pending_start_element����s7�������&�� 0��K�K�����*/�D�'�'�'� 0�� 0r���c������������������@�����|�����������������������d|�j��������z���������������d�S�)Nz$<?xml version="1.0" encoding="%s"?> )rW���r]����r+���s��� r ���� startDocumentzXMLGenerator.startDocument����s/���������;���'�� (�� (�� (�� (�� (r���c������������������.�����|��������������������������������������d�S�r)���)rY���rj���s��� r ����endDocumentzXMLGenerator.endDocument����s��������� � � � � r���c�����������������������|�j������������������������������|�j��������������������������������������������������������||�j��������|<���|�j�����������������������������||f�������������d�S�r)���)rZ����appendr[����copyr\����r+���rc����uris��� r ����startPrefixMappingzXMLGenerator.startPrefixMapping����sV�������� � ��!6�!;�!;�!=�!=�>�>�>�%+���c�"�� �'�'��� �6�6�6�6�6r���c������������������:�����|�j���������d���������|�_��������|�j���������d=�d�S�)NrT���)rZ���r[����r+���rc���s��� r ����endPrefixMappingzXMLGenerator.endPrefixMapping����s#������ $� 1�"� 5�����b�!�!�!r���c����������� �������,����|��������������������������������������|����������������������d|z����������������|�����������������������������������D�]-\��}}|����������������������d|�dt����������|����������������������������.|�j��������r d|�_��������d�S�|����������������������d�������������d�S�)Nr���� �=Tr���)rh���rW���r���r$���r^���r_���)r+���r,����attrsr���s��� r ����startElementzXMLGenerator.startElement����s��������*�*�,�,�,����C�$�J����"�[�[�]�]�� =�� =�M�T�5��K�K�K�D�D�D�)�E�*:�*:�*:�;�<�<�<�<��%�� �*.�D�'�'�'��K�K������r���c�����������������������|�j���������r|����������������������d�������������d|�_���������d�S�|����������������������d|z���������������d�S��Nz/>Fz</%s>rf����r+���r,���s��� r ���rg���zXMLGenerator.endElement����sI�������&�� (��K�K�����*/�D�'�'�'��K�K��$��'�'�'�'�'r���c����������� �����������|��������������������������������������|����������������������d|����������������������|������������z����������������|�j��������D�]<\��}}|r|����������������������d|�d|�d���������������$|����������������������d|z����������������=g�|�_��������|�����������������������������������D�]@\��}}|����������������������d|����������������������|�������������dt����������|����������������������������A|�j��������r d|�_��������d�S�|����������������������d �������������d�S�) Nr���z xmlns:z="r"���z xmlns="%s"rx���ry���Tr���)rh���rW���rd���r\���r���r$���r^���r_���)r+���r,����qnamerz���rc���rr���r���s��� r ����startElementNSzXMLGenerator.startElementNS����s"������*�*�,�,�,����C�$�+�+�d�+�+�+�,�,�,��3�� 1�� 1�K�F�C��� 1�����������<�=�=�=�=����M�C�/�0�0�0�0�#%�� �"�[�[�]�]�� J�� J�M�T�5��K�K�K�D�K�K��$5�$5�$5�$5�y��7G�7G�7G�H�I�I�I�I��%�� �*.�D�'�'�'��K�K������r���c�����������������������|�j���������r|����������������������d�������������d|�_���������d�S�|����������������������d|����������������������|������������z���������������d�S�r}���)r_���rW���rd����r+���r,���r����s��� r ����endElementNSzXMLGenerator.endElementNS����sV�������&�� 5��K�K�����*/�D�'�'�'��K�K��$�+�+�d�"3�"3�3�4�4�4�4�4r���c������������������������|rb|��������������������������������������t����������|t����������������������st����������||�j��������������������}|����������������������t����������|�������������������������d�S�d�S�r)���)rh���r?����strr]���rW���r����r+����contents��� r ���� characterszXMLGenerator.characters����sg�������� )��.�.�0�0�0��g�s�+�+�� 7��g�t�~�6�6���K�K��w���(�(�(�(�(� )�� )r���c�����������������������|rU|��������������������������������������t����������|t����������������������st����������||�j��������������������}|����������������������|�������������d�S�d�S�r)���)rh���r?���r����r]���rW���r����s��� r ����ignorableWhitespacez XMLGenerator.ignorableWhitespace����sa�������� !��.�.�0�0�0��g�s�+�+�� 7��g�t�~�6�6���K�K�� � � � � � !�� !r���c������������������f�����|��������������������������������������|����������������������d|�d|�d��������������d�S�)Nz<?rx���z?>)rh���rW����r+����targetr���s��� r ����processingInstructionz"XMLGenerator.processingInstruction����s;�������*�*�,�,�,�����6�6�6�4�4�4�0�1�1�1�1�1r���)NrR���F)F)r/���r0���r1���rV���rd���rh���rk���rm���rs���rv���r{���rg���r����r����r����r����r����r5���r���r ���rQ���rQ���p���s��������������� ,�� ,�� ,�� ,������"0��0��0��0�(��(��(������7��7��7� "��"��"������(��(��(������$5��5��5�)��)��)�!��!��!�2��2��2��2��2r���rQ���c�������������������������e�Zd�ZdZdd�Zd��Zd��Zd��Zd��Zd��Z d ��Z d ��Zd��Zd��Z d ��Zd��Zd��Zd��Zd��Zd��Zd��Zd��Zd��Zd��Zd��Zd��Zd��Zd��Zd��Zd��Zd��Zd��ZdS�) � XMLFilterBaseaY��This class is designed to sit between an XMLReader and the client application's event handlers. By default, it does nothing but pass requests up to the reader and events on to the handlers unmodified, but subclasses can override specific methods to modify the event stream or the configuration requests as they pass through.Nc������������������R�����t�����������j�����������������������������|��������������||�_��������d�S�r)���)r���� XMLReaderrV����_parent�r+����parents��� r ���rV���zXMLFilterBase.__init__����s$��������$�$�T�*�*�*�����r���c������������������:�����|�j������������������������������|�������������d�S�r)���)�_err_handler�error�r+���� exceptions��� r ���r����zXMLFilterBase.error����s���������� �*�*�*�*�*r���c������������������:�����|�j������������������������������|�������������d�S�r)���)r����� fatalErrorr����s��� r ���r����zXMLFilterBase.fatalError����s��������$�$�Y�/�/�/�/�/r���c������������������:�����|�j������������������������������|�������������d�S�r)���)r�����warningr����s��� r ���r����zXMLFilterBase.warning����s��������!�!�)�,�,�,�,�,r���c������������������:�����|�j������������������������������|�������������d�S�r)���)� _cont_handler�setDocumentLocator)r+����locators��� r ���r����z XMLFilterBase.setDocumentLocator����s��������-�-�g�6�6�6�6�6r���c������������������8�����|�j���������������������������������������������d�S�r)���)r����rk���rj���s��� r ���rk���zXMLFilterBase.startDocument����s��������(�(�*�*�*�*�*r���c������������������8�����|�j���������������������������������������������d�S�r)���)r����rm���rj���s��� r ���rm���zXMLFilterBase.endDocument��s��������&�&�(�(�(�(�(r���c������������������<�����|�j������������������������������||�������������d�S�r)���)r����rs���rq���s��� r ���rs���z XMLFilterBase.startPrefixMapping��s!��������-�-�f�c�:�:�:�:�:r���c������������������:�����|�j������������������������������|�������������d�S�r)���)r����rv���ru���s��� r ���rv���zXMLFilterBase.endPrefixMapping��s��������+�+�F�3�3�3�3�3r���c������������������<�����|�j������������������������������||�������������d�S�r)���)r����r{���)r+���r,���rz���s��� r ���r{���zXMLFilterBase.startElement���!��������'�'��e�4�4�4�4�4r���c������������������:�����|�j������������������������������|�������������d�S�r)���)r����rg���r~���s��� r ���rg���zXMLFilterBase.endElement��s��������%�%�d�+�+�+�+�+r���c������������������>�����|�j������������������������������|||�������������d�S�r)���)r����r����)r+���r,���r����rz���s��� r ���r����zXMLFilterBase.startElementNS��s#��������)�)�$��u�=�=�=�=�=r���c������������������<�����|�j������������������������������||�������������d�S�r)���)r����r����r����s��� r ���r����zXMLFilterBase.endElementNS��r����r���c������������������:�����|�j������������������������������|�������������d�S�r)���)r����r����r����s��� r ���r����zXMLFilterBase.characters��s��������%�%�g�.�.�.�.�.r���c������������������:�����|�j������������������������������|�������������d�S�r)���)r����r����)r+����charss��� r ���r����z!XMLFilterBase.ignorableWhitespace��s��������.�.�u�5�5�5�5�5r���c������������������<�����|�j������������������������������||�������������d�S�r)���)r����r����r����s��� r ���r����z#XMLFilterBase.processingInstruction��s!��������0�0���>�>�>�>�>r���c������������������:�����|�j������������������������������|�������������d�S�r)���)r����� skippedEntityr~���s��� r ���r����zXMLFilterBase.skippedEntity ��s��������(�(��.�.�.�.�.r���c������������������>�����|�j������������������������������|||�������������d�S�r)���)�_dtd_handler�notationDecl)r+���r,����publicId�systemIds��� r ���r����zXMLFilterBase.notationDecl%��s#��������&�&�t�X�x�@�@�@�@�@r���c������������������@�����|�j������������������������������||||�������������d�S�r)���)r�����unparsedEntityDecl)r+���r,���r����r�����ndatas��� r ���r����z XMLFilterBase.unparsedEntityDecl(��s%��������,�,�T�8�X�u�M�M�M�M�Mr���c������������������8�����|�j������������������������������||������������S�r)���)�_ent_handler� resolveEntity)r+���r����r����s��� r ���r����zXMLFilterBase.resolveEntity-��s������� �.�.�x��B�B�Br���c������������������ ����|�j������������������������������|��������������|�j������������������������������|��������������|�j������������������������������|��������������|�j������������������������������|��������������|�j������������������������������|�������������d�S�r)���)r�����setContentHandler�setErrorHandler�setEntityResolver� setDTDHandler�parse)r+����sources��� r ���r����zXMLFilterBase.parse2��sv��������&�&�t�,�,�,���$�$�T�*�*�*���&�&�t�,�,�,���"�"�4�(�(�(�����6�"�"�"�"�"r���c������������������:�����|�j������������������������������|�������������d�S�r)���)r����� setLocale)r+����locales��� r ���r����zXMLFilterBase.setLocale9��s����������v�&�&�&�&�&r���c������������������6�����|�j������������������������������|������������S�r)���)r����� getFeaturer~���s��� r ���r����zXMLFilterBase.getFeature<��s�������|�&�&�t�,�,�,r���c������������������<�����|�j������������������������������||�������������d�S�r)���)r����� setFeature)r+���r,����states��� r ���r����zXMLFilterBase.setFeature?��s �����������e�,�,�,�,�,r���c������������������6�����|�j������������������������������|������������S�r)���)r�����getPropertyr~���s��� r ���r����zXMLFilterBase.getPropertyB��s�������|�'�'��-�-�-r���c������������������<�����|�j������������������������������||�������������d�S�r)���)r�����setProperty)r+���r,���r���s��� r ���r����zXMLFilterBase.setPropertyE��s �������� � ��u�-�-�-�-�-r���c�����������������������|�j���������S�r)����r����rj���s��� r ���� getParentzXMLFilterBase.getParentJ��s �������|�r���c�����������������������||�_���������d�S�r)���r����r����s��� r ���� setParentzXMLFilterBase.setParentM��s ����������r���r)���) r/���r0���r1����__doc__rV���r����r����r����r����rk���rm���rs���rv���r{���rg���r����r����r����r����r����r����r����r����r����r����r����r����r����r����r����r����r����r5���r���r ���r����r��������s������������������������+��+��+�0��0��0�-��-��-� 7��7��7�+��+��+�)��)��)�;��;��;�4��4��4�5��5��5�,��,��,�>��>��>�5��5��5�/��/��/�6��6��6�?��?��?�/��/��/� A��A��A�N��N��N� C��C��C� #��#��#�'��'��'�-��-��-�-��-��-�.��.��.�.��.��.� �������������r���r������c�����������������������t����������|�t����������j��������������������rt����������j��������|�������������}�t����������|�t����������������������rt����������j��������|�������������}�n�t����������|�d������������r�|�}t����������j����������������������}�t����������|���������������������d������������t����������������������r|�� ��������������������|�������������n|�� ��������������������|�������������t����������|d������������r4t����������|j��������t����������������������r|����������������������|j���������������������|�� ������������������������������������C|��������������������������������������.|������������������������������������}t����������j�����������������������������t����������j�����������������������������|������������������������}t����������j�����������������������������||������������}t����������j�����������������������������|������������r&|����������������������|�������������t+����������|d������������}nd|����������������������t,����������j�����������������������������||�������������������������t,����������j�����������������������������|������������������������������������������������}|�� ��������������������|�������������|�S�)z�This function takes an InputSource and an optional base URL and returns a fully resolved InputSource object ready for reading.�readr���r,���N�rb)r?����os�PathLike�fspathr����r����InputSource�hasattrr�����setCharacterStream� setByteStreamr,����setSystemId�getCharacterStream� getByteStream�getSystemId�path�dirname�normpath�join�isfile�open�urllibr�����urljoin�request�urlopen)r�����base�f�sysid�basehead� sysidfilenames��� r ����prepare_input_sourcer����R��s��������&�"�+�&�&��#���6�"�"���&�#���� '��&�v�.�.��� ��� � ��'����&�(�(���a�f�f�Q�i�i��%�%�� $��%�%�a�(�(�(�(�� � ��#�#�#��1�f���� '�*�Q�V�S�"9�"9�� '����q�v�&�&�&� � � �"�"�*�v�/C�/C�/E�/E�/M��"�"�$�$���7�?�?�2�7�#3�#3�D�#9�#9�:�:������X�u�5�5� � �7�>�>�-�(�(�� =����}�-�-�-��]�D�)�)�A�A����v�|�3�3�D�%�@�@�A�A�A���&�&�v�'9�'9�';�';�<�<�A����Q�����Mr���)r����)r����r�����urllib.parser�����urllib.requestr@���rB���r����r���r���r���r���r���r$���rO���rU���rQ���r����r����r����r5���r���r ����<module>r�������s_������� �(��'��'��'��'��'��'��'��'��'��'��'�� � � � �� � � � ������������������������� �� �� ����������� ���&��&��&��&�� ���������.'0��'0��'0�Rp2��p2��p2��p2��p2�7�)��p2��p2��p2�fk��k��k��k��k�I�'��k��k��k�^����������r���