summaryrefslogtreecommitdiff
path: root/src/mailman/core/chains.py
diff options
context:
space:
mode:
authorBarry Warsaw2017-06-17 03:33:38 +0000
committerBarry Warsaw2017-06-17 03:33:38 +0000
commit88f40ac0add14cc9e7c106c5e2e9ec3d6f73df6e (patch)
tree9bc9cef4a696639654185709c1143924b1d41f43 /src/mailman/core/chains.py
parent4fdad6f9c8a9487a6f2c8462be734cd97aaf4d94 (diff)
downloadmailman-88f40ac0add14cc9e7c106c5e2e9ec3d6f73df6e.tar.gz
mailman-88f40ac0add14cc9e7c106c5e2e9ec3d6f73df6e.tar.zst
mailman-88f40ac0add14cc9e7c106c5e2e9ec3d6f73df6e.zip
Diffstat (limited to 'src/mailman/core/chains.py')
-rw-r--r--src/mailman/core/chains.py20
1 files changed, 2 insertions, 18 deletions
diff --git a/src/mailman/core/chains.py b/src/mailman/core/chains.py
index 0eedd8b8c..c251d38bc 100644
--- a/src/mailman/core/chains.py
+++ b/src/mailman/core/chains.py
@@ -17,12 +17,10 @@
"""Application support for chain processing."""
-from mailman.chains.base import Chain, TerminalChainBase
from mailman.config import config
from mailman.interfaces.chain import IChain, LinkAction
-from mailman.utilities.modules import find_components
+from mailman.utilities.modules import add_components
from public import public
-from zope.interface.verify import verifyObject
@public
@@ -91,19 +89,5 @@ def process(mlist, msg, msgdata, start_chain='default-posting-chain'):
@public
def initialize():
"""Set up chains, both built-in and from the database."""
- for chain_class in find_components('mailman.chains', IChain):
- # FIXME 2010-12-28 barry: We need a generic way to disable automatic
- # instantiation of discovered classes. This is useful not just for
- # chains, but also for rules, handlers, etc. Ideally it should be
- # part of find_components(). For now, hard code the ones we do not
- # want to instantiate.
- if chain_class in (Chain, TerminalChainBase):
- continue
- chain = chain_class()
- verifyObject(IChain, chain)
- assert chain.name not in config.chains, (
- 'Duplicate chain "{}" found in {} (previously: {}'.format(
- chain.name, chain_class, config.chains[chain.name]))
- config.chains[chain.name] = chain
+ add_components('mailman.chains', IChain, config.chains)
# XXX Read chains from the database and initialize them.
- pass