
    zi)                        d Z ddlmZ ddlZddlmZ ddlmZmZm	Z	 ddl
mZmZ ddlmZmZ ddlmZ dd	lmZ dd
lmZmZ ddlmZ erddlmZ  G d d          ZdS )zSummary reporting    )annotationsN)Iterable)IOTYPE_CHECKINGAny)ConfigErrorNoDataError)human_sorted_itemsplural)FileReporter)get_analysis_to_report)AnalysisNumbers)TMorfs)Coveragec                  T    e Zd ZdZd#dZd$d	Zd%dZd&dZd&dZd'd(dZ	d)dZ
d*d"ZdS )+SummaryReporterz*A reporter for writing the summary report.coverager   returnNonec                h   || _         | j         j        | _        |                                                                | _        d | _        | j        j        pd| _        | j        dvrt          d| j                  g | _	        d| _
        d| _        t          | j        j                  | _        d S )Ntext>   r   totalmarkdownzUnknown report format choice: r   )	precision)r   configget_datahas_arcsbranchesoutfileformatoutput_formatr   fr_analysesskipped_countempty_countr   r   r   )selfr   s     Z/var/www/tmov.alphamb/tmov_inventario/venv/lib/python3.11/site-packages/coverage/report.py__init__zSummaryReporter.__init__   s     m* ))++4466'+![/96%BBBUt?QUUVVV@Bt{'<===


    linestrc                    | j         J | j                             |                                           | j                             d           dS )z-Write a line to the output, adding a newline.N
)r    writerstrip)r&   r*   s     r'   r.   zSummaryReporter.write'   sJ    |'''4;;==)))4     r)   itemsIterable[str]c                V    |                      d                    |                     dS )z)Write a list of strings, joined together. N)r.   join)r&   r0   s     r'   write_itemszSummaryReporter.write_items-   s$    

2775>>"""""r)   header	list[str]lines_valueslist[list[Any]]
total_line	list[Any]	end_linesc           	       
 t          d |D             dgz             dz   t          t          |                    d                             dz   t          d                    dz   t          gfd|D             z             t          dd	d	d	d	d
d          

fdD             }d                    |          }dt          |          z  }|                     |           |                     |           
                    t          dd                     |D ]3}|                     
fdt          |          D                        4|r|                     |           |                     
fdt          |          D                        |D ]}	|                     |	           dS )a:  Internal method that prints report data in text format.

        `header` is a list with captions.
        `lines_values` is list of lists of sortable values.
        `total_line` is a list with values of the total line.
        `end_lines` is a list of ending lines with information about skipped files.

        c                8    g | ]}t          |d                    S )r   )len.0r*   s     r'   
<listcomp>z/SummaryReporter.report_text.<locals>.<listcomp>A   s"    >>>DG>>>r)         Cover   z Coverc                f    g | ]-}t          |                    d                              dz   .S )rE   rF   )r?   index)rA   r*   r6   s     r'   rB   z/SummaryReporter.report_text.<locals>.<listcomp>C   s7    ]]]s4W(=(=#>??!C]]]r)   z{:{name_len}}z{:>7}z{:>{n}}z{:>10}NameStmtsMissBranchBrPartrE   Missingc                L    g | ] }|                              |           !S name_lennr!   rA   itemformatsmax_nmax_names     r'   rB   z/SummaryReporter.report_text.<locals>.<listcomp>M   3    bbbSW,,TH,NNbbbr)   r3   -z{:>{n}}%z   {:9})rE   rO   c              3  z   K   | ]5\  }}|                              t          |          d z
            V  6dS rD   rR   Nr!   r+   rA   rW   valuerX   rY   rZ   s      r'   	<genexpr>z.SummaryReporter.report_text.<locals>.<genexpr>^   s_        #e DM((Uh%RS)(TT     r)   c              3  z   K   | ]5\  }}|                              t          |          d z
            V  6dS r^   r_   r`   s      r'   rb   z.SummaryReporter.report_text.<locals>.<genexpr>i   s^        D% $$SZZ(eai$PP     r)   N)	maxr?   rH   dictr4   r.   updater5   zip)r&   r6   r8   r:   r<   header_items
header_strrulevaluesend_linerX   rY   rZ   s    `        @@@r'   report_textzSummaryReporter.report_text1   s\     >>>>>!DEEIC
6<<#8#89::Q>HNNQRRUG]]]]P\]]]]^^ 
 
 
 cbbbbb[abbbWW\**
S__$ 	

:

4 	 !  	
 	
 	
 # 	 	F     '*66':':       	JJt     #&vz#:#:  	
 	
 	
 " 	! 	!HJJx    	! 	!r)   c           	        t          d |D             d          t          t          d                    dz   t          ddddddd	
          t          t          ||                    d                             dz   t          d                    fd|D             }d                    |          }dd                    d                    t          |d                   dz
  d          gd |dd         D             z             z   }|                     |           |                     |           |D ]V}                    t          d                     |                     fdt          ||          D                        W                    t          dd                     g }	t          ||          D ]B\  }
}|dk    r|}n|
dk    rd| d}nd| d}|	|
         
                    |          z  }	C|                     |	           |D ]}|                     |           dS )aT  Internal method that prints report data in markdown format.

        `header` is a list with captions.
        `lines_values` is a sorted list of lists containing coverage information.
        `total_line` is a list with values of the total line.
        `end_lines` is a list of ending lines with information about skipped files.

        c              3  h   K   | ]-}t          |d                              dd                    V  .dS )r   _\_N)r?   replacer@   s     r'   rb   z2SummaryReporter.report_markdown.<locals>.<genexpr>   s<      RRTDGOOC7788RRRRRRr)   r   )defaultz	**TOTAL**rD   z| {:{name_len}}|z{:>9} |z	{:>{n}} |z{:>10} |rI   rE      z Cover c                L    g | ] }|                              |           !S rQ   rU   rV   s     r'   rB   z3SummaryReporter.report_markdown.<locals>.<listcomp>   r[   r)   r3   | z- |r\   c                Z    g | ](}d                      t          |          dz
  d          )S )z-: |rD   r\   )rjustr?   )rA   rW   s     r'   rB   z3SummaryReporter.report_markdown.<locals>.<listcomp>   s0    MMMDv||CIIM3//MMMr)   Nz
{:>{n}}% |)rE   c              3     K   | ]I\  }}|                              t          |                              d d          dz
            V  JdS )rp   rq   rD   rR   N)r!   r+   rr   r`   s      r'   rb   z2SummaryReporter.report_markdown.<locals>.<genexpr>   sx         $e DM((E

**366UUVY )       r)   z|{:{name_len}} |)rJ   rE   z **z%**z**rR   )rd   r?   re   rH   r4   ry   r.   rf   r5   rg   r!   )r&   r6   r8   r:   r<   rh   ri   rule_strrk   total_line_itemsrW   ra   insertrl   rX   rY   rZ   s                 @@@r'   report_markdownzSummaryReporter.report_markdownr   s     RR\RRR\]^^^x[!1!122Q6#
 
 
 C
6<<#8#89::Q>IOObbbbbb[abbbWW\**
[[\!_--13778MML<LMMMN
 
 
 	

:

8 # 	 	FNN&    
       (+66':':	      	'!  	
 	
 	
 ')vz22 	Y 	YKD%{{)u)))(u 4 4VhRW 4 X XX)***! 	! 	!HJJx    	! 	!r)   Nmorfsr   r    IO[str] | Nonefloatc                   |pt           j        | _        | j                                                            | j        j                   t          | j        |          D ]\  }}| 	                    ||           | j
        j        s| j        st          d          | j        dk    r |                     | j
        j                   n|                                  | j
        j        S )zWrites a report summarizing coverage statistics per module.

        `outfile` is a text-mode file object to write the summary to.

        zNo data to report.r   )sysstdoutr    r   r   set_query_contextsr   report_contextsr   report_one_filer   n_filesr$   r	   r"   r.   pc_covered_strtabular_report
pc_covered)r&   r   r    franalysiss        r'   reportzSummaryReporter.report   s     ,#*  33DK4OPPP24=%HH 	/ 	/LB  X....z! 	4$*< 	42333((JJtz01111!!!z$$r)   c                   g d}| j         r|ddgz  }|dgz  }| j        j        r|dgz  }t          dddd	
          }| j         r$|                    t          dd                     g }| j        D ]\  }}|j        }|                                |j        |j	        g}| j         r||j
        |j        gz  }||j        gz  }| j        j        r||                    d          gz  }||j        gz  }|                    |           | j        j        pd                                }d}	|d         dk    rd}	|dd         }n|d         dk    r
|dd         }|                    |          t'          d| j        j                  |dk    rt)          ||	          }n|                    fd|	           d| j        j        | j        j	        g}
| j         r|
| j        j
        | j        j        gz  }
|
| j        j        gz  }
| j        j        r|
dgz  }
g }| j        j        r3| j        r,|                    dt1          | j        d           d           | j        j        r3| j        r,|                    dt1          | j        d           d           | j        d k    r| j        }n| j        } ||||
|           dS )!zWrites tabular report formats.)rJ   rK   rL   rM   rN   rE   rO   r   rD   rF   )namestmtsmisscover      )branchbrpartT)r   r   Fr\   N+zInvalid sorting option: )reversec                $    |          | d         fS )Nr    )r*   sort_idxs    r'   <lambda>z0SummaryReporter.tabular_report.<locals>.<lambda>   s    $x.$q'!: r)   )keyr   TOTALr3   r-   filez" skipped due to complete coverage.z
empty filez	 skipped.r   )r   r   show_missingre   rf   r#   numbersrelative_filenamen_statements	n_missing
n_branchesn_partial_branchesr   missing_formattedr   appendsortlowergetr   r
   r   skip_coveredr$   r   
skip_emptyr%   r"   r~   rm   )r&   r6   column_orderr8   r   r   numsargssort_optionr   r:   r<   	formatterr   s                @r'   r   zSummaryReporter.tabular_report   so    +**= 	+x**F7);# 	"yk!F!!2>>>= 	:Aa 8 8 8999  , 		& 		&LB#D((**D,=t~ND} C$*ABBT())D{' D33T3BBCCT_%%D%%%% {'1688::q>S  G%abb/KK^s""%abb/K##K00M9IMMNNN&  -lGLLLLL::::     tz6
8LM
= 	Q4:0$*2OPPJtz011
;# 	2$J 	;# 	(: 	[VD.77[[[   ;! 	Ud&6 	US&)9<"H"HSSSTTT++,II(I	&,
I>>>>>r)   r   r   r   r   c                .   |j         }| xj        |z  c_        |j        dk    }|j        dk    }| j        j        r|r|r| xj        dz  c_        dS | j        j        r|j        dk    r| xj	        dz  c_	        dS | j
                            ||f           dS )z4Report on just one file, the callback from report().r   rD   N)r   r   r   r   r   r   r$   r   r   r%   r#   r   )r&   r   r   r   no_missing_linesno_missing_branchess         r'   r   zSummaryReporter.report_one_file  s    

d

 Na/#6!;;# 	4(8 	4=P 	4!#[# 	4(9Q(>(>!##RN33333r)   )r   r   r   r   )r*   r+   r   r   )r0   r1   r   r   )
r6   r7   r8   r9   r:   r;   r<   r7   r   r   )N)r   r   r    r   r   r   )r   r   )r   r   r   r   r   r   )__name__
__module____qualname____doc__r(   r.   r5   rm   r~   r   r   r   r   r)   r'   r   r      s        44> > > >! ! ! !# # # #?! ?! ?! ?!BJ! J! J! J!X% % % % %,D? D? D? D?L4 4 4 4 4 4r)   r   )r   
__future__r   r   collections.abcr   typingr   r   r   coverage.exceptionsr   r	   coverage.miscr
   r   coverage.pluginr   coverage.report_corer   coverage.resultsr   r   coverage.typesr   r   r   r   r   r)   r'   <module>r      s,     " " " " " " 



 $ $ $ $ $ $ ) ) ) ) ) ) ) ) ) ) 8 8 8 8 8 8 8 8 4 4 4 4 4 4 4 4 ( ( ( ( ( ( 7 7 7 7 7 7 . . . . . . . . ! ! ! ! ! ! "!!!!!!Q4 Q4 Q4 Q4 Q4 Q4 Q4 Q4 Q4 Q4r)   