o
    ícZ4  ã                   @   sX   d Z ddlZddlZddlmZmZ ddlmZmZm	Z	m
Z
 e
eƒZG dd„ deƒZdS )z$Reporter foundation for coverage.py.é    N)Úprep_patternsÚFnmatchMatcher)ÚCoverageExceptionÚNoSourceÚ	NotPythonÚisolate_modulec                   @   s6   e Zd ZdZdd„ Zedd„ ƒZdd„ Zdd	d
„ZdS )ÚReporterzA base class for all reporters.c                 C   s   || _ || _d| _g | _dS )z¥Create a reporter.

        `coverage` is the coverage instance. `config` is an instance  of
        CoverageConfig, for controlling all sorts of behavior.

        N)ÚcoverageÚconfigÚ	directoryÚ_file_reporters)Úselfr	   r
   © r   úA/var/www/html/env/lib/python3.10/site-packages/coverage/report.pyÚ__init__   s   
zReporter.__init__c                 C   s   t  dt¡ | jS )z8Keep .file_reporters working for private-grabbing tools.zDReport.file_reporters will no longer be available in Coverage.py 4.2)ÚwarningsÚwarnÚDeprecationWarningr   )r   r   r   r   Úfile_reporters&   s
   þzReporter.file_reportersc                    sp   | j  |¡}| jjrtt| jjƒƒ‰ ‡ fdd„|D ƒ}| jjr0tt| jjƒƒ‰ ‡ fdd„|D ƒ}t|ƒ| _| jS )z�Find the FileReporters we'll report on.

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

        Returns a list of FileReporters.

        c                    s   g | ]
}ˆ   |j¡r|‘qS r   ©ÚmatchÚfilename©Ú.0Úfr©Úmatcherr   r   Ú
<listcomp>;   ó    z0Reporter.find_file_reporters.<locals>.<listcomp>c                    s   g | ]
}ˆ   |j¡s|‘qS r   r   r   r   r   r   r   ?   r   )	r	   Ú_get_file_reportersr
   Úreport_includer   r   Úreport_omitÚsortedr   )r   ÚmorfsÚ	reportersr   r   r   Úfind_file_reporters/   s   
zReporter.find_file_reportersNc              	   C   s´   |   |¡}|stdƒ‚|| _| jrtj | j¡st | j¡ |D ]7}z||| j |¡ƒ W q  t	y;   | j
js9‚ Y q  tyW   | ¡ rU| j
jrT| j d |j¡¡ n‚ Y q w dS )a?  Run a reporting function on a number of morfs.

        `report_fn` is called for each relative morf in `morfs`.  It is called
        as::

            report_fn(file_reporter, analysis)

        where `file_reporter` is the `FileReporter` for the morf, and
        `analysis` is the `Analysis` for the morf.

        zNo data to report.zCould not parse Python file {0}N)r%   r   r   ÚosÚpathÚexistsÚmakedirsr	   Ú_analyzer   r
   Úignore_errorsr   Úshould_be_pythonÚ_warnÚformatr   )r   Ú	report_fnr#   r   r   r   r   r   r   Úreport_filesD   s*   
ÿ€÷úzReporter.report_files)N)	Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   Úpropertyr   r%   r0   r   r   r   r   r      s    
r   )r4   r&   r   Úcoverage.filesr   r   Úcoverage.miscr   r   r   r   Úobjectr   r   r   r   r   Ú<module>   s   