diff options
author | Ned Batchelder <ned@nedbatchelder.com> | 2014-10-11 08:06:17 -0400 |
---|---|---|
committer | Ned Batchelder <ned@nedbatchelder.com> | 2014-10-11 08:06:17 -0400 |
commit | ef25f573bf2166e437495a6e152e08b0efdeed52 (patch) | |
tree | 2442ac6956819730d978b50f32505d9348817ef7 /coverage/config.py | |
parent | 38c02cc781e8de703cac6df7227e33c4f93c904a (diff) | |
download | python-coveragepy-ef25f573bf2166e437495a6e152e08b0efdeed52.tar.gz |
Can change config after construction.
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 ece68ba..f262a04 100644 --- a/coverage/config.py +++ b/coverage/config.py @@ -266,3 +266,18 @@ class CoverageConfig(object): def get_plugin_options(self, plugin): """Get a dictionary of options for the plugin named `plugin`.""" return self.plugin_options.get(plugin, {}) + + # TODO: docs for this. + def __setitem__(self, names, value): + for option_spec in self.CONFIG_FILE_OPTIONS: + attr, where = option_spec[:2] + if where == names: + setattr(self, attr, value) + return + + # TODO: docs for this. + def __getitem__(self, names): + for option_spec in self.CONFIG_FILE_OPTIONS: + attr, where = option_spec[:2] + if where == names: + return getattr(self, attr) |