diff options
author | Ned Batchelder <ned@nedbatchelder.com> | 2015-01-01 06:48:18 -0500 |
---|---|---|
committer | Ned Batchelder <ned@nedbatchelder.com> | 2015-01-01 06:48:18 -0500 |
commit | 3699416b508085a8fc1e7fa77ed6fe6c219617f0 (patch) | |
tree | ae0c92d33c65607f0a504746c853611e164413e7 /coverage/plugin.py | |
parent | 1440b69fab484580404be21101179b7fc7a02057 (diff) | |
download | python-coveragepy-git-3699416b508085a8fc1e7fa77ed6fe6c219617f0.tar.gz |
Move Plugins so that plugin.py is just interface definitions
Diffstat (limited to 'coverage/plugin.py')
-rw-r--r-- | coverage/plugin.py | 37 |
1 files changed, 0 insertions, 37 deletions
diff --git a/coverage/plugin.py b/coverage/plugin.py index 7d67762a..a0a65e44 100644 --- a/coverage/plugin.py +++ b/coverage/plugin.py @@ -128,40 +128,3 @@ class FileReporter(object): """Support needed for files during the reporting phase.""" def __init__(self, filename): self.filename = filename - - -class Plugins(object): - """The currently loaded collection of coverage.py plugins.""" - - def __init__(self): - self.order = [] - self.names = {} - - @classmethod - def load_plugins(cls, modules, config): - """Load plugins from `modules`. - - Returns a list of loaded and configured plugins. - - """ - plugins = cls() - - for module in modules: - __import__(module) - mod = sys.modules[module] - - plugin_class = getattr(mod, "Plugin", None) - if plugin_class: - options = config.get_plugin_options(module) - plugin = plugin_class(options) - plugin.plugin_name = module - plugins.order.append(plugin) - plugins.names[module] = plugin - - return plugins - - def __iter__(self): - return iter(self.order) - - def get(self, module): - return self.names[module] |