summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBarry Warsaw2009-03-09 23:49:20 -0400
committerBarry Warsaw2009-03-09 23:49:20 -0400
commit7717440e877660072fe1bd5f3771b0d110b5ff9b (patch)
tree6dad041003c017741d11810b63715b6fe84fa4c3
parent11eb3395ad1f7c9f6699f96c33ca0543c2f83220 (diff)
downloadmailman-7717440e877660072fe1bd5f3771b0d110b5ff9b.tar.gz
mailman-7717440e877660072fe1bd5f3771b0d110b5ff9b.tar.zst
mailman-7717440e877660072fe1bd5f3771b0d110b5ff9b.zip
Get rid of the mailman.handlers entry point.
-rw-r--r--setup.py1
-rw-r--r--src/mailman/core/pipelines.py17
-rw-r--r--src/mailman/pipeline/__init__.py4
3 files changed, 10 insertions, 12 deletions
diff --git a/setup.py b/setup.py
index d41394ea8..38da5bc0b 100644
--- a/setup.py
+++ b/setup.py
@@ -86,7 +86,6 @@ case second `m'. Any other spelling is incorrect.""",
include_package_data = True,
entry_points = {
'console_scripts' : list(scripts),
- 'mailman.handlers' : 'default = mailman.pipeline:initialize',
'mailman.rules' : 'default = mailman.rules:initialize',
'mailman.scrubber' : 'stock = mailman.archiving.pipermail:Pipermail',
},
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