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 | 663aa0e5d53a8dcd8cd6ed76e2fa662925b99ea7 (patch) | |
tree | 608eb69e619323181f190169765a0505cc212547 /coverage/plugin.py | |
parent | 0ba8f11a359ae1d525688b488bab0c06c9dfe518 (diff) | |
download | python-coveragepy-663aa0e5d53a8dcd8cd6ed76e2fa662925b99ea7.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 7d67762..a0a65e4 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] |