diff options
| author | Barry Warsaw | 2008-12-27 23:26:32 -0500 |
|---|---|---|
| committer | Barry Warsaw | 2008-12-27 23:26:32 -0500 |
| commit | 88af638c21e2b356ebd0d9e045a8d028dfb5aedd (patch) | |
| tree | 9145645c4ae68abc45ffb7900ffebe84625df943 /mailman/queue | |
| parent | 1ffa4c74935a56a3c5de736fab052e33e4ab3d38 (diff) | |
| download | mailman-88af638c21e2b356ebd0d9e045a8d028dfb5aedd.tar.gz mailman-88af638c21e2b356ebd0d9e045a8d028dfb5aedd.tar.zst mailman-88af638c21e2b356ebd0d9e045a8d028dfb5aedd.zip | |
More test reairs.
Diffstat (limited to '')
| -rw-r--r-- | mailman/queue/command.py | 9 | ||||
| -rw-r--r-- | mailman/queue/docs/command.txt | 18 |
2 files changed, 14 insertions, 13 deletions
diff --git a/mailman/queue/command.py b/mailman/queue/command.py index 986758ce1..407864310 100644 --- a/mailman/queue/command.py +++ b/mailman/queue/command.py @@ -40,6 +40,7 @@ from email.MIMEMessage import MIMEMessage from email.MIMEText import MIMEText from zope.interface import implements +from mailman import Defaults from mailman import Message from mailman import Utils from mailman.app.replybot import autorespond_to_sender @@ -70,7 +71,7 @@ class CommandFinder: elif msgdata.get('toleave'): self.command_lines.append('leave') elif msgdata.get('toconfirm'): - mo = re.match(config.VERP_CONFIRM_REGEXP, msg.get('to', '')) + mo = re.match(Defaults.VERP_CONFIRM_REGEXP, msg.get('to', '')) if mo: self.command_lines.append('confirm ' + mo.group('cookie')) # Extract the subject header and do RFC 2047 decoding. @@ -99,8 +100,8 @@ class CommandFinder: assert isinstance(body, basestring), 'Non-string decoded payload' lines = body.splitlines() # Use no more lines than specified - self.command_lines.extend(lines[:config.EMAIL_COMMANDS_MAX_LINES]) - self.ignored_lines.extend(lines[config.EMAIL_COMMANDS_MAX_LINES:]) + self.command_lines.extend(lines[:Defaults.EMAIL_COMMANDS_MAX_LINES]) + self.ignored_lines.extend(lines[Defaults.EMAIL_COMMANDS_MAX_LINES:]) def __iter__(self): """Return each command line, split into commands and arguments. @@ -141,7 +142,7 @@ The results of your email command are provided below. class CommandRunner(Runner): - QDIR = config.CMDQUEUE_DIR + """The email command runner.""" def _dispose(self, mlist, msg, msgdata): message_id = msg.get('message-id', 'n/a') diff --git a/mailman/queue/docs/command.txt b/mailman/queue/docs/command.txt index ce4279fff..0b384de01 100644 --- a/mailman/queue/docs/command.txt +++ b/mailman/queue/docs/command.txt @@ -25,7 +25,7 @@ sender. The command can be in the Subject header. ... """) >>> from mailman.inject import inject_message - >>> inject_message(mlist, msg, qdir=config.CMDQUEUE_DIR) + >>> inject_message(mlist, msg, switchboard='command') >>> from mailman.queue.command import CommandRunner >>> from mailman.testing.helpers import make_testable_runner >>> command = make_testable_runner(CommandRunner) @@ -34,11 +34,11 @@ sender. The command can be in the Subject header. And now the response is in the virgin queue. >>> from mailman.queue import Switchboard - >>> virgin_queue = Switchboard(config.VIRGINQUEUE_DIR) + >>> virgin_queue = config.switchboards['virgin'] >>> len(virgin_queue.files) 1 >>> from mailman.testing.helpers import get_queue_messages - >>> item = get_queue_messages(virgin_queue)[0] + >>> item = get_queue_messages('virgin')[0] >>> print item.msg.as_string() Subject: The results of your email commands From: test-bounces@example.com @@ -78,11 +78,11 @@ message is plain text. ... echo foo bar ... """) - >>> inject_message(mlist, msg, qdir=config.CMDQUEUE_DIR) + >>> inject_message(mlist, msg, switchboard='command') >>> command.run() >>> len(virgin_queue.files) 1 - >>> item = get_queue_messages(virgin_queue)[0] + >>> item = get_queue_messages('virgin')[0] >>> print item.msg.as_string() Subject: The results of your email commands From: test-bounces@example.com @@ -121,11 +121,11 @@ at by the command queue. ... echo baz qux ... """) - >>> inject_message(mlist, msg, qdir=config.CMDQUEUE_DIR) + >>> inject_message(mlist, msg, switchboard='command') >>> command.run() >>> len(virgin_queue.files) 1 - >>> item = get_queue_messages(virgin_queue)[0] + >>> item = get_queue_messages('virgin')[0] >>> print item.msg.as_string() Subject: The results of your email commands ... @@ -151,11 +151,11 @@ The 'stop' command is an alias for 'end'. ... echo baz qux ... """) - >>> inject_message(mlist, msg, qdir=config.CMDQUEUE_DIR) + >>> inject_message(mlist, msg, switchboard='command') >>> command.run() >>> len(virgin_queue.files) 1 - >>> item = get_queue_messages(virgin_queue)[0] + >>> item = get_queue_messages('virgin')[0] >>> print item.msg.as_string() Subject: The results of your email commands ... |
