diff options
author | Ned Batchelder <ned@nedbatchelder.com> | 2009-11-28 22:06:57 -0500 |
---|---|---|
committer | Ned Batchelder <ned@nedbatchelder.com> | 2009-11-28 22:06:57 -0500 |
commit | 3416380e8e46d839c3111d9f82a5f7d93a218821 (patch) | |
tree | 4dd1705724030fe973bf9b74a84e8132b5bf4149 /coverage/config.py | |
parent | b8b1aaed4d6eaeb8cab1afa2449863fe2bd91313 (diff) | |
download | python-coveragepy-git-3416380e8e46d839c3111d9f82a5f7d93a218821.tar.gz |
Docstrings for the new file.
--HG--
branch : config
Diffstat (limited to 'coverage/config.py')
-rw-r--r-- | coverage/config.py | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/coverage/config.py b/coverage/config.py index 125121b8..d779048c 100644 --- a/coverage/config.py +++ b/coverage/config.py @@ -5,7 +5,15 @@ from coverage.backward import configparser # pylint: disable-msg=W0622 class CoverageConfig(object): + """Coverage.py configuration. + + The attributes of this class are the various settings that control the + operation of coverage.py. + + """ + def __init__(self): + """Initialize the configuration attributes to their defaults.""" # Defaults. self.cover_pylib = False self.timid = False @@ -14,6 +22,7 @@ class CoverageConfig(object): self.data_file = ".coverage" def from_environment(self, env_var): + """Read configuration from the `env_var` environment variable.""" # Timidity: for nose users, read an environment variable. This is a # cheap hack, since the rest of the command line arguments aren't # recognized, but it solves some users' problems. @@ -22,11 +31,17 @@ class CoverageConfig(object): self.timid = ('--timid' in env) def from_args(self, **kwargs): + """Read config values from `kwargs`.""" for k, v in kwargs.items(): if v is not None: setattr(self, k, v) def from_file(self, *files): + """Read configurating from .rc files. + + Each argument in `files` is a file name to read. + + """ cp = configparser.RawConfigParser() cp.read(files) |