X7ROOT File Manager
Current Path:
/usr/lib64/python2.7/site-packages/coverage
usr
/
lib64
/
python2.7
/
site-packages
/
coverage
/
📁
..
📄
__init__.py
(4.4 KB)
📄
__init__.pyc
(2.29 KB)
📄
__init__.pyo
(2.29 KB)
📄
__main__.py
(100 B)
📄
__main__.pyc
(308 B)
📄
__main__.pyo
(308 B)
📄
annotate.py
(2.92 KB)
📄
annotate.pyc
(3.1 KB)
📄
annotate.pyo
(3.1 KB)
📄
backward.py
(3.97 KB)
📄
backward.pyc
(4.3 KB)
📄
backward.pyo
(4.3 KB)
📄
bytecode.py
(2.27 KB)
📄
bytecode.pyc
(3.29 KB)
📄
bytecode.pyo
(3.29 KB)
📄
cmdline.py
(24.16 KB)
📄
cmdline.pyc
(20.01 KB)
📄
cmdline.pyo
(19.96 KB)
📄
codeunit.py
(4.34 KB)
📄
codeunit.pyc
(5.19 KB)
📄
codeunit.pyo
(5.19 KB)
📄
collector.py
(12.7 KB)
📄
collector.pyc
(9.14 KB)
📄
collector.pyo
(9.08 KB)
📄
config.py
(6.86 KB)
📄
config.pyc
(7.67 KB)
📄
config.pyo
(7.67 KB)
📄
control.py
(26.58 KB)
📄
control.pyc
(21.95 KB)
📄
control.pyo
(21.95 KB)
📄
data.py
(8.63 KB)
📄
data.pyc
(9.65 KB)
📄
data.pyo
(9.65 KB)
📄
execfile.py
(4.78 KB)
📄
execfile.pyc
(3.45 KB)
📄
execfile.pyo
(3.45 KB)
📄
files.py
(9.8 KB)
📄
files.pyc
(10.62 KB)
📄
files.pyo
(10.62 KB)
📄
html.py
(11.84 KB)
📄
html.pyc
(11.24 KB)
📄
html.pyo
(11.15 KB)
📁
htmlfiles
📄
misc.py
(4.08 KB)
📄
misc.pyc
(6.13 KB)
📄
misc.pyo
(6.13 KB)
📄
parser.py
(23.65 KB)
📄
parser.pyc
(17.16 KB)
📄
parser.pyo
(17 KB)
📄
phystokens.py
(7.07 KB)
📄
phystokens.pyc
(5.3 KB)
📄
phystokens.pyo
(5.24 KB)
📄
report.py
(2.96 KB)
📄
report.pyc
(2.86 KB)
📄
report.pyo
(2.86 KB)
📄
results.py
(8.86 KB)
📄
results.pyc
(9.29 KB)
📄
results.pyo
(9.23 KB)
📄
summary.py
(2.9 KB)
📄
summary.pyc
(2.88 KB)
📄
summary.pyo
(2.88 KB)
📄
templite.py
(5.57 KB)
📄
templite.pyc
(4.8 KB)
📄
templite.pyo
(4.61 KB)
📄
tracer.so
(15.91 KB)
📄
version.py
(336 B)
📄
version.pyc
(361 B)
📄
version.pyo
(361 B)
📄
xmlreport.py
(5.57 KB)
📄
xmlreport.pyc
(4.86 KB)
📄
xmlreport.pyo
(4.86 KB)
Editing: report.py
"""Reporter foundation for Coverage.""" import fnmatch, os from coverage.codeunit import code_unit_factory from coverage.files import prep_patterns from coverage.misc import CoverageException, NoSource, NotPython class Reporter(object): """A base class for all reporters.""" def __init__(self, coverage, config): """Create a reporter. `coverage` is the coverage instance. `config` is an instance of CoverageConfig, for controlling all sorts of behavior. """ self.coverage = coverage self.config = config # The code units to report on. Set by find_code_units. self.code_units = [] # The directory into which to place the report, used by some derived # classes. self.directory = None def find_code_units(self, morfs): """Find the code units we'll report on. `morfs` is a list of modules or filenames. """ morfs = morfs or self.coverage.data.measured_files() file_locator = self.coverage.file_locator self.code_units = code_unit_factory(morfs, file_locator) if self.config.include: patterns = prep_patterns(self.config.include) filtered = [] for cu in self.code_units: for pattern in patterns: if fnmatch.fnmatch(cu.filename, pattern): filtered.append(cu) break self.code_units = filtered if self.config.omit: patterns = prep_patterns(self.config.omit) filtered = [] for cu in self.code_units: for pattern in patterns: if fnmatch.fnmatch(cu.filename, pattern): break else: filtered.append(cu) self.code_units = filtered self.code_units.sort() def report_files(self, report_fn, morfs, directory=None): """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(code_unit, analysis) where `code_unit` is the `CodeUnit` for the morf, and `analysis` is the `Analysis` for the morf. """ self.find_code_units(morfs) if not self.code_units: raise CoverageException("No data to report.") self.directory = directory if self.directory and not os.path.exists(self.directory): os.makedirs(self.directory) for cu in self.code_units: try: report_fn(cu, self.coverage._analyze(cu)) except NoSource: if not self.config.ignore_errors: raise except NotPython: # Only report errors for .py files, and only if we didn't # explicitly suppress those errors. if cu.should_be_python() and not self.config.ignore_errors: raise
Upload File
Create Folder