ok

Mini Shell

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

�

�܋fT����dZddlmZddlZddlZddlZddlmZm	Z	m
Z
mZmZddl
mZmZddlmZddlmZmZmZmZddlmZd&d'd�Zd(d�Zd)d*d�Z					d+d,d"�Zd-d#�Zd.d%�ZdS)/aCoverage data for coverage.py.

This file had the 4.x JSON data support, which is now gone.  This file still
has storage-agnostic helpers, and is kept to avoid changing too many imports.
CoverageData is now defined in sqldata.py, and imported here to keep the
imports working.

�)�annotationsN)�Callable�Dict�Iterable�List�Optional)�CoverageException�NoDataError)�PathAliases)�Hasher�file_be_gone�human_sorted�plural)�CoverageDataF�datar�fullpath�bool�return�Dict[str, int]c���i}|rd�}ntjj}|���D]6}|�|��}|�J�t|��|||��<�7|S)aHReturn a dict summarizing the line coverage data.

    Keys are based on the file names, and values are the number of executed
    lines.  If `fullpath` is true, then the keys are the full pathnames of
    the files, otherwise they are the basenames of the files.

    Returns a dict mapping file names to counts of lines.

    c��|S�N�)�fs �`/builddir/build/BUILD/cloudlinux-venv-1.0.6/venv/lib64/python3.11/site-packages/coverage/data.py�<lambda>zline_counts.<locals>.<lambda>)s����)�os�path�basename�measured_files�lines�len)rr�summ�filename_fn�filenamer"s      r�line_countsr's~���D��'�!�k����g�&���'�'�)�)�1�1���
�
�8�$�$��� � � �&)�%�j�j��[�[��
"�
"�#�#��Krr&�str�hasherr�Nonec�4�|���r8|�t|�|��pg����n#|�t	||����|�|�|����dS)z�Contribute `filename`'s data to the `hasher`.

    `hasher` is a `coverage.misc.Hasher` instance to be updated with
    the file's data.  It should only get the results data, not the run
    data.

    N)�has_arcs�update�sorted�arcs�sorted_lines�file_tracer)rr&r)s   r�add_data_to_hashr23s����}�}���4��
�
�f�T�Y�Y�x�0�0�6�B�7�7�8�8�8�8��
�
�l�4��2�2�3�3�3�
�M�M�$�"�"�8�,�,�-�-�-�-�-r�	data_file�
data_paths�Optional[Iterable[str]]�	List[str]c��tj�tj�|����\}}|p|g}g}|D]�}tj�|��r3|�tj�|�����Ttj�|��rztjtj�	tj�|��|����dz}|�
tj|������td|�d����|S)z�Make a list of data files to be combined.

    `data_file` is a path to a data file.  `data_paths` is a list of files or
    directories of files.

    Returns a list of absolute file paths.
    z.*z)Couldn't combine from non-existent path '�')rr�split�abspath�isfile�append�isdir�glob�escape�join�extendr
)r3r4�data_dir�local�files_to_combine�p�patterns       r�combinable_filesrGBs���g�m�m�B�G�O�O�I�$>�$>�?�?�O�H�e��)��z�J���
�P�P��
�7�>�>�!���	P��#�#�B�G�O�O�A�$6�$6�7�7�7�7�
�W�]�]�1�
�
�	P��k�"�'�,�,�r�w���q�/A�/A�5�"I�"I�J�J�D�P�G��#�#�D�I�g�$6�$6�7�7�7�7��N�!�N�N�N�O�O�O��r�aliases�Optional[PathAliases]�strict�keep�message�Optional[Callable[[str], None]]c�j�t|���|��}|r|std���t��}d}|D�]T}	|	|���kr8|j�d��r|j�d|	�����S	tj	�
|	��}
n#t$r|	}
YnwxYwt|	d��5}tjd��}|�|�����|���}
|
|v}ddd��n#1swxYwY|}|r�|j�d��r|j�d|	����|�|
��	t'|	|j�	��}|���|�||�
��d}|r|d|
����ne#t($rH}|jr"|�t-|����|r|d
|
�d|����d}Yd}~nd}~wwxYw|r|d|
����|rF|j�d��r|j�d|	����t/|	����V|r|std���dSdS)a�Combine a number of data files together.

    `data` is a CoverageData.

    Treat `data.filename` as a file prefix, and combine the data from all
    of the data files starting with that prefix plus a dot.

    If `aliases` is provided, it's a `PathAliases` object that is used to
    re-map paths to match the local machine's.

    If `data_paths` is provided, it is a list of directories or files to
    combine.  Directories are searched for files that start with
    `data.filename` plus dot as a prefix, and those files are combined.

    If `data_paths` is not provided, then the directory portion of
    `data.filename` is used as the directory to search for data files.

    Unless `keep` is True every data file found and combined is then deleted
    from disk. If a file cannot be read, a warning will be issued, and the
    file will not be deleted.

    If `strict` is true, and no files are found to combine, an error is
    raised.

    `message` is a function to use for printing messages to the user.

    zNo data to combineF�dataiozSkipping combining ourself: �rb�sha3_256NzCombining data file )�debug)rHTzCombined data file zCouldn't combine data file �: zSkipping duplicate data zDeleting data file zNo usable data files)rG�
base_filenamer
�set�
data_filename�_debug�should�writerr�relpath�
ValueError�open�hashlib�newr-�read�digest�addrr	�_warnr(r
)rrHr4rJrKrLrD�file_hashes�combined_anyr�
rel_file_name�fobjr)�sha�combine_this_one�delete_this_one�new_data�excs                  r�combine_parallel_datarlYsv��F(��(:�(:�(<�(<�j�I�I��
�0�&�0��.�/�/�/��%�%�K��L�
�2�2����"�"�$�$�$�$��{�!�!�(�+�+�
H���!�!�"F��"F�"F�G�G�G��	��G�O�O�A�.�.�M�M���	�	�	��M�M�M�		�����!�T�]�]�	6�d��[��,�,�F��M�M�$�)�)�+�+�&�&�&��-�-�/�/�C�"�+�5��		6�	6�	6�	6�	6�	6�	6�	6�	6�	6�	6����	6�	6�	6�	6�#�(���	D��{�!�!�(�+�+�
@���!�!�">��">�">�?�?�?��O�O�C� � � �
C�'����=�=�=���
�
�������H�g��6�6�6�#���C��G�A�-�A�A�B�B�B���%�
(�
(�
(��:�)��J�J�s�3�x�x�(�(�(��R��G�P�-�P�P�3�P�P�Q�Q�Q�"'�����������
(�����
D���B�=�B�B�C�C�C��	��{�!�!�(�+�+�
?���!�!�"=��"=�"=�>�>�>���O�O�O��
�2�l�2��0�1�1�1�2�2�2�2s=�B<�<C�
C�AD>�>E	�E	�*G/�/
I�9>H<�<Ic	��t|��}|���}td|����tj�|��std��dS|���td|�������t|d���}t|�
����}t|��}t|�dt|���d���|D]T}|�d	||�d
t||����}|�
|��}|r	|d|�d�z
}t|���UdS)
z(Implementation of 'coverage debug data'.zpath: z%No data collected: file doesn't existNz
has_arcs: T)rz file�:rSz linez [�])rrV�printrr�existsr_r,r'r�keysr#rr1)r&r�summary�	filenames�nfilesr�line�plugins        r�debug_data_filerx�sb����!�!�D��!�!�#�#�H�	�
�8�
�
����
�7�>�>�(�#�#��
�5�6�6�6����I�I�K�K�K�	�
*�t�}�}���
*�
*�+�+�+��$��.�.�.�G��W�\�\�^�^�,�,�I�
��^�^�F�	�V�
+�
+�&��.�.�
+�
+�
+�,�,�,�
�����<�<�w�q�z�<�<��w�q�z�(:�(:�<�<���!�!�!�$�$���	#��N��N�N�N�"�D�
�d������r�	List[int]c�N�|�|��}t|pg��S)z+Get the sorted lines for a file, for tests.)r"r.)rr&r"s   rr0r0�s%���J�J�x� � �E��%�+�2���r)F)rrrrrr)rrr&r(r)rrr*r)r3r(r4r5rr6)NNFFN)rrrHrIr4r5rJrrKrrLrMrr*)r&r(rr*)rrr&r(rry)�__doc__�
__future__rr>r]�os.pathr�typingrrrrr�coverage.exceptionsr	r
�coverage.filesr�
coverage.miscrr
rr�coverage.sqldatarr'r2rGrlrxr0rrr�<module>r�sp����#�"�"�"�"�"�������������;�;�;�;�;�;�;�;�;�;�;�;�;�;�>�>�>�>�>�>�>�>�&�&�&�&�&�&�D�D�D�D�D�D�D�D�D�D�D�D�)�)�)�)�)�)������0.�.�.�.������2&*�*.���/3�
`2�`2�`2�`2�`2�F����,�����r

Zerion Mini Shell 1.0