summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/mailman/app/moderator.py2
-rw-r--r--src/mailman/docs/requests.txt4
-rw-r--r--src/mailman/interfaces/__init__.py44
-rw-r--r--src/mailman/interfaces/action.py33
-rw-r--r--src/mailman/interfaces/nntp.py34
-rw-r--r--src/mailman/queue/docs/news.txt4
-rw-r--r--src/mailman/queue/news.py2
-rw-r--r--src/mailman/rules/docs/news-moderation.txt6
-rw-r--r--src/mailman/rules/news_moderation.py2
-rw-r--r--src/mailman/styles/default.py3
10 files changed, 79 insertions, 55 deletions
diff --git a/src/mailman/app/moderator.py b/src/mailman/app/moderator.py
index ffe0f779e..1a86ce7cc 100644
--- a/src/mailman/app/moderator.py
+++ b/src/mailman/app/moderator.py
@@ -42,7 +42,7 @@ from mailman.app.notifications import (
from mailman.config import config
from mailman.core import errors
from mailman.email.message import Message, UserNotification
-from mailman.interfaces import Action
+from mailman.interfaces.action import Action
from mailman.interfaces.member import AlreadySubscribedError, DeliveryMode
from mailman.interfaces.requests import RequestType
diff --git a/src/mailman/docs/requests.txt b/src/mailman/docs/requests.txt
index a620338db..c49f09895 100644
--- a/src/mailman/docs/requests.txt
+++ b/src/mailman/docs/requests.txt
@@ -250,7 +250,7 @@ We can also hold a message with some additional metadata.
Once held, the moderator can select one of several dispositions. The most
trivial is to simply defer a decision for now.
- >>> from mailman.interfaces import Action
+ >>> from mailman.interfaces.action import Action
>>> moderator.handle_message(mlist, id_1, Action.defer)
>>> requests.get_request(id_1) is not None
True
@@ -411,7 +411,7 @@ For closed lists, subscription requests will also be held for moderator
approval. In this case, several pieces of information related to the
subscription must be provided, including the subscriber's address and real
name, their password (possibly hashed), what kind of delivery option they are
-chosing and their preferred language.
+choosing and their preferred language.
>>> from mailman.interfaces.member import DeliveryMode
>>> mlist.admin_immed_notify = False
diff --git a/src/mailman/interfaces/__init__.py b/src/mailman/interfaces/__init__.py
index a9f3fb982..e69de29bb 100644
--- a/src/mailman/interfaces/__init__.py
+++ b/src/mailman/interfaces/__init__.py
@@ -1,44 +0,0 @@
-# Copyright (C) 2007-2009 by the Free Software Foundation, Inc.
-#
-# This file is part of GNU Mailman.
-#
-# GNU Mailman is free software: you can redistribute it and/or modify it under
-# the terms of the GNU General Public License as published by the Free
-# Software Foundation, either version 3 of the License, or (at your option)
-# any later version.
-#
-# GNU Mailman is distributed in the hope that it will be useful, but WITHOUT
-# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
-# more details.
-#
-# You should have received a copy of the GNU General Public License along with
-# GNU Mailman. If not, see <http://www.gnu.org/licenses/>.
-
-__metaclass__ = type
-__all__ = [
- 'Action',
- 'NewsModeration',
- ]
-
-
-from munepy import Enum
-
-
-
-class Action(Enum):
- hold = 0
- reject = 1
- discard = 2
- accept = 3
- defer = 4
-
-
-
-class NewsModeration(Enum):
- # The newsgroup is not moderated
- none = 0
- # The newsgroup is moderated, but allows for an open posting policy.
- open_moderated = 1
- # The newsgroup is moderated
- moderated = 2
diff --git a/src/mailman/interfaces/action.py b/src/mailman/interfaces/action.py
new file mode 100644
index 000000000..b562c0c61
--- /dev/null
+++ b/src/mailman/interfaces/action.py
@@ -0,0 +1,33 @@
+# Copyright (C) 2007-2009 by the Free Software Foundation, Inc.
+#
+# This file is part of GNU Mailman.
+#
+# GNU Mailman is free software: you can redistribute it and/or modify it under
+# the terms of the GNU General Public License as published by the Free
+# Software Foundation, either version 3 of the License, or (at your option)
+# any later version.
+#
+# GNU Mailman is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+# more details.
+#
+# You should have received a copy of the GNU General Public License along with
+# GNU Mailman. If not, see <http://www.gnu.org/licenses/>.
+
+__metaclass__ = type
+__all__ = [
+ 'Action',
+ ]
+
+
+from munepy import Enum
+
+
+
+class Action(Enum):
+ hold = 0
+ reject = 1
+ discard = 2
+ accept = 3
+ defer = 4
diff --git a/src/mailman/interfaces/nntp.py b/src/mailman/interfaces/nntp.py
new file mode 100644
index 000000000..5b6fc0523
--- /dev/null
+++ b/src/mailman/interfaces/nntp.py
@@ -0,0 +1,34 @@
+# Copyright (C) 2007-2009 by the Free Software Foundation, Inc.
+#
+# This file is part of GNU Mailman.
+#
+# GNU Mailman is free software: you can redistribute it and/or modify it under
+# the terms of the GNU General Public License as published by the Free
+# Software Foundation, either version 3 of the License, or (at your option)
+# any later version.
+#
+# GNU Mailman is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+# more details.
+#
+# You should have received a copy of the GNU General Public License along with
+# GNU Mailman. If not, see <http://www.gnu.org/licenses/>.
+
+__metaclass__ = type
+__all__ = [
+ 'NewsModeration',
+ ]
+
+
+from munepy import Enum
+
+
+
+class NewsModeration(Enum):
+ # The newsgroup is not moderated
+ none = 0
+ # The newsgroup is moderated, but allows for an open posting policy.
+ open_moderated = 1
+ # The newsgroup is moderated
+ moderated = 2
diff --git a/src/mailman/queue/docs/news.txt b/src/mailman/queue/docs/news.txt
index 3375b3d54..f149ef93a 100644
--- a/src/mailman/queue/docs/news.txt
+++ b/src/mailman/queue/docs/news.txt
@@ -117,7 +117,7 @@ Newsgroup moderation
When the newsgroup is moderated, an Approved: header with the list's posting
address is added for the benefit of the Usenet system.
- >>> from mailman.interfaces import NewsModeration
+ >>> from mailman.interfaces.nntp import NewsModeration
>>> mlist.news_moderation = NewsModeration.open_moderated
>>> msg = message_from_string("""\
... From: aperson@example.com
@@ -140,7 +140,7 @@ address is added for the benefit of the Usenet system.
>>> msg['approved']
u'_xtest@example.com'
-But if the newsgroup is not moderated, the Approved: header is not chnaged.
+But if the newsgroup is not moderated, the Approved: header is not changed.
>>> mlist.news_moderation = NewsModeration.none
>>> msg = message_from_string("""\
diff --git a/src/mailman/queue/news.py b/src/mailman/queue/news.py
index ed408c72e..b87a40752 100644
--- a/src/mailman/queue/news.py
+++ b/src/mailman/queue/news.py
@@ -27,7 +27,7 @@ from cStringIO import StringIO
from mailman import Utils
from mailman.config import config
-from mailman.interfaces import NewsModeration
+from mailman.interfaces.nntp import NewsModeration
from mailman.queue import Runner
COMMASPACE = ', '
diff --git a/src/mailman/rules/docs/news-moderation.txt b/src/mailman/rules/docs/news-moderation.txt
index 4c095cc81..2ba6aa065 100644
--- a/src/mailman/rules/docs/news-moderation.txt
+++ b/src/mailman/rules/docs/news-moderation.txt
@@ -13,16 +13,16 @@ directly to the mailing list.
>>> print rule.name
news-moderation
-Set the list configuraiton variable to enable newsgroup moderation.
+Set the list configuration variable to enable newsgroup moderation.
- >>> from mailman.interfaces import NewsModeration
+ >>> from mailman.interfaces.nntp import NewsModeration
>>> mlist.news_moderation = NewsModeration.moderated
And now all messages will match the rule.
>>> msg = message_from_string("""\
... From: aperson@example.org
- ... Subject: An announcment
+ ... Subject: An announcement
...
... Great things are happening.
... """)
diff --git a/src/mailman/rules/news_moderation.py b/src/mailman/rules/news_moderation.py
index 3ead80086..e6c5047e9 100644
--- a/src/mailman/rules/news_moderation.py
+++ b/src/mailman/rules/news_moderation.py
@@ -28,7 +28,7 @@ __all__ = [
from zope.interface import implements
from mailman.i18n import _
-from mailman.interfaces import NewsModeration
+from mailman.interfaces.nntp import NewsModeration
from mailman.interfaces.rules import IRule
diff --git a/src/mailman/styles/default.py b/src/mailman/styles/default.py
index 5bc19e85a..2b07b6f49 100644
--- a/src/mailman/styles/default.py
+++ b/src/mailman/styles/default.py
@@ -32,10 +32,11 @@ from zope.interface import implements
from mailman.config import config
from mailman.i18n import _
-from mailman.interfaces import Action, NewsModeration
+from mailman.interfaces.action import Action
from mailman.interfaces.autorespond import ResponseAction
from mailman.interfaces.mailinglist import (
DigestFrequency, Personalization, ReplyToMunging)
+from mailman.interfaces.nntp import NewsModeration
from mailman.interfaces.styles import IStyle