summaryrefslogtreecommitdiff
path: root/src/mailman/core
diff options
context:
space:
mode:
authorBarry Warsaw2009-03-29 15:40:22 -0500
committerBarry Warsaw2009-03-29 15:40:22 -0500
commit5388a2358749a1774bb801e6e6839c1798998a1f (patch)
tree6bf6f2a10f1f1f588d5ca6d2f4c8ec8e6530cb4a /src/mailman/core
parentf90c651d85050b9ad3b33bdf210672452d2ba1f0 (diff)
downloadmailman-5388a2358749a1774bb801e6e6839c1798998a1f.tar.gz
mailman-5388a2358749a1774bb801e6e6839c1798998a1f.tar.zst
mailman-5388a2358749a1774bb801e6e6839c1798998a1f.zip
Add argparse 'cause I think this might end up being cool.
Refactor the finding of components so that it's much easier to find and register the ones that come with Mailman by default. Move all the old cmd_*.py commands into the attic. These will eventually be ported to the new framework.
Diffstat (limited to 'src/mailman/core')
-rw-r--r--src/mailman/core/pipelines.py4
-rw-r--r--src/mailman/core/rules.py4
2 files changed, 4 insertions, 4 deletions
diff --git a/src/mailman/core/pipelines.py b/src/mailman/core/pipelines.py
index aae3f11dd..cdfd1a462 100644
--- a/src/mailman/core/pipelines.py
+++ b/src/mailman/core/pipelines.py
@@ -29,11 +29,11 @@ __all__ = [
from zope.interface import implements
from zope.interface.verify import verifyObject
+from mailman.app.finder import find_components
from mailman.config import config
from mailman.i18n import _
from mailman.interfaces.handler import IHandler
from mailman.interfaces.pipeline import IPipeline
-from mailman.pipeline import builtin_handlers
@@ -111,7 +111,7 @@ class VirginPipeline(BasePipeline):
def initialize():
"""Initialize the pipelines."""
# Find all handlers in the registered plugins.
- for handler_class in builtin_handlers():
+ for handler_class in find_components('mailman.pipeline', IHandler):
handler = handler_class()
verifyObject(IHandler, handler)
assert handler.name not in config.handlers, (
diff --git a/src/mailman/core/rules.py b/src/mailman/core/rules.py
index 82ae4c89b..587733d5e 100644
--- a/src/mailman/core/rules.py
+++ b/src/mailman/core/rules.py
@@ -27,16 +27,16 @@ __all__ = [
from zope.interface.verify import verifyObject
+from mailman.app.finder import find_components
from mailman.config import config
from mailman.interfaces.rules import IRule
-from mailman.rules import builtin_rules
def initialize():
"""Find and register all rules in all plugins."""
# Find rules in plugins.
- for rule_class in builtin_rules():
+ for rule_class in find_components('mailman.rules', IRule):
rule = rule_class()
verifyObject(IRule, rule)
assert rule.name not in config.rules, (