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__/xmlreport.cpython-311.pyc

�

�܋fC&��P�dZddlmZddlZddlZddlZddlZddlZddl	m
Z
ddlmZm
Z
mZmZmZmZddlmZmZddlmZmZmZddlmZdd	lmZdd
lmZddlm Z ddl!m"Z"erdd
lm#Z#ee��ZdZ$d!d�Z%e
Gd�d����Z&d"d�Z'Gd�d��Z(d#d �Z)dS)$zXML reporting for coverage.py�)�annotationsN)�	dataclass)�Any�Dict�IO�Iterable�Optional�
TYPE_CHECKING)�__version__�files)�isolate_module�human_sorted�human_sorted_items)�FileReporter)�get_analysis_to_report)�Analysis)�TMorf)�__url__)�CoveragezQhttps://raw.githubusercontent.com/cobertura/web/master/htdocs/xml/coverage-04.dtd�hit�int�num�return�strc�"�|dkrdSd||zzS)z0Return the fraction of `hit`/`num`, as a string.r�1z%.4g�)rrs  �e/builddir/build/BUILD/cloudlinux-venv-1.0.6/venv/lib64/python3.11/site-packages/coverage/xmlreport.py�rater"s��
�a�x�x��s���s��#�#�c�F�eZdZUdZded<ded<ded<ded<ded<d	S)
�PackageDataz2Data we keep about each "package" (in Java terms).z"Dict[str, xml.dom.minidom.Element]�elementsr�hits�lines�br_hits�branchesN)�__name__�
__module__�__qualname__�__doc__�__annotations__rr rr"r"*sF�������<�<�0�0�0�0�
�I�I�I��J�J�J��L�L�L��M�M�M�M�Mr r"�parentr�child�Nonec�0�|�|��dS)z=Append a child to a parent, in a way mypy will shut up about.N)�appendChild)r-r.s  rr1r14s��
���u�����r c�0�eZdZdZdZdd�Zddd�Zdd�ZdS)�XmlReporterz<A reporter for writing Cobertura-style XML coverage results.z
XML report�coveragerrr/c��||_|jj|_t��|_|jjr~|jjD]q}t
j�|��rP|jjr|�	d��}ntj|��}|j�|���ri|_
|dS)N�\/)r4�config�set�source_paths�source�os�path�exists�relative_files�rstripr�canonical_filename�add�packages)�selfr4�srcs   r�__init__zXmlReporter.__init__>s��� ��
��m�*����E�E����;��	/��{�)�
/�
/���7�>�>�#�&�&�/��{�1�<�!�j�j��/�/���#�6�s�;�;���%�)�)�#�.�.�.��02��
��.�.�.r N�morfs�Optional[Iterable[TMorf]]�outfile�Optional[IO[str]]�floatc	�
�|ptj}|j������}t
jj���}|�J�|�	ddd��|_
|j
j}|�dt��|�dttt!j��dz������|�|j
�dt&�d�����|�|j
�dt(�d�����t+|j|��D]\}}|�|||���|j
�d	��}|�|��t1|j��D]V}	|j
�d
��}
t#||
��|j
�|	��}t#|
|���Wd\}}
d\}}|j
�d��}|�|��t7|j�����D�]k\}}|j
�d
��}t#||��|j
�d��}t#||��t7|j�����D]\}}t#||���|�d|�t@j!d����|�dtE|j#|j$����|rtE|j%|j&��}nd}|�d|��|�dd��|
|j#z
}
||j$z
}||j%z
}||j&z
}��m|�dt|����|�dt|
����|�dtE|
|����|rk|�dt|����|�dt|����|�dtE||����nB|�dd��|�dd��|�dd��|�dd��|�'tQ|j
����||z}|dkrd}nd|
|zz|z}|S)z�Generate a Cobertura-compatible XML report for `morfs`.

        `morfs` is a list of modules or file names.

        `outfile` is a file object to write the XML to.

        Nr4�version�	timestampi�z Generated by coverage.py: � z
 Based on �sourcesr:)rrrB�package�classes�name�.�	line-rate�0�branch-rate�
complexityzlines-validz
lines-coveredzbranches-validzbranches-coveredrggY@))�sys�stdoutr4�get_data�has_arcs�xml�dom�minidom�getDOMImplementation�createDocument�xml_out�documentElement�setAttributerrr�timer1�
createCommentr�DTD_URLr�xml_file�
createElementrr9�createTextNoderrB�itemsr#�replacer;�seprr$r%r&r'�write�
serialize_xml)rCrFrHr[�impl�	xcoverage�fr�analysis�xsourcesr<�xsource�txt�lnum_tot�	lhits_tot�bnum_tot�	bhits_tot�	xpackages�pkg_name�pkg_data�xpackage�xclasses�_�	class_elt�branch_rate�denom�pcts                          r�reportzXmlReporter.reportNs ���'�S�Z���=�)�)�+�+�4�4�6�6���w��3�3�5�5�������*�*�4��T�B�B����L�0�	����y�+�6�6�6����{�C��D�I�K�K��4D�0E�0E�,F�,F�G�G�G����d�l�8�8�4�'�4�4�4�
�
�	�	�	�	���d�l�8�8�9P�g�9P�9P�9P�Q�Q�R�R�R�3�4�=�%�H�H�	2�	2�L�B���M�M�"�h��1�1�1�1��<�-�-�i�8�8�����h�'�'�'�!��!2�3�3�	&�	&�D��l�0�0��:�:�G���'�*�*�*��,�-�-�d�3�3�C����%�%�%�%�"���)�"���)��L�.�.�z�:�:�	����i�(�(�(�#5�T�]�5H�5H�5J�5J�"K�"K�	*�	*��H�h��|�1�1�)�<�<�H��	�8�,�,�,��|�1�1�)�<�<�H���(�+�+�+� 2�8�3D�3J�3J�3L�3L� M� M�
1�
1���9��H�i�0�0�0�0��!�!�&�(�*:�*:�2�6�3�*G�*G�H�H�H��!�!�+�t�H�M�8�>�/R�/R�S�S�S��
"�"�8�#3�X�5F�G�G���!���!�!�-��=�=�=��!�!�,��4�4�4����&�I����&�H���)�)�I���)�)�H�H����}�c�(�m�m�<�<�<������I���?�?�?����{�D��H�,E�,E�F�F�F��	7��"�"�#3�S��]�]�C�C�C��"�"�#5�s�9�~�~�F�F�F��"�"�=�$�y�(�2K�2K�L�L�L�L��"�"�#5�s�;�;�;��"�"�#3�S�9�9�9��"�"�=�#�6�6�6����|�S�1�1�1�	�
�
�m�D�L�1�1�2�2�2��8�#���A�:�:��C�C��9�y�0�1�E�9�C��
r rqrrrrr[�boolc
�
�|jjr|jjdkrdS|j�dd��}|jD]j}|jjstj	|��}|�
|�dd��dz��r|t|��dzd�}nq�k|����dd��}|j�
|jdt|����d����tj�|��pd}d�|�d��d|jj���}|�dd��}|j�|t/idddd����}	|j�d��}
t5|
|j�d	����|j�d
��}t5|
|��|
�dtj�||����|
�d|�dd����|
�d
d��|���}|���}
t?|j ��D�]}|j�d��}|�dtC|����|�dtCtE||j#v������|r�||vrC||\}}|�dd��|�ddd|z|z||fz��||
vr;d�|
|D��}|�dd�|����t5||����t|j ��}|t|j#��z
}|r\tId�|�%��D����}tId�|�%��D����}||z
}nd}d}|
�dtM||����|rtM||��}nd}|
�d|��|
|	j'|<|	xj(|z
c_(|	xj)|z
c_)|	xj*|z
c_*|	xj+|z
c_+dS)z(Add to the XML report for a single file.rN�\�/�r6rS�class�methodsr%rR�filenamerWrU�line�numberr$�branch�truezcondition-coveragez%d%% (%d/%d)�dc�<�g|]}|dkrdnt|����S)r�exit)r)�.0�bs  r�
<listcomp>z(XmlReporter.xml_file.<locals>.<listcomp>�s*��_�_�_��!�a�%�%���S��V�V�_�_�_r zmissing-branches�,c3� K�|]	\}}|V��
dS�Nr�r��t�ks   r�	<genexpr>z'XmlReporter.xml_file.<locals>.<genexpr>�s&���� E� E�t�q�!�� E� E� E� E� E� Er c3�&K�|]\}}||z
V��
dSr�rr�s   rr�z'XmlReporter.xml_file.<locals>.<genexpr>�s*����"K�"K�T�Q��1�q�5�"K�"K�"K�"K�"K�"Kr rTrV),r7�
skip_empty�numbers�n_statementsr�rkr9r>rr@�
startswith�len�relative_filenamerAr?r;r<�dirname�join�split�xml_package_depthrB�
setdefaultr"rarhr1rc�relpath�branch_stats�missing_branch_arcs�sorted�
statementsrr�missing�sum�valuesrr#r$r%r&r')rCrqrrr[r��source_path�rel_namer��package_namerP�xclass�xlinesr�r�r��xline�total�taken�annlines�class_lines�
class_hits�class_branches�missing_branches�
class_br_hitsr�s                         rrgzXmlReporter.xml_file�s���;�!�	���,��1�1����;�&�&�t�S�1�1���,�	N�	N�K��;�-�
D�#�6�{�C�C���"�"�;�#6�#6�t�S�#A�#A�C�#G�H�H�
�#�C��$4�$4�Q�$6�$7�$7�8����
��+�+�-�-�5�5�d�C�@�@�H���!�!�"�+�o��H�
�
�~�o�">�"E�"E�e�"L�"L�M�M�M��'�/�/�(�+�+�2�s���(�(�7�=�=��-�-�.L�t�{�/L�.L�M�N�N�����s�C�0�0���-�*�*�<��R��A�q�RS�9T�9T�U�U��*.�,�*D�*D�W�*M�*M���F�D�L�6�6�y�A�A�B�B�B���+�+�G�4�4���F�F�#�#�#����F�B�G�O�O�H�g�$F�$F�G�G�G����J��(8�(8��s�(C�(C�D�D�D����L�#�.�.�.��,�,�.�.��&�:�:�<�<���8�.�/�/�	'�	'�D��L�.�.�v�6�6�E����x��T���3�3�3�
���v�s�3�t�8�;K�/K�+L�+L�'M�'M�N�N�N��

O��<�'�'�#/��#5�L�E�5��&�&�x��8�8�8��&�&�,�&�#�e�)�U�*:�E�5�)I�I�����.�.�.�_�_�EX�Y]�E^�_�_�_�H��&�&�'9�3�8�8�H�;M�;M�N�N�N����&�&�&�&��(�-�.�.�� �3�x�'7�#8�#8�8�
��	� � E� E�|�/B�/B�/D�/D� E� E� E�E�E�N�"�"K�"K�\�5H�5H�5J�5J�"K�"K�"K�K�K��*�-=�=�M�M��N��M�	���K��j�+�)F�)F�G�G�G��	��}�n�=�=�K�K��K����M�;�7�7�7�%+����"����
�"����
�
��$�
�
����=�(������N�*����r )r4rrr/r�)rFrGrHrIrrJ)rqrrrrr[r�rr/)r(r)r*r+�report_typerEr�rgrr rr3r39sl������F�F��K�/�/�/�/� Z�Z�Z�Z�Z�xU+�U+�U+�U+�U+�U+r r3r]�xml.dom.minidom.Documentc�*�|���S)z Serialize a minidom node to XML.)�toprettyxml)r]s rrnrns���?�?���r )rrrrrr)r-rr.rrr/)r]r�rr)*r+�
__future__rr;�os.pathrXrd�xml.dom.minidomr\�dataclassesr�typingrrrrr	r
r4rr�
coverage.miscr
rr�coverage.pluginr�coverage.report_corer�coverage.resultsr�coverage.typesr�coverage.versionrrrfrr"r1r3rnrr r�<module>r�s���$�#�"�"�"�"�"�"�	�	�	�	�����
�
�
�
���������!�!�!�!�!�!�C�C�C�C�C�C�C�C�C�C�C�C�C�C�C�C�'�'�'�'�'�'�'�'�J�J�J�J�J�J�J�J�J�J�(�(�(�(�(�(�7�7�7�7�7�7�%�%�%�%�%�%� � � � � � �$�$�$�$�$�$��"�!�!�!�!�!�!��^�B����^��$�$�$�$����������������
F+�F+�F+�F+�F+�F+�F+�F+�R�����r 

Zerion Mini Shell 1.0