diff options
author | Ned Batchelder <ned@nedbatchelder.com> | 2009-04-19 00:07:08 -0400 |
---|---|---|
committer | Ned Batchelder <ned@nedbatchelder.com> | 2009-04-19 00:07:08 -0400 |
commit | 6252a36d160321d11e0d52f2ad6b6255ef265f6a (patch) | |
tree | e582d834d0b4445197978ddb8e1f9415cba88a50 /coverage/data.py | |
parent | 3e9f23a67d8f7553e6fdd0ab09d7c209f75fd413 (diff) | |
download | python-coveragepy-git-6252a36d160321d11e0d52f2ad6b6255ef265f6a.tar.gz |
More docstrings.
Diffstat (limited to 'coverage/data.py')
-rw-r--r-- | coverage/data.py | 26 |
1 files changed, 17 insertions, 9 deletions
diff --git a/coverage/data.py b/coverage/data.py index 721f9c0f..7e9d49fb 100644 --- a/coverage/data.py +++ b/coverage/data.py @@ -3,16 +3,18 @@ import os, types import cPickle as pickle -# Data file format is a pickled dict, with these keys: -# -# collector: a string identifying the collecting software -# -# lines: a dict mapping filenames to lists of line numbers executed: -# { 'file1': [17,23,45], 'file2': [1,2,3], ... } - - class CoverageData: - """Manages collected coverage data.""" + """Manages collected coverage data, including file storage. + + The data file format is a pickled dict, with these keys: + + * collector: a string identifying the collecting software + + * lines: a dict mapping filenames to lists of line numbers executed: + { 'file1': [17,23,45], 'file2': [1,2,3], ... } + + """ + # Name of the data file (unless environment variable is set). filename_default = ".coverage" @@ -20,7 +22,11 @@ class CoverageData: filename_env = "COVERAGE_FILE" def __init__(self, collector=None): + """Create a CoverageData. + + `collector` is a string describing the coverage measurement software. + """ self.collector = collector self.use_file = True @@ -103,6 +109,8 @@ class CoverageData: fdata.close() def read_file(self, filename): + """Read the coverage data from `filename`.""" + self.lines = self._read_file(filename) def _read_file(self, filename): |