Revision: 7854 Author: bwarsaw Date: 2006-04-15 15:58:13 -0700 (Sat, 15 Apr 2006) ViewCVS: http://svn.sourceforge.net/mailman/?rev=7854&view=rev
Log Message: ----------- Now that Python 2.3 is the minimum requirement for Mailman 2.2: - Remove True/False binding cruft - Remove __future__ statements for nested scopes - Remove ascii_letters import hack from Utils.py - Remove mimetypes.guess_all_extensions import hack from Scrubber.py - In Pending.py, set _missing to object() (better than using []) Also, update copyright years where appropriate, and re-order imports more to my PEP 8 tastes. Whitespace normalize. Modified Paths: -------------- trunk/mailman/Mailman/Archiver/Archiver.py trunk/mailman/Mailman/Archiver/HyperArch.py trunk/mailman/Mailman/Archiver/pipermail.py trunk/mailman/Mailman/Bouncers/DSN.py trunk/mailman/Mailman/Cgi/admin.py trunk/mailman/Mailman/Cgi/confirm.py trunk/mailman/Mailman/Cgi/create.py trunk/mailman/Mailman/Cgi/options.py trunk/mailman/Mailman/Commands/cmd_who.py trunk/mailman/Mailman/Defaults.py.in trunk/mailman/Mailman/Deliverer.py trunk/mailman/Mailman/Errors.py trunk/mailman/Mailman/Gui/Privacy.py trunk/mailman/Mailman/Gui/Topics.py trunk/mailman/Mailman/Handlers/AvoidDuplicates.py trunk/mailman/Mailman/Handlers/CookHeaders.py trunk/mailman/Mailman/Handlers/SMTPDirect.py trunk/mailman/Mailman/Handlers/Scrubber.py trunk/mailman/Mailman/Handlers/SpamDetect.py trunk/mailman/Mailman/Handlers/ToDigest.py trunk/mailman/Mailman/ListAdmin.py trunk/mailman/Mailman/LockFile.py trunk/mailman/Mailman/MTA/Manual.py trunk/mailman/Mailman/MTA/Postfix.py trunk/mailman/Mailman/MailList.py trunk/mailman/Mailman/Mailbox.py trunk/mailman/Mailman/Pending.py trunk/mailman/Mailman/Queue/BounceRunner.py trunk/mailman/Mailman/Queue/CommandRunner.py trunk/mailman/Mailman/Queue/NewsRunner.py trunk/mailman/Mailman/Queue/OutgoingRunner.py trunk/mailman/Mailman/Queue/RetryRunner.py trunk/mailman/Mailman/Queue/Runner.py trunk/mailman/Mailman/Queue/Switchboard.py trunk/mailman/Mailman/SecurityManager.py trunk/mailman/Mailman/Site.py trunk/mailman/Mailman/Utils.py trunk/mailman/bin/reset_pw.py Modified: trunk/mailman/Mailman/Archiver/Archiver.py =================================================================== --- trunk/mailman/Mailman/Archiver/Archiver.py 2006-04-15 19:52:14 UTC (rev 7853) +++ trunk/mailman/Mailman/Archiver/Archiver.py 2006-04-15 22:58:13 UTC (rev 7854) @@ -1,4 +1,4 @@ -# Copyright (C) 1998-2003 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 @@ -23,26 +23,21 @@ """ import os +import re import errno import traceback -import re + from cStringIO import StringIO +from Mailman import Site +from Mailman import Utils from Mailman import mm_cfg from Mailman import Mailbox -from Mailman import Utils -from Mailman import Site -from Mailman.SafeDict import SafeDict -from Mailman.Logging.Syslog import syslog from Mailman.i18n import _ +from Mailman.Logging.Syslog import syslog +from Mailman.SafeDict import SafeDict -try: - True, False -except NameError: - True = 1 - False = 0 - def makelink(old, new): try: Modified: trunk/mailman/Mailman/Archiver/HyperArch.py =================================================================== --- trunk/mailman/Mailman/Archiver/HyperArch.py 2006-04-15 19:52:14 UTC (rev 7853) +++ trunk/mailman/Mailman/Archiver/HyperArch.py 2006-04-15 22:58:13 UTC (rev 7854) @@ -26,34 +26,33 @@ (probably in the 'update_dirty_archives' method). """ -from __future__ import nested_scopes - -import sys +import os import re -import errno -import urllib +import sys import time -import os +import errno import types -import HyperDatabase -import pipermail +import urllib import weakref import binascii -from email.Header import decode_header, make_header -from email.Errors import HeaderParseError from email.Charset import Charset +from email.Errors import HeaderParseError +from email.Header import decode_header, make_header -from Mailman import mm_cfg +from Mailman import i18n from Mailman import Utils from Mailman import Errors +from Mailman import mm_cfg from Mailman import LockFile from Mailman import MailList -from Mailman import i18n -from Mailman.SafeDict import SafeDict +from Mailman.Archiver import HyperDatabase +from Mailman.Archiver import pipermail from Mailman.Logging.Syslog import syslog from Mailman.Mailbox import ArchiverMailbox +from Mailman.SafeDict import SafeDict + # Set up i18n. Assume the current language has already been set in the caller. _ = i18n._ @@ -87,13 +86,6 @@ resource.setrlimit(resource.RLIMIT_STACK, (newsoft, hard)) -try: - True, False -except NameError: - True = 1 - False = 0 - - def html_quote(s, lang=None): repls = ( ('&', '&'), Modified: trunk/mailman/Mailman/Archiver/pipermail.py =================================================================== --- trunk/mailman/Mailman/Archiver/pipermail.py 2006-04-15 19:52:14 UTC (rev 7853) +++ trunk/mailman/Mailman/Archiver/pipermail.py 2006-04-15 22:58:13 UTC (rev 7854) @@ -1,24 +1,24 @@ #! /usr/bin/env python -from __future__ import nested_scopes - -import mailbox import os import re import sys import time -from email.Utils import parseaddr, parsedate_tz, mktime_tz, formatdate +import mailbox + import cPickle as pickle + from cStringIO import StringIO +from email.Utils import parseaddr, parsedate_tz, mktime_tz, formatdate from string import lowercase -__version__ = '0.09 (Mailman edition)' +__version__ = '0.10 (Mailman edition)' VERSION = __version__ CACHESIZE = 100 # Number of slots in the cache from Mailman import Errors +from Mailman.Logging.Syslog import syslog from Mailman.Mailbox import ArchiverMailbox -from Mailman.Logging.Syslog import syslog from Mailman.i18n import _ SPACE = ' ' Modified: trunk/mailman/Mailman/Bouncers/DSN.py =================================================================== --- trunk/mailman/Mailman/Bouncers/DSN.py 2006-04-15 19:52:14 UTC (rev 7853) +++ trunk/mailman/Mailman/Bouncers/DSN.py 2006-04-15 22:58:13 UTC (rev 7854) @@ -21,19 +21,13 @@ been audited for differences between the two. """ +from cStringIO import StringIO from email.Iterators import typed_subpart_iterator from email.Utils import parseaddr -from cStringIO import StringIO from Mailman.Bouncers.BouncerAPI import Stop -try: - True, False -except NameError: - True = 1 - False = 0 - def check(msg): # Iterate over each message/delivery-status subpart Modified: trunk/mailman/Mailman/Cgi/admin.py =================================================================== --- trunk/mailman/Mailman/Cgi/admin.py 2006-04-15 19:52:14 UTC (rev 7853) +++ trunk/mailman/Mailman/Cgi/admin.py 2006-04-15 22:58:13 UTC (rev 7854) @@ -1,4 +1,4 @@ -# Copyright (C) 1998-2005 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 @@ -17,31 +17,29 @@ """Process and produce the list-administration options forms.""" -# For Python 2.1.x compatibility -from __future__ import nested_scopes - -import sys import os import re import cgi import sha -import urllib +import sys import signal -from types import * -from string import lowercase, digits +import urllib from email.Utils import unquote, parseaddr, formataddr +from string import lowercase, digits +from types import * -from Mailman import mm_cfg -from Mailman import Utils -from Mailman import MailList from Mailman import Errors -from Mailman import MemberAdaptor from Mailman import i18n -from Mailman.UserDesc import UserDesc -from Mailman.htmlformat import * +from Mailman import MailList +from Mailman import MemberAdaptor +from Mailman import mm_cfg +from Mailman import Utils + from Mailman.Cgi import Auth +from Mailman.htmlformat import * from Mailman.Logging.Syslog import syslog +from Mailman.UserDesc import UserDesc # Set up i18n _ = i18n._ @@ -50,13 +48,7 @@ NL = '\n' OPTCOLUMNS = 11 -try: - True, False -except NameError: - True = 1 - False = 0 - def main(): # Try to find out which list is being administered Modified: trunk/mailman/Mailman/Cgi/confirm.py =================================================================== --- trunk/mailman/Mailman/Cgi/confirm.py 2006-04-15 19:52:14 UTC (rev 7853) +++ trunk/mailman/Mailman/Cgi/confirm.py 2006-04-15 22:58:13 UTC (rev 7854) @@ -1,4 +1,4 @@ -# Copyright (C) 2001-2005 by the Free Software Foundation, Inc. +# Copyright (C) 2001-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 @@ -17,30 +17,25 @@ """Confirm a pending action via URL.""" -import signal import cgi import time +import signal -from Mailman import mm_cfg from Mailman import Errors from Mailman import i18n from Mailman import MailList +from Mailman import mm_cfg from Mailman import Pending -from Mailman.UserDesc import UserDesc + from Mailman.htmlformat import * from Mailman.Logging.Syslog import syslog +from Mailman.UserDesc import UserDesc # Set up i18n _ = i18n._ i18n.set_language(mm_cfg.DEFAULT_SERVER_LANGUAGE) -try: - True, False -except NameError: - True = 1 - False = 0 - def main(): doc = Document() Modified: trunk/mailman/Mailman/Cgi/create.py =================================================================== --- trunk/mailman/Mailman/Cgi/create.py 2006-04-15 19:52:14 UTC (rev 7853) +++ trunk/mailman/Mailman/Cgi/create.py 2006-04-15 22:58:13 UTC (rev 7854) @@ -1,4 +1,4 @@ -# Copyright (C) 2001-2005 by the Free Software Foundation, Inc. +# Copyright (C) 2001-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 @@ -17,18 +17,20 @@ """Create mailing lists through the web.""" -import sys import os -import signal import cgi import sha +import sys +import signal + from types import ListType -from Mailman import mm_cfg +from Mailman import Errors +from Mailman import i18n from Mailman import MailList from Mailman import Message -from Mailman import Errors -from Mailman import i18n +from Mailman import mm_cfg + from Mailman.htmlformat import * from Mailman.Logging.Syslog import syslog Modified: trunk/mailman/Mailman/Cgi/options.py =================================================================== --- trunk/mailman/Mailman/Cgi/options.py 2006-04-15 19:52:14 UTC (rev 7853) +++ trunk/mailman/Mailman/Cgi/options.py 2006-04-15 22:58:13 UTC (rev 7854) @@ -1,4 +1,4 @@ -# Copyright (C) 1998-2005 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 @@ -17,19 +17,21 @@ """Produce and handle the member options.""" -import sys import os import cgi +import sys import signal import urllib + from types import ListType -from Mailman import mm_cfg -from Mailman import Utils -from Mailman import MailList from Mailman import Errors -from Mailman import MemberAdaptor from Mailman import i18n +from Mailman import MailList +from Mailman import MemberAdaptor +from Mailman import mm_cfg +from Mailman import Utils + from Mailman.htmlformat import * from Mailman.Logging.Syslog import syslog @@ -40,13 +42,7 @@ _ = i18n._ i18n.set_language(mm_cfg.DEFAULT_SERVER_LANGUAGE) -try: - True, False -except NameError: - True = 1 - False = 0 - def main(): doc = Document() Modified: trunk/mailman/Mailman/Commands/cmd_who.py =================================================================== --- trunk/mailman/Mailman/Commands/cmd_who.py 2006-04-15 19:52:14 UTC (rev 7853) +++ trunk/mailman/Mailman/Commands/cmd_who.py 2006-04-15 22:58:13 UTC (rev 7854) @@ -1,4 +1,4 @@ -# Copyright (C) 2002 by the Free Software Foundation, Inc. +# Copyright (C) 2002-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 @@ -14,9 +14,6 @@ # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -# Remove this when base minimal compatibility is Python 2.2 -from __future__ import nested_scopes - from email.Utils import parseaddr from Mailman import mm_cfg Modified: trunk/mailman/Mailman/Defaults.py.in =================================================================== --- trunk/mailman/Mailman/Defaults.py.in 2006-04-15 19:52:14 UTC (rev 7853) +++ trunk/mailman/Mailman/Defaults.py.in 2006-04-15 22:58:13 UTC (rev 7854) @@ -32,12 +32,6 @@ def days(d): return d * 60 * 60 * 24 # Some convenient constants -try: - True, False -except NameError: - True = 1 - False = 0 - Yes = yes = On = on = True No = no = Off = off = False Modified: trunk/mailman/Mailman/Deliverer.py =================================================================== --- trunk/mailman/Mailman/Deliverer.py 2006-04-15 19:52:14 UTC (rev 7853) +++ trunk/mailman/Mailman/Deliverer.py 2006-04-15 22:58:13 UTC (rev 7854) @@ -1,4 +1,4 @@ -# Copyright (C) 1998-2005 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 @@ -21,23 +21,18 @@ from email.MIMEText import MIMEText from email.MIMEMessage import MIMEMessage -from Mailman import mm_cfg +from Mailman import i18n from Mailman import Errors -from Mailman import Utils from Mailman import Message -from Mailman import i18n +from Mailman import mm_cfg +from Mailman import Utils from Mailman import Pending + from Mailman.Logging.Syslog import syslog _ = i18n._ -try: - True, False -except NameError: - True = 1 - False = 0 - class Deliverer: def SendSubscribeAck(self, name, password, digest, text=''): Modified: trunk/mailman/Mailman/Errors.py =================================================================== --- trunk/mailman/Mailman/Errors.py 2006-04-15 19:52:14 UTC (rev 7853) +++ trunk/mailman/Mailman/Errors.py 2006-04-15 22:58:13 UTC (rev 7854) @@ -1,4 +1,4 @@ -# Copyright (C) 1998-2003 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 @@ -15,8 +15,9 @@ # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -"""Shared mailman errors and messages.""" +"""Shared Mailman errors and messages.""" + # exceptions for problems related to opening a list class MMListError(Exception): pass Modified: trunk/mailman/Mailman/Gui/Privacy.py =================================================================== --- trunk/mailman/Mailman/Gui/Privacy.py 2006-04-15 19:52:14 UTC (rev 7853) +++ trunk/mailman/Mailman/Gui/Privacy.py 2006-04-15 22:58:13 UTC (rev 7854) @@ -1,17 +1,17 @@ -# Copyright (C) 2001-2003 by the Free Software Foundation, Inc. +# Copyright (C) 2001-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 +# along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, # USA. @@ -24,13 +24,7 @@ from Mailman.i18n import _ from Mailman.Gui.GUIBase import GUIBase -try: - True, False -except NameError: - True = 1 - False = 0 - class Privacy(GUIBase): def GetConfigCategory(self): @@ -59,7 +53,7 @@ _('Confirm'), _('Require approval'), _('Confirm and approve')), - 0, + 0, _('What steps are required for subscription?<br>'), _('''None - no verification steps (<em>Not Recommended </em>)<br> @@ -67,7 +61,7 @@ Require approval - require list administrator Approval for subscriptions <br> Confirm and approve - both confirm and approve - + <p>(*) when someone requests a subscription, Mailman sends them a notice with a unique subscription request number that they must reply to @@ -88,7 +82,7 @@ Require approval - require list administrator approval for subscriptions <br> Confirm and approve - both confirm and approve - + <p>(*) when someone requests a subscription, Mailman sends them a notice with a unique subscription request number that they must reply to @@ -361,18 +355,18 @@ against every recipient address in the message. The matching is performed with Python's re.match() function, meaning they are anchored to the start of the string. - + <p>For backwards compatibility with Mailman 1.1, if the regexp does not contain an `@', then the pattern is matched against just the local part of the recipient address. If that match fails, or if the pattern does contain an `@', then the pattern is matched against the entire recipient address. - + <p>Matching against the local part is deprecated; in a future release, the pattern will always be matched against the entire recipient address.""")), - ('max_num_recipients', mm_cfg.Number, 5, 0, + ('max_num_recipients', mm_cfg.Number, 5, 0, _('Ceiling on acceptable number of recipients for a posting.'), _('''If a posting has this number, or more, of recipients, it is @@ -401,7 +395,7 @@ case, each rule is matched in turn, with processing stopped after the first match. - Note that headers are collected from all the attachments + Note that headers are collected from all the attachments (except for the mailman administrivia message) and matched against the regular expressions. With this feature, you can effectively sort out messages with dangerous file Modified: trunk/mailman/Mailman/Gui/Topics.py =================================================================== --- trunk/mailman/Mailman/Gui/Topics.py 2006-04-15 19:52:14 UTC (rev 7853) +++ trunk/mailman/Mailman/Gui/Topics.py 2006-04-15 22:58:13 UTC (rev 7854) @@ -23,13 +23,7 @@ from Mailman.Logging.Syslog import syslog from Mailman.Gui.GUIBase import GUIBase -try: - True, False -except NameError: - True = 1 - False = 0 - class Topics(GUIBase): def GetConfigCategory(self): Modified: trunk/mailman/Mailman/Handlers/AvoidDuplicates.py =================================================================== --- trunk/mailman/Mailman/Handlers/AvoidDuplicates.py 2006-04-15 19:52:14 UTC (rev 7853) +++ trunk/mailman/Mailman/Handlers/AvoidDuplicates.py 2006-04-15 22:58:13 UTC (rev 7854) @@ -1,4 +1,4 @@ -# Copyright (C) 2002-2003 by the Free Software Foundation, Inc. +# Copyright (C) 2002-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 @@ -27,13 +27,7 @@ COMMASPACE = ', ' -try: - True, False -except NameError: - True = 1 - False = 0 - def process(mlist, msg, msgdata): recips = msgdata['recips'] Modified: trunk/mailman/Mailman/Handlers/CookHeaders.py =================================================================== --- trunk/mailman/Mailman/Handlers/CookHeaders.py 2006-04-15 19:52:14 UTC (rev 7853) +++ trunk/mailman/Mailman/Handlers/CookHeaders.py 2006-04-15 22:58:13 UTC (rev 7854) @@ -1,4 +1,4 @@ -# Copyright (C) 1998-2005 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 @@ -17,14 +17,13 @@ """Cook a message's Subject header.""" -from __future__ import nested_scopes import re from types import UnicodeType from email.Charset import Charset +from email.Errors import HeaderParseError from email.Header import Header, decode_header, make_header from email.Utils import parseaddr, formataddr, getaddresses -from email.Errors import HeaderParseError from Mailman import mm_cfg from Mailman import Utils @@ -35,14 +34,7 @@ COMMASPACE = ', ' MAXLINELEN = 78 -# True/False -try: - True, False -except NameError: - True = 1 - False = 0 - def _isunicode(s): return isinstance(s, UnicodeType) Modified: trunk/mailman/Mailman/Handlers/SMTPDirect.py =================================================================== --- trunk/mailman/Mailman/Handlers/SMTPDirect.py 2006-04-15 19:52:14 UTC (rev 7853) +++ trunk/mailman/Mailman/Handlers/SMTPDirect.py 2006-04-15 22:58:13 UTC (rev 7854) @@ -1,4 +1,4 @@ -# Copyright (C) 1998-2005 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 @@ -28,31 +28,25 @@ import copy import time +import email import socket import smtplib + +from email.Utils import formataddr +from email.Header import Header +from email.Charset import Charset from types import UnicodeType +from Mailman import Errors from Mailman import mm_cfg from Mailman import Utils -from Mailman import Errors from Mailman.Handlers import Decorate from Mailman.Logging.Syslog import syslog from Mailman.SafeDict import MsgSafeDict -import email -from email.Utils import formataddr -from email.Header import Header -from email.Charset import Charset - DOT = '.' -try: - True, False -except NameError: - True = 1 - False = 0 - # Manage a connection to the SMTP server class Connection: Modified: trunk/mailman/Mailman/Handlers/Scrubber.py =================================================================== --- trunk/mailman/Mailman/Handlers/Scrubber.py 2006-04-15 19:52:14 UTC (rev 7853) +++ trunk/mailman/Mailman/Handlers/Scrubber.py 2006-04-15 22:58:13 UTC (rev 7854) @@ -17,8 +17,6 @@ """Cleanse a message for archiving.""" -from __future__ import nested_scopes - import os import re import sha @@ -26,18 +24,20 @@ import errno import binascii import tempfile + from cStringIO import StringIO +from mimetypes import guess_all_extensions from types import IntType, StringType -from email.Utils import parsedate -from email.Parser import HeaderParser -from email.Generator import Generator from email.Charset import Charset +from email.Generator import Generator +from email.Parser import HeaderParser +from email.Utils import parsedate +from Mailman import Message from Mailman import mm_cfg -from Mailman import Utils from Mailman import LockFile -from Mailman import Message +from Mailman import Utils from Mailman.Errors import DiscardMessage from Mailman.i18n import _ from Mailman.Logging.Syslog import syslog @@ -53,31 +53,7 @@ BR = '<br>\n' SPACE = ' ' -try: - True, False -except NameError: - True = 1 - False = 0 - -try: - from mimetypes import guess_all_extensions -except ImportError: - import mimetypes - def guess_all_extensions(ctype, strict=True): - # BAW: sigh, guess_all_extensions() is new in Python 2.3 - all = [] - def check(map): - for e, t in map.items(): - if t == ctype: - all.append(e) - check(mimetypes.types_map) - # Python 2.1 doesn't have common_types. Sigh, sigh. - if not strict and hasattr(mimetypes, 'common_types'): - check(mimetypes.common_types) - return all - - def guess_extension(ctype, ext): # mimetypes maps multiple extensions to the same type, e.g. .doc, .dot, Modified: trunk/mailman/Mailman/Handlers/SpamDetect.py =================================================================== --- trunk/mailman/Mailman/Handlers/SpamDetect.py 2006-04-15 19:52:14 UTC (rev 7853) +++ trunk/mailman/Mailman/Handlers/SpamDetect.py 2006-04-15 22:58:13 UTC (rev 7854) @@ -26,21 +26,15 @@ """ import re -from cStringIO import StringIO +from cStringIO import StringIO from email.Generator import Generator -from Mailman import mm_cfg from Mailman import Errors from Mailman import i18n +from Mailman import mm_cfg from Mailman.Handlers.Hold import hold_for_approval -try: - True, False -except NameError: - True = 1 - False = 0 - # First, play footsie with _ so that the following are marked as translated, # but aren't actually translated until we need the text later on. def _(s): Modified: trunk/mailman/Mailman/Handlers/ToDigest.py =================================================================== --- trunk/mailman/Mailman/Handlers/ToDigest.py 2006-04-15 19:52:14 UTC (rev 7853) +++ trunk/mailman/Mailman/Handlers/ToDigest.py 2006-04-15 22:58:13 UTC (rev 7854) @@ -29,43 +29,37 @@ import re import copy import time -from types import ListType -from cStringIO import StringIO -from email.Parser import Parser +from cStringIO import StringIO +from email.Charset import Charset from email.Generator import Generator +from email.Header import decode_header, make_header, Header from email.MIMEBase import MIMEBase -from email.MIMEText import MIMEText from email.MIMEMessage import MIMEMessage +from email.MIMEText import MIMEText +from email.Parser import Parser from email.Utils import getaddresses, formatdate -from email.Header import decode_header, make_header, Header -from email.Charset import Charset +from types import ListType -from Mailman import mm_cfg -from Mailman import Utils +from Mailman import Errors from Mailman import Message +from Mailman import Utils from Mailman import i18n -from Mailman import Errors -from Mailman.Mailbox import Mailbox -from Mailman.MemberAdaptor import ENABLED +from Mailman import mm_cfg from Mailman.Handlers.Decorate import decorate -from Mailman.Queue.sbcache import get_switchboard -from Mailman.Mailbox import Mailbox from Mailman.Handlers.Scrubber import process as scrubber from Mailman.Logging.Syslog import syslog +from Mailman.Mailbox import Mailbox +from Mailman.Mailbox import Mailbox +from Mailman.MemberAdaptor import ENABLED +from Mailman.Queue.sbcache import get_switchboard _ = i18n._ UEMPTYSTRING = u'' EMPTYSTRING = '' -try: - True, False -except NameError: - True = 1 - False = 0 - def process(mlist, msg, msgdata): # Short circuit non-digestable lists. Modified: trunk/mailman/Mailman/ListAdmin.py =================================================================== --- trunk/mailman/Mailman/ListAdmin.py 2006-04-15 19:52:14 UTC (rev 7853) +++ trunk/mailman/Mailman/ListAdmin.py 2006-04-15 22:58:13 UTC (rev 7854) @@ -1,4 +1,4 @@ -# Copyright (C) 1998-2004 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 @@ -25,24 +25,24 @@ import os import time +import email import errno import cPickle import marshal -from cStringIO import StringIO -import email -from email.MIMEMessage import MIMEMessage +from cStringIO import StringIO from email.Generator import Generator +from email.MIMEMessage import MIMEMessage from email.Utils import getaddresses -from Mailman import mm_cfg -from Mailman import Utils -from Mailman import Message from Mailman import Errors -from Mailman.UserDesc import UserDesc -from Mailman.Queue.sbcache import get_switchboard -from Mailman.Logging.Syslog import syslog +from Mailman import Message +from Mailman import Utils from Mailman import i18n +from Mailman import mm_cfg +from Mailman.Logging.Syslog import syslog +from Mailman.Queue.sbcache import get_switchboard +from Mailman.UserDesc import UserDesc _ = i18n._ @@ -60,13 +60,7 @@ DASH = '-' NL = '\n' -try: - True, False -except NameError: - True = 1 - False = 0 - class ListAdmin: def InitVars(self): Modified: trunk/mailman/Mailman/LockFile.py =================================================================== --- trunk/mailman/Mailman/LockFile.py 2006-04-15 19:52:14 UTC (rev 7853) +++ trunk/mailman/Mailman/LockFile.py 2006-04-15 22:58:13 UTC (rev 7854) @@ -1,4 +1,4 @@ -# Copyright (C) 1998-2003 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 @@ -59,11 +59,12 @@ # for unit testing. import os -import socket import time import errno import random +import socket import traceback + from stat import ST_NLINK, ST_MTIME # Units are floating-point seconds. @@ -71,13 +72,7 @@ # Allowable a bit of clock skew CLOCK_SLOP = 10 -try: - True, False -except NameError: - True = 1 - False = 0 - # Figure out what logfile to use. This is different depending on whether # we're running in a Mailman context or not. @@ -195,7 +190,7 @@ self.__logprefix = os.path.split(self.__lockfile)[1] # For transferring ownership across a fork. self.__owned = True - + def __repr__(self): return '<LockFile %s: %s [%s: %ssec] pid=%s>' % ( id(self), self.__lockfile, Modified: trunk/mailman/Mailman/MTA/Manual.py =================================================================== --- trunk/mailman/Mailman/MTA/Manual.py 2006-04-15 19:52:14 UTC (rev 7853) +++ trunk/mailman/Mailman/MTA/Manual.py 2006-04-15 22:58:13 UTC (rev 7854) @@ -1,4 +1,4 @@ -# Copyright (C) 2001-2003 by the Free Software Foundation, Inc. +# Copyright (C) 2001-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 @@ -19,22 +19,17 @@ import sys import email.Utils + from cStringIO import StringIO -from Mailman import mm_cfg from Mailman import Message from Mailman import Utils +from Mailman import mm_cfg +from Mailman.MTA.Utils import makealiases from Mailman.Queue.sbcache import get_switchboard from Mailman.i18n import _ -from Mailman.MTA.Utils import makealiases -try: - True, False -except NameError: - True = 1 - False = 0 - # no-ops for interface compliance def makelock(): Modified: trunk/mailman/Mailman/MTA/Postfix.py =================================================================== --- trunk/mailman/Mailman/MTA/Postfix.py 2006-04-15 19:52:14 UTC (rev 7853) +++ trunk/mailman/Mailman/MTA/Postfix.py 2006-04-15 22:58:13 UTC (rev 7854) @@ -1,4 +1,4 @@ -# Copyright (C) 2001-2005 by the Free Software Foundation, Inc. +# Copyright (C) 2001-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 @@ -18,30 +18,25 @@ """Creation/deletion hooks for the Postfix MTA.""" import os -import pwd import grp +import pwd import time import errno + from stat import * -from Mailman import mm_cfg -from Mailman import Utils from Mailman import LockFile -from Mailman.i18n import _ -from Mailman.MTA.Utils import makealiases +from Mailman import Utils +from Mailman import mm_cfg from Mailman.Logging.Syslog import syslog +from Mailman.MTA.Utils import makealiases +from Mailman.i18n import _ LOCKFILE = os.path.join(mm_cfg.LOCK_DIR, 'creator') ALIASFILE = os.path.join(mm_cfg.DATA_DIR, 'aliases') VIRTFILE = os.path.join(mm_cfg.DATA_DIR, 'virtual-mailman') -try: - True, False -except NameError: - True = 1 - False = 0 - def _update_maps(): msg = 'command failed: %s (status: %s, %s)' Modified: trunk/mailman/Mailman/MailList.py =================================================================== --- trunk/mailman/Mailman/MailList.py 2006-04-15 19:52:14 UTC (rev 7853) +++ trunk/mailman/Mailman/MailList.py 2006-04-15 22:58:13 UTC (rev 7854) @@ -21,33 +21,34 @@ Mixes in many task-specific classes. """ -import sys import os +import re +import sys import time -import marshal import errno -import re import shutil import socket import urllib import cPickle +import marshal +import email.Iterators -from cStringIO import StringIO from UserDict import UserDict -from urlparse import urlparse +from cStringIO import StringIO from types import * +from urlparse import urlparse -import email.Iterators -from email.Utils import getaddresses, formataddr, parseaddr from email.Header import Header +from email.Utils import getaddresses, formataddr, parseaddr -from Mailman import mm_cfg -from Mailman import Utils from Mailman import Errors from Mailman import LockFile +from Mailman import Utils +from Mailman import mm_cfg from Mailman.UserDesc import UserDesc -# base classes +# Base classes +from Mailman import Pending from Mailman.Archiver import Archiver from Mailman.Autoresponder import Autoresponder from Mailman.Bouncer import Bouncer @@ -58,36 +59,28 @@ from Mailman.ListAdmin import ListAdmin from Mailman.SecurityManager import SecurityManager from Mailman.TopicMgr import TopicMgr -from Mailman import Pending -# gui components package +# GUI components package from Mailman import Gui -# other useful classes +# Other useful classes from Mailman import MemberAdaptor -from Mailman.OldStyleMemberships import OldStyleMemberships from Mailman import Message from Mailman import Site from Mailman import i18n from Mailman.Logging.Syslog import syslog +from Mailman.OldStyleMemberships import OldStyleMemberships _ = i18n._ EMPTYSTRING = '' -try: - True, False -except NameError: - True = 1 - False = 0 - # Use mixins here just to avoid having any one chunk be too large. class MailList(HTMLFormatter, Deliverer, ListAdmin, Archiver, Digester, SecurityManager, Bouncer, GatewayManager, Autoresponder, TopicMgr, Pending.Pending): - # # A MailList object's basic Python object model support # Modified: trunk/mailman/Mailman/Mailbox.py =================================================================== --- trunk/mailman/Mailman/Mailbox.py 2006-04-15 19:52:14 UTC (rev 7853) +++ trunk/mailman/Mailman/Mailbox.py 2006-04-15 22:58:13 UTC (rev 7854) @@ -1,4 +1,4 @@ -# Copyright (C) 1998-2003 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 @@ -18,23 +18,17 @@ """ import sys +import email import mailbox -import email -from email.Parser import Parser -from email.Generator import Generator from email.Errors import MessageParseError +from email.Generator import Generator +from email.Parser import Parser from Mailman import mm_cfg from Mailman.Message import Message -try: - True, False -except NameError: - True = 1 - False = 0 - def _safeparser(fp): try: Modified: trunk/mailman/Mailman/Pending.py =================================================================== --- trunk/mailman/Mailman/Pending.py 2006-04-15 19:52:14 UTC (rev 7853) +++ trunk/mailman/Mailman/Pending.py 2006-04-15 22:58:13 UTC (rev 7854) @@ -1,4 +1,4 @@ -# Copyright (C) 1998-2004 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 @@ -26,28 +26,25 @@ from Mailman import mm_cfg # Types of pending records -SUBSCRIPTION = 'S' -UNSUBSCRIPTION = 'U' -CHANGE_OF_ADDRESS = 'C' -HELD_MESSAGE = 'H' -RE_ENABLE = 'E' -PROBE_BOUNCE = 'P' +CHANGE_OF_ADDRESS = 'C' +HELD_MESSAGE = 'H' +PROBE_BOUNCE = 'P' +RE_ENABLE = 'E' +SUBSCRIPTION = 'S' +UNSUBSCRIPTION = 'U' -_ALLKEYS = (SUBSCRIPTION, UNSUBSCRIPTION, - CHANGE_OF_ADDRESS, HELD_MESSAGE, - RE_ENABLE, PROBE_BOUNCE, - ) +_ALLKEYS = ( + CHANGE_OF_ADDRESS, + HELD_MESSAGE, + PROBE_BOUNCE, + RE_ENABLE, + SUBSCRIPTION, + UNSUBSCRIPTION, + ) -try: - True, False -except NameError: - True = 1 - False = 0 +_missing = object() -_missing = [] - - class Pending: def InitTempVars(self): Modified: trunk/mailman/Mailman/Queue/BounceRunner.py =================================================================== --- trunk/mailman/Mailman/Queue/BounceRunner.py 2006-04-15 19:52:14 UTC (rev 7853) +++ trunk/mailman/Mailman/Queue/BounceRunner.py 2006-04-15 22:58:13 UTC (rev 7854) @@ -22,29 +22,23 @@ import time import cPickle -from email.MIMEText import MIMEText from email.MIMEMessage import MIMEMessage +from email.MIMEText import MIMEText from email.Utils import parseaddr -from Mailman import mm_cfg -from Mailman import Utils from Mailman import LockFile -from Mailman.Message import UserNotification +from Mailman import Utils +from Mailman import mm_cfg from Mailman.Bouncers import BouncerAPI +from Mailman.Logging.Syslog import syslog +from Mailman.Message import UserNotification from Mailman.Queue.Runner import Runner from Mailman.Queue.sbcache import get_switchboard -from Mailman.Logging.Syslog import syslog from Mailman.i18n import _ COMMASPACE = ', ' -try: - True, False -except NameError: - True = 1 - False = 0 - class BounceMixin: def __init__(self): Modified: trunk/mailman/Mailman/Queue/CommandRunner.py =================================================================== --- trunk/mailman/Mailman/Queue/CommandRunner.py 2006-04-15 19:52:14 UTC (rev 7853) +++ trunk/mailman/Mailman/Queue/CommandRunner.py 2006-04-15 22:58:13 UTC (rev 7854) @@ -1,4 +1,4 @@ -# Copyright (C) 1998-2004 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 @@ -23,37 +23,28 @@ -# BAW: get rid of this when we Python 2.2 is a minimum requirement. -from __future__ import nested_scopes - import re import sys + +from email.Errors import HeaderParseError +from email.Header import decode_header, make_header, Header +from email.Iterators import typed_subpart_iterator +from email.MIMEMessage import MIMEMessage +from email.MIMEText import MIMEText from types import StringType, UnicodeType -from Mailman import mm_cfg -from Mailman import Utils +from Mailman import LockFile from Mailman import Message +from Mailman import Utils +from Mailman import mm_cfg from Mailman.Handlers import Replybot -from Mailman.i18n import _ -from Mailman.Queue.Runner import Runner from Mailman.Logging.Syslog import syslog -from Mailman import LockFile +from Mailman.Queue.Runner import Runner +from Mailman.i18n import _ -from email.Header import decode_header, make_header, Header -from email.Errors import HeaderParseError -from email.Iterators import typed_subpart_iterator -from email.MIMEText import MIMEText -from email.MIMEMessage import MIMEMessage - NL = '\n' -try: - True, False -except NameError: - True = 1 - False = 0 - class Results: def __init__(self, mlist, msg, msgdata): Modified: trunk/mailman/Mailman/Queue/NewsRunner.py =================================================================== --- trunk/mailman/Mailman/Queue/NewsRunner.py 2006-04-15 19:52:14 UTC (rev 7853) +++ trunk/mailman/Mailman/Queue/NewsRunner.py 2006-04-15 22:58:13 UTC (rev 7854) @@ -1,4 +1,4 @@ -# Copyright (C) 2000-2005 by the Free Software Foundation, Inc. +# Copyright (C) 2000-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 @@ -17,19 +17,19 @@ """NNTP queue runner.""" import re +import email import socket import nntplib -from cStringIO import StringIO -import email +from cStringIO import StringIO from email.Utils import getaddresses COMMASPACE = ', ' -from Mailman import mm_cfg from Mailman import Utils -from Mailman.Queue.Runner import Runner +from Mailman import mm_cfg from Mailman.Logging.Syslog import syslog +from Mailman.Queue.Runner import Runner # Matches our Mailman crafted Message-IDs. See Utils.unique_message_id() @@ -45,13 +45,6 @@ """, re.VERBOSE) -try: - True, False -except NameError: - True = 1 - False = 0 - - class NewsRunner(Runner): QDIR = mm_cfg.NEWSQUEUE_DIR Modified: trunk/mailman/Mailman/Queue/OutgoingRunner.py =================================================================== --- trunk/mailman/Mailman/Queue/OutgoingRunner.py 2006-04-15 19:52:14 UTC (rev 7853) +++ trunk/mailman/Mailman/Queue/OutgoingRunner.py 2006-04-15 22:58:13 UTC (rev 7854) @@ -1,4 +1,4 @@ -# Copyright (C) 2000-2004 by the Free Software Foundation, Inc. +# Copyright (C) 2000-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 @@ -20,30 +20,23 @@ import sys import copy import time +import email import socket -import email - -from Mailman import mm_cfg -from Mailman import Message from Mailman import Errors from Mailman import LockFile +from Mailman import Message +from Mailman import mm_cfg +from Mailman.Logging.Syslog import syslog +from Mailman.Queue.BounceRunner import BounceMixin from Mailman.Queue.Runner import Runner from Mailman.Queue.Switchboard import Switchboard -from Mailman.Queue.BounceRunner import BounceMixin -from Mailman.Logging.Syslog import syslog # This controls how often _doperiodic() will try to deal with deferred # permanent failures. It is a count of calls to _doperiodic() DEAL_WITH_PERMFAILURES_EVERY = 10 -try: - True, False -except NameError: - True = 1 - False = 0 - class OutgoingRunner(Runner, BounceMixin): QDIR = mm_cfg.OUTQUEUE_DIR Modified: trunk/mailman/Mailman/Queue/RetryRunner.py =================================================================== --- trunk/mailman/Mailman/Queue/RetryRunner.py 2006-04-15 19:52:14 UTC (rev 7853) +++ trunk/mailman/Mailman/Queue/RetryRunner.py 2006-04-15 22:58:13 UTC (rev 7854) @@ -1,4 +1,4 @@ -# Copyright (C) 2003 by the Free Software Foundation, Inc. +# Copyright (C) 2003-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 @@ -20,13 +20,7 @@ from Mailman.Queue.Runner import Runner from Mailman.Queue.Switchboard import Switchboard -try: - True, False -except NameError: - True = 1 - False = 0 - class RetryRunner(Runner): QDIR = mm_cfg.RETRYQUEUE_DIR Modified: trunk/mailman/Mailman/Queue/Runner.py =================================================================== --- trunk/mailman/Mailman/Queue/Runner.py 2006-04-15 19:52:14 UTC (rev 7853) +++ trunk/mailman/Mailman/Queue/Runner.py 2006-04-15 22:58:13 UTC (rev 7854) @@ -1,4 +1,4 @@ -# Copyright (C) 1998-2004 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 @@ -14,32 +14,24 @@ # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -"""Generic queue runner class. -""" +"""Generic queue runner class.""" import time -import traceback import weakref +import traceback +import email.Errors + from cStringIO import StringIO -from Mailman import mm_cfg -from Mailman import Utils from Mailman import Errors from Mailman import MailList +from Mailman import Utils from Mailman import i18n - -from Mailman.Queue.Switchboard import Switchboard +from Mailman import mm_cfg from Mailman.Logging.Syslog import syslog +from Mailman.Queue.Switchboard import Switchboard -import email.Errors -try: - True, False -except NameError: - True = 1 - False = 0 - - class Runner: QDIR = None Modified: trunk/mailman/Mailman/Queue/Switchboard.py =================================================================== --- trunk/mailman/Mailman/Queue/Switchboard.py 2006-04-15 19:52:14 UTC (rev 7853) +++ trunk/mailman/Mailman/Queue/Switchboard.py 2006-04-15 22:58:13 UTC (rev 7854) @@ -1,4 +1,4 @@ -# Copyright (C) 2001-2004 by the Free Software Foundation, Inc. +# Copyright (C) 2001-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 @@ -14,8 +14,7 @@ # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -"""Reading and writing message objects and message metadata. -""" +"""Reading and writing message objects and message metadata.""" # enqueue() and dequeue() are not symmetric. enqueue() takes a Message # object. dequeue() returns a email.Message object tree. @@ -41,20 +40,14 @@ import cPickle import marshal -from Mailman import mm_cfg -from Mailman import Utils from Mailman import Message +from Mailman import Utils +from Mailman import mm_cfg from Mailman.Logging.Syslog import syslog # 20 bytes of all bits set, maximum sha.digest() value shamax = 0xffffffffffffffffffffffffffffffffffffffffL -try: - True, False -except NameError: - True = 1 - False = 0 - # This flag causes messages to be written as pickles (when True) or text files # (when False). Pickles are more efficient because the message doesn't need # to be re-parsed every time it's unqueued, but pickles are not human readable. Modified: trunk/mailman/Mailman/SecurityManager.py =================================================================== --- trunk/mailman/Mailman/SecurityManager.py 2006-04-15 19:52:14 UTC (rev 7853) +++ trunk/mailman/Mailman/SecurityManager.py 2006-04-15 22:58:13 UTC (rev 7854) @@ -1,4 +1,4 @@ -# Copyright (C) 1998-2004 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 @@ -48,33 +48,28 @@ import os import re +import md5 import sha import time +import urllib import Cookie import marshal import binascii -import urllib + from types import StringType, TupleType from urlparse import urlparse +from Mailman import Errors +from Mailman import Utils +from Mailman import mm_cfg +from Mailman.Logging.Syslog import syslog + try: import crypt except ImportError: crypt = None -import md5 -from Mailman import mm_cfg -from Mailman import Utils -from Mailman import Errors -from Mailman.Logging.Syslog import syslog -try: - True, False -except NameError: - True = 1 - False = 0 - - class SecurityManager: def InitVars(self): Modified: trunk/mailman/Mailman/Site.py =================================================================== --- trunk/mailman/Mailman/Site.py 2006-04-15 19:52:14 UTC (rev 7853) +++ trunk/mailman/Mailman/Site.py 2006-04-15 22:58:13 UTC (rev 7854) @@ -1,17 +1,17 @@ -# Copyright (C) 2002-2003 by the Free Software Foundation, Inc. +# Copyright (C) 2002-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 +# along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. """Provide some customization for site-wide behavior. @@ -25,13 +25,7 @@ from Mailman import mm_cfg -try: - True, False -except NameError: - True = 1 - False = 0 - def _makedir(path): try: Modified: trunk/mailman/Mailman/Utils.py =================================================================== --- trunk/mailman/Mailman/Utils.py 2006-04-15 19:52:14 UTC (rev 7853) +++ trunk/mailman/Mailman/Utils.py 2006-04-15 22:58:13 UTC (rev 7854) @@ -21,11 +21,8 @@ This includes actual message transmission routines, address checking and message and address munging, a handy-dandy routine to map a function on all the mailing lists, and whatever else doesn't belong elsewhere. - """ -from __future__ import nested_scopes - import os import re import cgi @@ -38,28 +35,16 @@ import htmlentitydefs import email.Header import email.Iterators + from email.Errors import HeaderParseError +from string import ascii_letters, digits, whitespace from types import UnicodeType -from string import whitespace, digits -try: - # Python 2.2 - from string import ascii_letters -except ImportError: - # Older Pythons - _lower = 'abcdefghijklmnopqrstuvwxyz' - ascii_letters = _lower + _lower.upper() -from Mailman import mm_cfg from Mailman import Errors from Mailman import Site +from Mailman import mm_cfg from Mailman.SafeDict import SafeDict -try: - True, False -except NameError: - True = 1 - False = 0 - EMPTYSTRING = '' UEMPTYSTRING = u'' NL = '\n' Modified: trunk/mailman/bin/reset_pw.py =================================================================== --- trunk/mailman/bin/reset_pw.py 2006-04-15 19:52:14 UTC (rev 7853) +++ trunk/mailman/bin/reset_pw.py 2006-04-15 22:58:13 UTC (rev 7854) @@ -1,6 +1,6 @@ #! @PYTHON@ # -# Copyright (C) 2004 by the Free Software Foundation, Inc. +# Copyright (C) 2004-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 @@ -41,13 +41,6 @@ from Mailman.i18n import _ -try: - True, False -except NameError: - True = 1 - False = 0 - - def usage(code, msg=''): if code: This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. _______________________________________________ Mailman-checkins mailing list Mailman-checkins@python.org Unsubscribe: http://mail.python.org/mailman/options/mailman-checkins/archive%40jab.org