AlkantarClanX12

Your IP : 18.225.195.153


Current Path : /opt/cloudlinux/venv/lib/python3.11/site-packages/coverage/__pycache__/
Upload File :
Current File : //opt/cloudlinux/venv/lib/python3.11/site-packages/coverage/__pycache__/tomlconfig.cpython-311.pyc

�

�܋f����dZddlmZddlZddlZddlmZmZmZm	Z	m
Z
mZmZm
Z
mZddlmZddlmZddlmZmZddlmZmZejd	krddlZd
Zned��\ZZGd�d
e��Zed��ZGd�d��ZdS)z*TOML configuration support for coverage.py�)�annotationsN)	�Any�Callable�Dict�Iterable�List�Optional�Tuple�Type�TypeVar)�env)�ConfigError)�import_third_party�substitute_variables)�TConfigSectionOut�TConfigValueOut)��r�alpha�T�tomlic��eZdZdZdS)�TomlDecodeErrorz>An exception class that exists even when toml isn't installed.N)�__name__�
__module__�__qualname__�__doc__���f/builddir/build/BUILD/cloudlinux-venv-1.0.6/venv/lib64/python3.11/site-packages/coverage/tomlconfig.pyrrs������H�H��Drr�TWantc��eZdZdZd.d�Zd/d
�Zd0d�Zd1d�Zd2d�Zd3d�Z	d4d�Z
d5d�Zd6d�Zd7d�Z
d2d�Zd8d#�Zd3d$�Zd9d&�Zd:d'�Zd:d(�Zd;d*�Zd<d,�Zd-S)=�TomlConfigParserz:TOML file reading with the interface of HandyConfigParser.�our_file�bool�return�Nonec�"�||_i|_dS�N)r$�data)�selfr$s  r �__init__zTomlConfigParser.__init__)s�� ��
�$&��	�	�	r�	filenames�
Iterable[str]�	List[str]c�p�t|tttjf��sJ�tj|��}	t
|d���5}|���}ddd��n#1swxYwYn#t$rgcYSwxYwtrR	tj|��|_n4#tj
$r"}tt|����|�d}~wwxYw|gStjd|tj���}|js|r$d}t'|�|�����gS)Nzutf-8)�encodingz^\[tool\.coverage(\.|]))�flagsz?Can't read {!r} without TOML support. Install with [toml] extra)�
isinstance�bytes�str�os�PathLike�fspath�open�read�OSError�has_tomllib�tomllib�loadsr*�TOMLDecodeErrorr�re�search�	MULTILINEr$r�format)r+r-�filename�fp�	toml_text�err�has_toml�msgs        r r:zTomlConfigParser.read-s|���)�e�S�"�+�%>�?�?�?�?�?��9�Y�'�'��	��h��1�1�1�
&�R��G�G�I�I�	�
&�
&�
&�
&�
&�
&�
&�
&�
&�
&�
&����
&�
&�
&�
&����	�	�	��I�I�I�	�����	�
9�#�M�)�4�4��	�	���*�
9�
9�
9�%�c�#�h�h�/�/�S�8�����
9�����:���y�!;�Y�b�l�[�[�[�H��}�
8��
8�W��!�#�*�*�X�"6�"6�7�7�7��IsM�A=�A1�%A=�1A5�5A=�8A5�9A=�=B�B�B1�1C"�C�C"�sectionr5�1Tuple[Optional[str], Optional[TConfigSectionOut]]c���dg}|D]W}||z}|�d��}	|j|d}|dd�D]
}||}�n#t$rY�RwxYwndS||fS)aCGet a section from the data.

        Arguments:
            section (str): A section name, which can be dotted.

        Returns:
            name (str): the actual name of the section that was found, if any,
                or None.
            data (str): the dict of data in the section, or None if not found.

        ztool.coverage.�.r�N)NN)�splitr*�KeyError)r+rJ�prefixes�prefix�real_section�partsr*�parts        r �_get_sectionzTomlConfigParser._get_sectionFs���%�%���	�	�F�!�G�+�L� �&�&�s�+�+�E�
��y��q��*��!�!�"�"�I�&�&�D���:�D�D�&���
�
�
���
�����E��:��T�!�!s�(A�
A�A�option�Tuple[str, TConfigValueOut]c���|�|��\}}|�td|�����|�J�	||}n$#t$rtd|�d|����d�wxYw||fS)z;Like .get, but returns the real section name and the value.N�No section: z
No option z
 in section: )rVrrP)r+rJrW�namer*�values      r �_getzTomlConfigParser._getas����&�&�w�/�/�
��d��<��8�W�8�8�9�9�9�����	V���L�E�E���	V�	V�	V��J�6�J�J�$�J�J�K�K�QU�U�	V�����U�{�s	�;�!Arc��|�||��\}}t|t��rt|tj��}||fS)z�Get a single-valued option.

        Performs environment substitution if the value is a string. Other types
        will be converted later as needed.
        )r]r3r5rr6�environ�r+rJrWr[r\s     r �_get_singlezTomlConfigParser._get_singlemsH���i�i���0�0���e��e�S�!�!�	<�(���
�;�;�E��U�{�rc�B�|�|��\}}|�dS||vS)NF�rV)r+rJrW�_r*s     r �
has_optionzTomlConfigParser.has_optionxs-���#�#�G�,�,���4��<��5���~�r�
Optional[str]c�6�|�|��\}}|Sr)rc�r+rJr[rds    r rSzTomlConfigParser.real_section~s���#�#�G�,�,���a��rc�P�|�|��\}}t|��Sr))rVr%rhs    r �has_sectionzTomlConfigParser.has_section�s%���#�#�G�,�,���a��D�z�z�rc��|�|��\}}|�td|�����t|�����S)NrZ)rVr�list�keys�r+rJrdr*s    r �optionszTomlConfigParser.options�sK���#�#�G�,�,���4��<��8�W�8�8�9�9�9��D�I�I�K�K� � � rrc�:�|�|��\}}|piSr)rcrns    r �get_sectionzTomlConfigParser.get_section�s#���#�#�G�,�,���4��z�r�rc�8�|�||��\}}|Sr))ra)r+rJrWrdr\s     r �getzTomlConfigParser.get�s ���#�#�G�V�4�4���5��rr\�type_�Type[TWant]�	converter� Optional[Callable[[Any], TWant]]�	type_descr!c��t||��r|St|t��r<|�:	||��S#t$r!}td|�d|�d|�d|����|�d}~wwxYwtd|�d|�d|�d|�����)z�Check that `value` has the type we want, converting if needed.

        Returns the resulting value of the desired type.
        NzOption [�]z couldn't convert to �: z is not )r3r5�	Exception�
ValueError)r+rJrWr\rtrvrx�es        r �_check_typezTomlConfigParser._check_type�s����e�U�#�#�	��L��e�S�!�!�	�i�&;�
� �y��'�'�'���
�
�
� �\�w�\�\��\�\�i�\�\�SX�\�\���������
�����G�w�G�G��G�G��G�G�e�G�G�
�
�	
s�
6�
A!�A�A!c��|�||��\}}ddd�}|�|||t|jd��S)NTF)�true�falsez	a boolean)rarr%�__getitem__)r+rJrWr[r\�bool_stringss      r �
getbooleanzTomlConfigParser.getboolean�sJ���&�&�w��7�7���e� $�u�5�5������f�e�T�<�;S�U`�a�a�ar�Tuple[str, List[str]]c��|�||��\}}|�|||tdd��}d�|D��}||fS)zJGet a list of strings, substituting environment variables in the elements.Nza listc�B�g|]}t|tj����Sr)rr6r_)�.0r\s  r �
<listcomp>z.TomlConfigParser._get_list.<locals>.<listcomp>�s%��N�N�N�e�&�u�b�j�9�9�N�N�Nr)r]rrl)r+rJrWr[�valuess     r �	_get_listzTomlConfigParser._get_list�sS���y�y��&�1�1���f��!�!�$����d�H�M�M��N�N�v�N�N�N���V�|�rc�8�|�||��\}}|Sr))r�)r+rJrWrdr�s     r �getlistzTomlConfigParser.getlist�s���N�N�7�F�3�3�	��6��
rc��|�||��\}}|D]^}|���}	tj|���,#tj$r!}td|�d|�d|�d|����|�d}~wwxYw|S)Nz	Invalid [z].z value r{)r��stripr@�compile�errorr)r+rJrWr[r�r\r~s       r �getregexlistzTomlConfigParser.getregexlist�s����~�~�g�v�6�6���f��	\�	\�E��K�K�M�M�E�
\��
�5�!�!�!�!���8�
\�
\�
\�!�"S�d�"S�"S�f�"S�"S�U�"S�"S�PQ�"S�"S�T�T�Z[�[�����
\�����
s�A�A8�A3�3A8�intc�|�|�||��\}}|�|||ttd��S)Nz
an integer)rarr�r`s     r �getintzTomlConfigParser.getint�s9���&�&�w��7�7���e�����f�e�S�#�|�L�L�Lr�floatc���|�||��\}}t|t��rt|��}|�|||ttd��S)Nza float)rar3r�r�rr`s     r �getfloatzTomlConfigParser.getfloat�sV���&�&�w��7�7���e��e�S�!�!�	!��%�L�L�E�����f�e�U�E�9�M�M�MrN)r$r%r&r')r-r.r&r/)rJr5r&rK)rJr5rWr5r&rX)rJr5rWr5r&r)rJr5rWr5r&r%)rJr5r&rf)rJr5r&r%)rJr5r&r/)rJr5r&r)rJr5rWr5r\rrtrurvrwrxr5r&r!)rJr5rWr5r&r�)rJr5rWr5r&r/)rJr5rWr5r&r�)rJr5rWr5r&r�)rrrrr,r:rVr]rarerSrjrorqrsrr�r�r�r�r�r�rrr r#r#"s�������D�D�'�'�'�'�����2"�"�"�"�6
�
�
�
�	�	�	�	�������������!�!�!�!���������
�
�
�
�4b�b�b�b�
������������M�M�M�M�N�N�N�N�N�Nrr#) r�
__future__rr6r@�typingrrrrrr	r
rr�coverager
�coverage.exceptionsr�
coverage.miscrr�coverage.typesrr�	PYVERSIONr=r<r|rr!r#rrr �<module>r�s��1�0�"�"�"�"�"�"�	�	�	�	�	�	�	�	�V�V�V�V�V�V�V�V�V�V�V�V�V�V�V�V�V�V�V�V�V�V�������+�+�+�+�+�+�B�B�B�B�B�B�B�B�=�=�=�=�=�=�=�=��=�*�*�*��N�N�N��K�K�.�-�g�6�6��G�[�	�	�	�	�	�i�	�	�	�
	������nN�nN�nN�nN�nN�nN�nN�nN�nN�nNr