Your IP : 216.73.216.213


Current Path : /opt/alt/python35/lib64/python3.5/site-packages/coverage/__pycache__/
Upload File :
Current File : //opt/alt/python35/lib64/python3.5/site-packages/coverage/__pycache__/summary.cpython-35.pyc



E�WF�@sxdZddlZddlmZddlmZddlmZddlm	Z	m
Z
mZGdd�de�ZdS)	zSummary reporting�N)�env)�Reporter)�Numbers)�	NotPython�CoverageException�output_encodingcs7eZdZdZ�fdd�Zddd�Z�S)�SummaryReporterz*A reporter for writing the summary report.cs/tt|�j||�|jj�|_dS)N)�superr�__init__�dataZhas_arcs�branches)�self�coverage�config)�	__class__��C/opt/alt/python35/lib64/python3.5/site-packages/coverage/summary.pyr
szSummaryReporter.__init__Ncs�|j|�}tdd�|D�dg�}d|}d}d}|dd}|d	}	|jrz|d
7}|	d7}	tj�}
|d|
d
df7}|	d|
df7}	|jjr�|d7}|	d7}	dt|�}tdddddddd+�}|jr)|j	tdddd
���dkr>t
j��fdd�}
|
|�|
|�g}t�}d}x�|D]�}y=|jj
|�}|j}||7}|jjr�|jdk}|jdk}|r�|r�|d7}w�|j�|j|jf}|jr+||j|jf7}||jf7}|jjr�|j�}|jr�|j�}|r�|r~|d 7}||7}||f7}|	|}||jf7}|j||f�Wq�tk
rK|jj}|r!t
j�dd�\}}|tkr!|j�r!d!}|rG|
||j�|j|f�Yq�Xq�Wt |jd"d�r�|j!|jj"j#����dkr�t$d#j%|jj"���|j"d$�fd%d&��x|D]}|
|d�q�W|j&dkrc|
|�d'|j|jf}|jr/||j|jf7}||jf7}|jjrU|d,7}|
|	|�|j&r�|r�t$d)��|jjr�|r�|
|||dkr�d*nd(f�|jo�|jS)-z�Writes a report summarizing coverage statistics per module.

        `outfile` is a file object to write the summary to. It must be opened
        for native strings (bytes on Python 2, Unicode on Python 3).

        cSs"g|]}t|j���qSr)�len�relative_filename)�.0�frrrr�
<listcomp>s	z*SummaryReporter.report.<locals>.<listcomp>�z	%%- %ds  z%s   %s: %sz,
%s file%s skipped due to complete coverage.�Namez
 Stmts   Missz%6d %6dz Branch BrPartz %6d %6dz%*s�ZCoverz	%%%ds%%%%�z
   Missingz   %s�-�namerZstmts�Zmiss�Zcover�branchZbrpartNcs?tjr|jt��}�j|j���jd�dS)z-Write a line to the output, adding a newline.�
N)r�PY2�encoder�write�rstrip)�line)�outfilerr�writeout8s	z(SummaryReporter.report.<locals>.writeoutz, F�sortzInvalid sorting option: {0!r}�keycs|d�|dfS)Nrrr)�l)�positionrr�<lambda>zsz(SummaryReporter.report.<locals>.<lambda>ZTOTAL�zNo data to report.�s���)r.)'Zfind_file_reporters�maxrrZpc_str_widthrZshow_missingr�dict�update�sys�stdoutrZ_analyze�numbersZskip_coveredZ	n_missingZn_partial_branchesrZn_statementsZ
n_branchesZpc_covered_strZmissing_formattedZarcs_missing_formattedZ
pc_covered�append�	Exception�
ignore_errors�exc_inforZshould_be_python�__name__�getattr�getr)�lowerr�formatZn_files)r
Zmorfsr'Zfile_reportersZmax_nameZfmt_nameZfmt_errZfmt_skip_covered�headerZfmt_coverageZwidth100ZruleZcolumn_orderr(�lines�totalZ
skipped_countrZanalysis�numsZno_missing_linesZno_missing_branches�argsZmissing_fmtdZ
branches_fmtd�textZ	report_it�typ�msgr&r)r'r,r�reports� 

	



!		

	
	

		





)

	
&zSummaryReporter.report)r;�
__module__�__qualname__�__doc__r
rHrr)rrrsr)
rKr4rrZcoverage.reportrZcoverage.resultsrZ
coverage.miscrrrrrrrr�<module>s