diff options
| author | Barry Warsaw | 2016-03-24 21:29:30 -0400 |
|---|---|---|
| committer | Barry Warsaw | 2016-03-24 21:29:30 -0400 |
| commit | 5404f98d90410d69a744d9c0fb71a8a31f3a4a88 (patch) | |
| tree | beb5010e4d74ab0f8056419dc05058fc2bbd8cc6 /src/mailman/interfaces/pipeline.py | |
| parent | a0cf7d44cbf0527d8bac05f870208a85689da42f (diff) | |
| download | mailman-5404f98d90410d69a744d9c0fb71a8a31f3a4a88.tar.gz mailman-5404f98d90410d69a744d9c0fb71a8a31f3a4a88.tar.zst mailman-5404f98d90410d69a744d9c0fb71a8a31f3a4a88.zip | |
Diffstat (limited to 'src/mailman/interfaces/pipeline.py')
| -rw-r--r-- | src/mailman/interfaces/pipeline.py | 36 |
1 files changed, 31 insertions, 5 deletions
diff --git a/src/mailman/interfaces/pipeline.py b/src/mailman/interfaces/pipeline.py index b8830b003..5e39c2a3e 100644 --- a/src/mailman/interfaces/pipeline.py +++ b/src/mailman/interfaces/pipeline.py @@ -17,15 +17,41 @@ """Interface for describing pipelines.""" -__all__ = [ - 'IPipeline', - ] +from mailman import public +from zope.interface import Interface, Attribute -from zope.interface import Interface, Attribute +# For i18n extraction. +def _(s): + return s + + +# These are thrown but they aren't exceptions so don't inherit from +# mailman.interfaces.errors.MailmanError. Python requires that they inherit +# from BaseException. +@public +class DiscardMessage(BaseException): + """The message can be discarded with no further action""" + + def __init__(self, message=None): + self.message = message + + def __str__(self): + return self.message + + +@public +class RejectMessage(BaseException): + """The message will be bounced back to the sender""" + + def __init__(self, message=None): + self.message = message + + def __str__(self): + return self.message - +@public class IPipeline(Interface): """A pipeline of handlers.""" |
