Hacked By AnonymousFox

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

�

�܋f�U��P�dZddlmZddlZddlZddlZddlZddlZddlZddl	m
Z
mZmZm
Z
mZmZmZmZddlmZddlmZmZmZddlmZmZddlmZmZmZmZm Z m!Z!ee��ZGd	�d
ej"��Z#ee#efZ$dgZ%dgZ&d
dgZ'Gd�dee!��Z(dd�Z)dd�Z*dS)zConfig file for coverage.py�)�annotationsN)�Any�Callable�Dict�Iterable�List�Optional�Tuple�Union)�ConfigError)�isolate_module�human_sorted_items�substitute_variables)�TomlConfigParser�TomlDecodeError)�
TConfigurable�TConfigSectionIn�TConfigValueIn�TConfigSectionOut�TConfigValueOut�
TPluginConfigc���eZdZdZd�fd�Z	dd�fd
�
Zd �fd�Zd!�fd�Zd"d�Zd#�fd�Z	d$d�Z
d%�fd�Zd&d�Zd&d�Z
�xZS)'�HandyConfigParserz#Our specialization of ConfigParser.�our_file�bool�return�Nonec���t���d���dg|_|r|j�d��dSdS)z�Create the HandyConfigParser.

        `our_file` is True if this config file is specifically for coverage,
        False if we are examining another config file (tox.ini, setup.cfg)
        for possible settings.
        N)�
interpolationz	coverage:�)�super�__init__�section_prefixes�append)�selfr�	__class__s  ��b/builddir/build/BUILD/cloudlinux-venv-1.0.6/venv/lib64/python3.11/site-packages/coverage/config.pyr"zHandyConfigParser.__init__!sY���	�����t��,�,�,�!,�
����	-��!�(�(��,�,�,�,�,�	-�	-�N�	filenames�
Iterable[str]�encoding_unused�
Optional[str]�	List[str]c�J��t���|d���S)z-Read a file name as UTF-8 configuration data.zutf-8)�encoding)r!�read)r%r)r+r&s   �r'r0zHandyConfigParser.read.s����w�w�|�|�I��|�8�8�8r(�section�strc�t��|jD].}||z}t���|��}|r|cS�/dS)z!Get the actual name of a section.N)r#r!�has_section)r%r1�section_prefix�real_section�hasr&s     �r'r6zHandyConfigParser.real_section6sT���"�3�	$�	$�N�)�G�3�L��'�'�%�%�l�3�3�C��
$�#�#�#�#�
$��tr(�optionc�z��|�|��}|�"t���||��SdS)NF)r6r!�
has_option)r%r1r8r6r&s    �r'r:zHandyConfigParser.has_option?s;����(�(��1�1���#��7�7�%�%�l�F�;�;�;��ur(c�F�t|�|����S�N)rr6)r%r1s  r'r4zHandyConfigParser.has_sectionEs���D�%�%�g�.�.�/�/�/r(c���|�|��}|�!t���|��Std|�����)NzNo section: )r6r!�optionsr)r%r1r6r&s   �r'r>zHandyConfigParser.optionsHsI����(�(��1�1���#��7�7�?�?�<�0�0�0��4��4�4�5�5�5r(rc�l�i}|�|��D]}|�||��||<�|S)z/Get the contents of a section, as a dictionary.)r>�get)r%r1�d�opts    r'�get_sectionzHandyConfigParser.get_sectionNs@��(*���<�<��(�(�	,�	,�C��X�X�g�s�+�+�A�c�F�F��r(�argsr�kwargsc���|jD]+}||z}t���||��rn�,td|�d|�����t��j||g|�Ri|��}t|tj��}|S)aGet a value, replacing environment variables also.

        The arguments are the same as `ConfigParser.get`, but in the found
        value, ``$WORD`` or ``${WORD}`` are replaced by the value of the
        environment variable ``WORD``.

        Returns the finished value.

        z
No option z
 in section: )r#r!r:rr@r�os�environ)	r%r1r8rDrEr5r6�vr&s	        �r'r@zHandyConfigParser.getUs����#�3�	O�	O�N�)�G�3�L��w�w�!�!�,��7�7�
���
��M�6�M�M�'�M�M�N�N�N������\�6�C�D�C�C�C�F�C�C�� ��B�J�/�/���r(c���|�||��}g}|�d��D]E}|�d��D]-}|���}|r|�|���.�F|S)z�Read a list of strings.

        The value of `section` and `option` is treated as a comma- and newline-
        separated list of strings.  Each value is stripped of white space.

        Returns the list of strings.

        �
�,)r@�split�stripr$)r%r1r8�
value_list�values�
value_line�values       r'�getlistzHandyConfigParser.getlistjs����X�X�g�v�.�.�
���$�*�*�4�0�0�	)�	)�J�#�)�)�#�.�.�
)�
)�����
�
���)��M�M�%�(�(�(��
)��
r(c�L�|�||��}g}|���D]v}|���}	tj|��n3#tj$r!}t
d|�d|�d|�d|����|�d}~wwxYw|r|�|���w|S)z�Read a list of full-line regexes.

        The value of `section` and `option` is treated as a newline-separated
        list of regexes.  Each value is stripped of white space.

        Returns the list of strings.

        z	Invalid [z].z value �: N)r@�
splitlinesrN�re�compile�errorrr$)r%r1r8�	line_listrOrR�es       r'�getregexlistzHandyConfigParser.getregexlist|s����H�H�W�f�-�-�	��
��)�)�+�+�		)�		)�E��K�K�M�M�E�
��
�5�!�!�!�!���8�
�
�
�!�H��H�H�6�H�H�%�H�H�Q�H�H���������
�����
)��!�!�%�(�(�(���s�A�B	�(B�B	)rrrrr<)r)r*r+r,rr-)r1r2rr,)r1r2r8r2rr)r1r2rr)r1r2rr-)r1r2rr)
r1r2r8r2rDrrErrr2)r1r2r8r2rr-)�__name__�
__module__�__qualname__�__doc__r"r0r6r:r4r>rCr@rSr\�
__classcell__)r&s@r'rrs3�������-�-�-�-�-�-�-�-� *.�9�9�9�9�9�9�9�������������0�0�0�0�6�6�6�6�6�6�����������*����$�������r(rz3#\s*(pragma|PRAGMA)[:\s]?\s*(no|NO)\s*(cover|COVER)z5#\s*(pragma|PRAGMA)[:\s]?\s*(no|NO)\s*(branch|BRANCH)zwhile (True|1|False|0):zif (True|1|False|0):c��eZdZdZd)d�Zhd�Zd*d�Zd+d�Zd,d�Zhd�Z	gd�Z
	d-d.d�Zd/d�Zd0d �Z
d1d"�Zd2d$�Zd)d%�Zd3d'�Zd(S)4�CoverageConfigz�Coverage.py configuration.

    The attributes of this class are the various settings that control the
    operation of coverage.py.

    rrc�d�g|_g|_d|_d|_d|_d|_d|_d|_g|_d|_	d|_
d|_g|_d|_
g|_d|_d|_g|_d|_g|_g|_d|_d|_g|_d|_d|_t4dd�|_g|_d|_d|_d|_d|_ d|_!d|_"tFdd�|_$tJdd�|_&d|_'d|_(d|_)d|_*d|_+d|_,d|_-d|_.d|_/d|_0d|_1d|_2d|_3d	|_4d
|_5d|_6d|_7d|_8i|_9i|_:dS)z:Initialize the configuration attributes to their defaults.NFz	.coveragegr�htmlcovzCoverage reportzcoverage.xml�cz
coverage.jsonz
coverage.lcov);�attempted_config_files�config_files_read�config_file�_config_contents�_include�_omit�branch�command_line�concurrency�context�cover_pylib�	data_file�debug�
debug_file�disable_warnings�dynamic_context�parallel�plugins�relative_files�run_include�run_omit�sigterm�source�source_pkgs�timid�_crash�DEFAULT_EXCLUDE�exclude_list�exclude_also�
fail_under�format�
ignore_errors�include_namespace_packages�report_include�report_omit�DEFAULT_PARTIAL_ALWAYS�partial_always_list�DEFAULT_PARTIAL�partial_list�	precision�report_contexts�show_missing�skip_covered�
skip_empty�sort�	extra_css�html_dir�html_skip_covered�html_skip_empty�
html_title�
show_contexts�
xml_output�xml_package_depth�json_output�json_pretty_print�json_show_contexts�lcov_output�paths�plugin_options�r%s r'r"zCoverageConfig.__init__�s���24��#�,.���*.���15�����
���
����+/���&(���&*��� ���$��� "��
�)-���+-���.2�����
�"$���#���&(���#%��
����+/���&(�����
�%)���,�A�A�A�.���')������%)���"���*/��'�37���04���#9�!�!�!�#<�� �+�A�A�A�.������48���!���!������#'��	�)-���!��
�15���/3���+���"���)���!#���+���!&���"'���+���,.��
�=?����r(>rsrxr{ror�rzr�rErc��|���D]9\}}|�2||jvrt|t��r|g}t	|||���:dS)z!Read config values from `kwargs`.N)�items�MUST_BE_LIST�
isinstancer2�setattr)r%rE�krIs    r'�	from_argszCoverageConfig.from_args
sc���L�L�N�N�	$�	$�D�A�q��}���)�)�)�j��C�.@�.@�)���A���a��#�#�#��		$�	$r(�filenamer2�warn�Callable[[str], None]rrc	��tj�|��\}}|dkrt|��}nt	|��}|j�|��	|�|��}n4#tj	tf$r}td|�d|����|�d}~wwxYw|sdS|j�
ttjj|����d}		|jD]}
|j|g|
�R�}|rd}	�n(#t$$r}td|�d|����|�d}~wwxYwt'jt*��}|jD];}
|
d�d��\}
}||
�|���<|���D]d\}
}|�|
��}|rHt+|�|
����|z
D]"}|d	�|||�����#�e|�d
��r8|�d
��D]"}|�d
|��|j|<d}	�#|jD]6}|�|��r|� |��|j!|<d}	�7|rd}n|	}|retj�|��|_"tG|d��5}|���|_$ddd��n#1swxYwY|S)a�Read configuration from a .rc file.

        `filename` is a file name to read.

        `our_file` is True if this config file is specifically for coverage,
        False if we are examining another config file (tox.ini, setup.cfg)
        for possible settings.

        Returns True or False, whether the file could be read, and it had some
        coverage.py settings in it.

        z.tomlzCouldn't read config file rUNFT��:z0Unrecognized option '[{}] {}=' in config file {}r��rb)%rG�path�splitextrrrgr$r0�configparser�Errorrrrh�extend�map�abspath�CONFIG_FILE_OPTIONS�_set_attr_from_config_option�
ValueError�collections�defaultdict�setrM�addr�r6r>r�r4rSr�rxrCr�ri�openrj)r%r�r�r�_�ext�cp�
files_read�err�any_set�option_spec�was_set�all_optionsr1r8r>r6�unknown�plugin�used�fs                     r'�	from_filezCoverageConfig.from_files�����!�!�(�+�+���3��'�>�>�!�(�+�+�B�B�"�8�,�,�B��#�*�*�8�4�4�4�	W�����*�*�J�J���"�O�4�	W�	W�	W��L�8�L�L�s�L�L�M�M�SV�V�����	W�����	��5���%�%�c�"�'�/�:�&F�&F�G�G�G���	W�#�7�
#�
#��;�$�;�B�M��M�M�M���#�"�G��
#���	W�	W�	W��L�8�L�L�s�L�L�M�M�SV�V�����	W����"�-�c�2�2���3�	-�	-�K�)�!�n�2�2�3�7�7�O�G�V��� �$�$�V�,�,�,�,� +� 1� 1� 3� 3�	�	��G�W��?�?�7�3�3�L��
�"�2�:�:�g�#6�#6�7�7�'�A���G��D�J�Q�Q�(�'�8���������>�>�'�"�"�	��*�*�W�-�-�
�
��%'�Z�Z���%@�%@��
�6�"�����l�	�	�F��~�~�f�%�%�
�.0�n�n�V�.D�.D��#�F�+����
�	��D�D��D��	1�!�w���x�8�8�D���h��%�%�
1��()������%�
1�
1�
1�
1�
1�
1�
1�
1�
1�
1�
1����
1�
1�
1�
1��sB�#A9�9B*�B%�%B*�+D�
D-�D(�(D-�
K3�3K7�:K7c�*�tj|��S)z#Return a copy of the configuration.)�copy�deepcopyr�s r'r�zCoverageConfig.copyes���}�T�"�"�"r(>�gevent�thread�eventlet�greenlet�multiprocessing)0)rmz
run:branch�boolean)rnzrun:command_line)rozrun:concurrency�list)rpzrun:context)rqzrun:cover_pylibr�)rrz
run:data_file)rsz	run:debugr�)rtzrun:debug_file)ruzrun:disable_warningsr�)rvzrun:dynamic_context)rwzrun:parallelr�)rxzrun:pluginsr�)ryzrun:relative_filesr�)rzzrun:includer�)r{zrun:omitr�)r|zrun:sigtermr�)r}z
run:sourcer�)r~zrun:source_pkgsr�)rz	run:timidr�)r�z
run:_crash)r�zreport:exclude_lines�	regexlist)r�zreport:exclude_alsor�)r�zreport:fail_under�float)r�z
report:formatr�)r�zreport:ignore_errorsr�)r�z!report:include_namespace_packagesr�)r�zreport:partial_branches_alwaysr�)r�zreport:partial_branchesr�)r�zreport:precision�int)r�zreport:contextsr�)r�zreport:includer�)r�zreport:omitr�)r�zreport:show_missingr�)r�zreport:skip_coveredr�)r�zreport:skip_emptyr�)r�zreport:sort)r�zhtml:extra_css)r�zhtml:directory)r�zhtml:skip_coveredr�)r�zhtml:skip_emptyr�)r�z
html:title)r�zhtml:show_contextsr�)r�z
xml:output)r�zxml:package_depthr�)r�zjson:output)r�zjson:pretty_printr�)r�zjson:show_contextsr�)r�zlcov:outputr r��
TConfigParser�attr�where�type_c���|�d��\}}|�||��r0t|d|z��}t|||||����dSdS)ztSet an attribute on self if it exists in the ConfigParser.

        Returns True if the attribute was set.

        r�r@TF)rMr:�getattrr�)r%r�r�r�r�r1r8�methods        r'r�z+CoverageConfig._set_attr_from_config_option�sj�� �+�+�c�*�*����
�=�=��&�)�)�	��R����/�/�F��D�$���w�� 7� 7�8�8�8��4��ur(r�rc�8�|j�|i��S)z:Get a dictionary of options for the plugin named `plugin`.)r�r@)r%r�s  r'�get_plugin_optionsz!CoverageConfig.get_plugin_options�s���"�&�&�v�r�2�2�2r(�option_namerR�'Union[TConfigValueIn, TConfigSectionIn]c�.�|dkr	||_dS|jD])}|dd�\}}||krt|||��dS�*|�d��\}}}|r)||jvr ||j�|i��|<dStd|�����)aBSet an option in the configuration.

        `option_name` is a colon-separated string indicating the section and
        option name.  For example, the ``branch`` option in the ``[run]``
        section of the config file would be indicated with `"run:branch"`.

        `value` is the new value for the option.

        r�N�r��No such option: )r�r�r��	partitionrxr��
setdefaultr)	r%r�rRr�r�r��plugin_namer��keys	         r'�
set_optionzCoverageConfig.set_option�s����'�!�!��D�J��F� �3�	�	�K�%�b�q�b�/�K�D�%���#�#���d�E�*�*�*����$�
*�3�3�C�8�8���Q���	�;�$�,�.�.�CH�D��*�*�;��;�;�C�@��F��<�[�<�<�=�=�=r(�Optional[TConfigValueOut]c�B�|dkr|jS|jD]'}|dd�\}}||krt||��cS�(|�d��\}}}|r7||jvr.|j�|i���|��Std|�����)a<Get an option from the configuration.

        `option_name` is a colon-separated string indicating the section and
        option name.  For example, the ``branch`` option in the ``[run]``
        section of the config file would be indicated with `"run:branch"`.

        Returns the value of the option.

        r�Nr�r�r�)r�r�r�r�rxr�r@r)r%r�r�r�r�r�r�r�s        r'�
get_optionzCoverageConfig.get_option�s����'�!�!��:�� �3�	+�	+�K�%�b�q�b�/�K�D�%���#�#��t�T�*�*�*�*�*�$�*�3�3�C�8�8���Q���	E�;�$�,�.�.��&�*�*�;��;�;�?�?��D�D�D��<�[�<�<�=�=�=r(r�c�@�tj�|��S)z8Make final adjustments to a file path to make it usable.)rGr��
expanduser)r%r�s  r'�post_process_filez CoverageConfig.post_process_files���w�!�!�$�'�'�'r(c�Z�����j���_���j���_���j���_t	�fd��j���D�����_�xj�jz
c_dS)z7Make final adjustments to settings to make them usable.c3�>�K�|]\}}|�fd�|D��fV��dS)c�:��g|]}��|����S�)r�)�.0r�r%s  �r'�
<listcomp>z9CoverageConfig.post_process.<locals>.<genexpr>.<listcomp>
s'���6�6�6�q��'�'��*�*�6�6�6r(Nr�)r�r�rIr%s   �r'�	<genexpr>z.CoverageConfig.post_process.<locals>.<genexpr>sU�����
�
���1��6�6�6�6�A�6�6�6�7�
�
�
�
�
�
r(N)	r�rrr�r��dictr�r�r�r�r�s`r'�post_processzCoverageConfig.post_processs�����/�/���?�?����.�.�t�}�=�=��
��0�0���A�A����
�
�
�
��
�(�(�*�*�
�
�
�
�
��
�	
���T�.�.����r(�List[Tuple[str, Any]]c�b�td�|j���D����S)z:Make a list of (name, value) pairs for writing debug info.c3�NK�|] \}}|�d���||fV��!dS)r�N)�
startswith)r�r�rIs   r'r�z,CoverageConfig.debug_info.<locals>.<genexpr>sO����"
�"
��q�!�A�L�L��<M�<M�"
�
��F�"
�"
�"
�"
�"
�"
r()r�__dict__r�r�s r'�
debug_infozCoverageConfig.debug_infos>��!�"
�"
�#�}�2�2�4�4�"
�"
�"
�
�
�	
r(N)rr)rErrr)r�r2r�r�rrrr)rrc)r )
r�r�r�r2r�r2r�r2rr)r�r2rr)r�r2rRr�rr)r�r2rr�)r�r2rr2)rr�)r]r^r_r`r"r�r�r�r��CONCURRENCY_CHOICESr�r�r�r�r�r�r�rr�r(r'rcrc�sD��������O?�O?�O?�O?�b���L�$�$�$�$�Q�Q�Q�Q�f#�#�#�#�Z�Y�Y��D�D�D��V������&3�3�3�3�>�>�>�>�>>�>�>�>�8(�(�(�(�	/�	/�	/�	/�
�
�
�
�
�
r(rcri�Union[bool, str]r�List[Tuple[str, bool, bool]]c��|dkrd}|du}|s%tj�d��}|r|}d}|sd}t|t��sJ�|d|fdddg}|S)z�What config files should we try to read?

    Returns a list of tuples:
        (filename, is_our_file, was_file_specified)
    z.coveragercT�COVERAGE_RCFILE)z	setup.cfgFF)ztox.iniFF)zpyproject.tomlFF)rGrHr@r�r2)ri�specified_file�rcfile�files_to_trys    r'�config_files_to_tryrs����m�#�#���!��-�N��"����� 1�2�2���	"� �K�!�N��$�#���k�3�'�'�'�'�'�	�d�N�+�#�!�(�	�L��r(r�r�rErc��t��}|rIt|��}|D]7\}}}|�|||���}|rn|rtd|�d�����8tj�d��}	|	r|	|_tj�d��}
|
r7|j�	d�|
�
d��D����|jdi|��|���|S)	a�Read the coverage.py configuration.

    Arguments:
        config_file: a boolean or string, see the `Coverage` class for the
            tricky details.
        warn: a function to issue warnings.
        all others: keyword arguments from the `Coverage` class, used for
            setting values in the configuration.

    Returns:
        config:
            config is a CoverageConfig object read from the appropriate
            configuration file.

    )rzCouldn't read z as a config file�
COVERAGE_FILE�COVERAGE_DEBUGc3�>K�|]}|���V��dSr<)rN)r�rAs  r'r�z'read_coverage_config.<locals>.<genexpr>bs*����A�A�!�A�G�G�I�I�A�A�A�A�A�Ar(rLr�)
rcrr�rrGrHr@rrrsr�rMr�r�)rir�rE�configr
�fnamerr�config_read�
env_data_file�debugss           r'�read_coverage_configr8s6��,�
�
�F��O�*�;�7�7��/;�	O�	O�+�E�8�^� �*�*�5�$��*�J�J�K��
����
O�!�"M�5�"M�"M�"M�N�N�N�
O�
�J�N�N�?�3�3�M��)�(���
�Z�^�^�,�
-�
-�F�
�B�����A�A�v�|�|�C�/@�/@�A�A�A�A�A�A��F����v�����������Mr()rirrr)rirr�r�rErrrc)+r`�
__future__rr�r�r�rG�os.pathrW�typingrrrrrr	r
r�coverage.exceptionsr�
coverage.miscr
rr�coverage.tomlconfigrr�coverage.typesrrrrrr�ConfigParserrr�r�r�r�rcrrr�r(r'�<module>rsB��"�!�"�"�"�"�"�"�������������	�	�	�	�����	�	�	�	���������������������,�+�+�+�+�+�R�R�R�R�R�R�R�R�R�R�A�A�A�A�A�A�A�A�����������������
�^�B����s�s�s�s�s��1�s�s�s�l�'�)9�9�:�
�
;���=�������l
�l
�l
�l
�l
�]�M�l
�l
�l
�^����>3�3�3�3�3�3r(

Hacked By AnonymousFox1.0, Coded By AnonymousFox