diff options
| author | Barry Warsaw | 2012-07-06 21:08:41 -0400 |
|---|---|---|
| committer | Barry Warsaw | 2012-07-06 21:08:41 -0400 |
| commit | 8d8ab1655b51e277570005b445d3b014afcfbc57 (patch) | |
| tree | 6ba0147d975636e129a787c9dfa64dae8cffae89 /src/mailman/chains/base.py | |
| parent | cd3f84b301c2150fea5402129a2e7bc862fbb52b (diff) | |
| parent | 01415190ab44e69a8f09a6411564a7cb288404e8 (diff) | |
| download | mailman-8d8ab1655b51e277570005b445d3b014afcfbc57.tar.gz mailman-8d8ab1655b51e277570005b445d3b014afcfbc57.tar.zst mailman-8d8ab1655b51e277570005b445d3b014afcfbc57.zip | |
Diffstat (limited to 'src/mailman/chains/base.py')
| -rw-r--r-- | src/mailman/chains/base.py | 26 |
1 files changed, 6 insertions, 20 deletions
diff --git a/src/mailman/chains/base.py b/src/mailman/chains/base.py index 8a2e87ee2..d317bf803 100644 --- a/src/mailman/chains/base.py +++ b/src/mailman/chains/base.py @@ -17,18 +17,17 @@ """Base class for terminal chains.""" -from __future__ import absolute_import, unicode_literals +from __future__ import absolute_import, print_function, unicode_literals __metaclass__ = type __all__ = [ 'Chain', - 'ChainNotification', 'Link', 'TerminalChainBase', ] -from zope.interface import implements +from zope.interface import implementer from mailman.config import config from mailman.interfaces.chain import ( @@ -36,9 +35,9 @@ from mailman.interfaces.chain import ( +@implementer(IChainLink) class Link: """A chain link.""" - implements(IChainLink) def __init__(self, rule, action=None, chain=None, function=None): self.rule = rule @@ -61,13 +60,12 @@ class Link: +@implementer(IChain, IChainIterator) class TerminalChainBase: """A base chain that always matches and executes a method. The method is called '_process()' and must be provided by the subclass. """ - implements(IChain, IChainIterator) - def _process(self, mlist, msg, msgdata): """Process the message for the given mailing list. @@ -93,9 +91,9 @@ class TerminalChainBase: +@implementer(IMutableChain) class Chain: """Generic chain base class.""" - implements(IMutableChain) def __init__(self, name, description): assert name not in config.chains, ( @@ -125,25 +123,13 @@ class Chain: +@implementer(IChainIterator) class ChainIterator: """Generic chain iterator.""" - implements(IChainIterator) - def __init__(self, chain): self._chain = chain def __iter__(self): """See `IChainIterator`.""" return self._chain.get_iterator() - - - -class ChainNotification: - """Base class for chain notification events.""" - - def __init__(self, mlist, msg, msgdata, chain): - self.mlist = mlist - self.msg = msg - self.msgdata = msgdata - self.chain = chain |
