File: //proc/self/root/lib/python3.6/site-packages/gyp/__pycache__/xml_fix.cpython-36.opt-1.pyc
3
��S]u � @ s4 d Z ddlZddd�Zddd�ZG d d
� d
e�ZdS )
z�Applies a fix to CR LF TAB handling in xml.dom.
Fixes this: http://code.google.com/p/chromium/issues/detail?id=76293
Working around this: http://bugs.python.org/issue5752
TODO(bradnelson): Consider dropping this when we drop XP support.
� NFc C sV |j dd�j dd�}|j dd�j dd�}|rH|j d d
�j dd�j d
d�}| j|� dS )zWrites datachars to writer.�&z&�<z<�"z"�>z>�
z
�
z
� z	N)�replace�write)�writer�data� is_attrib� r �/usr/lib/python3.6/xml_fix.py�_Replacement_write_data s r � c C s� |j |d | j � | j� }t|j� �}x8|D ]0}|j d| � t||| jdd� |j d� q.W | jr�|j d| � x"| jD ]}|j||| ||� q~W |j d|| j|f � n|j d| � d S ) Nr z %s="T)r
r z>%sz %s</%s>%sz/>%s) r
ZtagNameZ_get_attributes�sorted�keysr �valueZ
childNodes�writexml) �selfr �indentZ addindentZnewlZattrsZa_namesZa_nameZnoder r r �_Replacement_writexml s
r c @ s( e Zd ZdZdd� Zdd� Zdd� ZdS ) �XmlFixz7Object to manage temporary patching of xml.dom.minidom.c C s4 t jjj| _t jjjj| _tt jj_tt jjj_d S )N) �xml�dom�minidom�_write_data�
write_data�Elementr r r )r r r r �__init__5 s
zXmlFix.__init__c C s* | j r&| j tjj_| jtjjj_d | _ d S )N)r r r r r r r )r r r r �Cleanup= s zXmlFix.Cleanupc C s | j � d S )N)r! )r r r r �__del__C s zXmlFix.__del__N)�__name__�
__module__�__qualname__�__doc__r r! r"