diff options
| author | Barry Warsaw | 2017-06-17 03:33:39 +0000 |
|---|---|---|
| committer | Barry Warsaw | 2017-06-17 03:33:39 +0000 |
| commit | 66559bacf1dbfa166c2d4c2596ea96c7909bb43c (patch) | |
| tree | 9bc9cef4a696639654185709c1143924b1d41f43 /src/mailman/core/chains.py | |
| parent | 4fdad6f9c8a9487a6f2c8462be734cd97aaf4d94 (diff) | |
| parent | 88f40ac0add14cc9e7c106c5e2e9ec3d6f73df6e (diff) | |
| download | mailman-66559bacf1dbfa166c2d4c2596ea96c7909bb43c.tar.gz mailman-66559bacf1dbfa166c2d4c2596ea96c7909bb43c.tar.zst mailman-66559bacf1dbfa166c2d4c2596ea96c7909bb43c.zip | |
Diffstat (limited to 'src/mailman/core/chains.py')
| -rw-r--r-- | src/mailman/core/chains.py | 20 |
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 |
