From 0e9fb0aec9fcf0027dd354b48196b1fa0d420c4d Mon Sep 17 00:00:00 2001 From: bwarsaw Date: Sat, 8 Jul 2006 17:45:13 +0000 Subject: Fix test_message.py by finishing the wind-through of the configuration object and fixing the invocation and shutdown of mailmanctl. While the tests in this module work individually, they do not yet work as a group. -C added to testall.py, and mailmanctl now passes that flag on to qrunner. UserNotification sets reduced_list_header in the msgdata, but the behavior of this flag has changed. It used to suppress List-Help, List-Subscribe, and List-Unsubscribe as well as List-Post and List-Archive. However, List-Help, List-Subscribe and List-Unsubscribe should definitely be included in UserNotifications, and List-Post has a different variable controlling it now. Therefore, always add List-Help, List-Subscribe, and List-Unsubscribe. Some style updates to Message.py --- Mailman/Handlers/ToOutgoing.py | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-) (limited to 'Mailman/Handlers/ToOutgoing.py') diff --git a/Mailman/Handlers/ToOutgoing.py b/Mailman/Handlers/ToOutgoing.py index 7273c41b2..c29f83f76 100644 --- a/Mailman/Handlers/ToOutgoing.py +++ b/Mailman/Handlers/ToOutgoing.py @@ -1,18 +1,19 @@ -# Copyright (C) 1998,1999,2000,2001,2002 by the Free Software Foundation, Inc. +# Copyright (C) 1998-2006 by the Free Software Foundation, Inc. # # This program 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 2 # of the License, or (at your option) any later version. -# +# # This program 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 this program; if not, write to the Free Software -# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, +# USA. """Re-queue the message to the outgoing queue. @@ -21,13 +22,13 @@ posted to the list membership. Anything else that needs to go out to some recipient should just be placed in the out queue directly. """ -from Mailman import mm_cfg from Mailman.Queue.sbcache import get_switchboard +from Mailman.configuration import config def process(mlist, msg, msgdata): - interval = mm_cfg.VERP_DELIVERY_INTERVAL + interval = config.VERP_DELIVERY_INTERVAL # Should we VERP this message? If personalization is enabled for this # list and VERP_PERSONALIZED_DELIVERIES is true, then yes we VERP it. # Also, if personalization is /not/ enabled, but VERP_DELIVERY_INTERVAL is @@ -39,17 +40,17 @@ def process(mlist, msg, msgdata): if msgdata.has_key('verp'): pass elif mlist.personalize: - if mm_cfg.VERP_PERSONALIZED_DELIVERIES: - msgdata['verp'] = 1 + if config.VERP_PERSONALIZED_DELIVERIES: + msgdata['verp'] = True elif interval == 0: # Never VERP pass elif interval == 1: # VERP every time - msgdata['verp'] = 1 + msgdata['verp'] = True else: - # VERP every `inteval' number of times - msgdata['verp'] = not int(mlist.post_id) % interval + # VERP every `interval' number of times + msgdata['verp'] = not (int(mlist.post_id) % interval) # And now drop the message in qfiles/out - outq = get_switchboard(mm_cfg.OUTQUEUE_DIR) + outq = get_switchboard(config.OUTQUEUE_DIR) outq.enqueue(msg, msgdata, listname=mlist.internal_name()) -- cgit v1.2.3-70-g09d2