diff options
| author | Barry Warsaw | 2009-01-16 21:04:21 -0500 |
|---|---|---|
| committer | Barry Warsaw | 2009-01-16 21:04:21 -0500 |
| commit | ae3d0cc316b826b8325507d960ccf84da601c3b0 (patch) | |
| tree | 3485e2ca463c2131a0ffb1693bc60d569cc9d8b7 /mailman/core/plugins.py | |
| parent | a3f7d07c62b2f7d6ac9d0b700883826c2838db60 (diff) | |
| download | mailman-ae3d0cc316b826b8325507d960ccf84da601c3b0.tar.gz mailman-ae3d0cc316b826b8325507d960ccf84da601c3b0.tar.zst mailman-ae3d0cc316b826b8325507d960ccf84da601c3b0.zip | |
Diffstat (limited to 'mailman/core/plugins.py')
| -rw-r--r-- | mailman/core/plugins.py | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/mailman/core/plugins.py b/mailman/core/plugins.py index cce95fddd..e9ba26571 100644 --- a/mailman/core/plugins.py +++ b/mailman/core/plugins.py @@ -17,6 +17,13 @@ """Get a requested plugin.""" +from __future__ import absolute_import, unicode_literals + +__metaclass__ = type +__all__ = [ + ] + + import pkg_resources @@ -36,7 +43,8 @@ def get_plugin(group): """ entry_points = list(pkg_resources.iter_entry_points(group)) if len(entry_points) == 0: - raise RuntimeError('No entry points found for group: %s' % group) + raise RuntimeError( + 'No entry points found for group: {0}'.format(group)) elif len(entry_points) == 1: # Okay, this is the one to use. return entry_points[0].load() @@ -44,14 +52,15 @@ def get_plugin(group): # Find the one /not/ named 'stock'. entry_points = [ep for ep in entry_points if ep.name <> 'stock'] if len(entry_points) == 0: - raise RuntimeError('No stock plugin found for group: %s' % group) + raise RuntimeError( + 'No stock plugin found for group: {0}'.format(group)) elif len(entry_points) == 2: raise RuntimeError('Too many stock plugins defined') else: raise AssertionError('Insanity') return entry_points[0].load() else: - raise RuntimeError('Too many plugins for group: %s' % group) + raise RuntimeError('Too many plugins for group: {0}'.format(group)) |
