summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/mailman/core/pipelines.py17
-rw-r--r--src/mailman/pipeline/__init__.py4
2 files changed, 10 insertions, 11 deletions
diff --git a/src/mailman/core/pipelines.py b/src/mailman/core/pipelines.py
index 8aae5cc25..aae3f11dd 100644
--- a/src/mailman/core/pipelines.py
+++ b/src/mailman/core/pipelines.py
@@ -30,10 +30,10 @@ from zope.interface import implements
from zope.interface.verify import verifyObject
from mailman.config import config
-from mailman.core.plugins import get_plugins
from mailman.i18n import _
from mailman.interfaces.handler import IHandler
from mailman.interfaces.pipeline import IPipeline
+from mailman.pipeline import builtin_handlers
@@ -111,14 +111,13 @@ class VirginPipeline(BasePipeline):
def initialize():
"""Initialize the pipelines."""
# Find all handlers in the registered plugins.
- for handler_finder in get_plugins('mailman.handlers'):
- for handler_class in handler_finder():
- handler = handler_class()
- verifyObject(IHandler, handler)
- assert handler.name not in config.handlers, (
- 'Duplicate handler "{0}" found in {1}'.format(
- handler.name, handler_finder))
- config.handlers[handler.name] = handler
+ for handler_class in builtin_handlers():
+ handler = handler_class()
+ verifyObject(IHandler, handler)
+ assert handler.name not in config.handlers, (
+ 'Duplicate handler "{0}" found in {1}'.format(
+ handler.name, handler_finder))
+ config.handlers[handler.name] = handler
# Set up some pipelines.
for pipeline_class in (BuiltInPipeline, VirginPipeline):
pipeline = pipeline_class()
diff --git a/src/mailman/pipeline/__init__.py b/src/mailman/pipeline/__init__.py
index f73061874..a50025a44 100644
--- a/src/mailman/pipeline/__init__.py
+++ b/src/mailman/pipeline/__init__.py
@@ -21,7 +21,7 @@ from __future__ import absolute_import, unicode_literals
__metaclass__ = type
__all__ = [
- 'initialize',
+ 'builtin_handlers',
]
@@ -32,7 +32,7 @@ from mailman.interfaces.handler import IHandler
-def initialize():
+def builtin_handlers():
"""Initialize the built-in handlers.
Rules are auto-discovered by searching for IHandler implementations in all