1 # Copyright (C) 2008-2016 by the Free Software Foundation, Inc.
3 # This file is part of GNU Mailman.
5 # GNU Mailman is free software: you can redistribute it and/or modify it under
6 # the terms of the GNU General Public License as published by the Free
7 # Software Foundation, either version 3 of the License, or (at your option)
10 # GNU Mailman is distributed in the hope that it will be useful, but WITHOUT
11 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12 # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
15 # You should have received a copy of the GNU General Public License along with
16 # GNU Mailman. If not, see <http://www.gnu.org/licenses/>.
18 """Interface for describing pipelines."""
20 from mailman
import public
21 from zope
.interface
import Attribute
, Interface
24 # For i18n extraction.
29 # These are thrown but they aren't exceptions so don't inherit from
30 # mailman.interfaces.errors.MailmanError. Python requires that they inherit
33 class DiscardMessage(BaseException
):
34 """The message can be discarded with no further action"""
36 def __init__(self
, message
=None):
37 self
.message
= message
44 class RejectMessage(BaseException
):
45 """The message will be bounced back to the sender"""
47 def __init__(self
, message
=None):
48 self
.message
= message
55 class IPipeline(Interface
):
56 """A pipeline of handlers."""
58 name
= Attribute('Pipeline name; must be unique.')
59 description
= Attribute('A brief description of this pipeline.')
62 """Iterate over all the handlers in this pipeline."""