------------------------------------------------------------
revno: 6664
committer: Barry Warsaw <[email protected]>
branch nick: 3.0
timestamp: Sun 2009-01-04 19:41:05 -0500
message:
Picking some (py)lint.
removed:
mailman/commands/cmd_stop.py
mailman/mta/Utils.py
modified:
buildout.cfg
mailman/Archiver/Archiver.py
mailman/Bouncers/Caiwireless.py
mailman/Bouncers/DSN.py
mailman/Mailbox.py
mailman/Utils.py
mailman/app/bounces.py
mailman/app/membership.py
mailman/archiving/pipermail.py
mailman/bin/export.py
mailman/bin/genaliases.py
mailman/bin/list_lists.py
mailman/bin/list_members.py
mailman/bin/qrunner.py
mailman/bin/remove_list.py
mailman/bin/show_qfiles.py
mailman/bin/unshunt.py
mailman/bin/withlist.py
mailman/commands/join.py
mailman/core/errors.py
mailman/core/logging.py
mailman/core/rules.py
mailman/core/styles.py
mailman/database/member.py
mailman/database/message.py
mailman/database/model.py
mailman/database/pending.py
mailman/database/requests.py
mailman/database/roster.py
mailman/database/types.py
mailman/database/user.py
mailman/database/usermanager.py
mailman/database/version.py
mailman/i18n.py
mailman/interfaces/database.py
mailman/interfaces/member.py
mailman/interfaces/mta.py
mailman/interfaces/registrar.py
mailman/languages.py
mailman/pipeline/acknowledge.py
mailman/pipeline/avoid_duplicates.py
mailman/pipeline/calculate_recipients.py
mailman/pipeline/cook_headers.py
mailman/pipeline/decorate.py
mailman/pipeline/mime_delete.py
mailman/pipeline/smtp_direct.py
mailman/queue/bounce.py
mailman/queue/command.py
mailman/queue/incoming.py
mailman/queue/lmtp.py
mailman/queue/maildir.py
mailman/queue/news.py
mailman/queue/outgoing.py
mailman/queue/pipeline.py
mailman/queue/virgin.py
mailman/rules/suspicious.py
mailman/testing/helpers.py
mailman/testing/smtplistener.py
mailman/tests/test_membership.py
mailman/tests/test_security_mgr.py
=== modified file 'buildout.cfg'
--- a/buildout.cfg 2009-01-04 21:57:57 +0000
+++ b/buildout.cfg 2009-01-05 00:41:05 +0000
@@ -5,7 +5,7 @@
test
unzip = true
# bzr branch lp:~barry/lazr.config/megamerge
-develop = . /Users/barry/projects/lazr/megamerge
+develop = . /home/barry/projects/lazr/megamerge
[interpreter]
recipe = zc.recipe.egg
=== modified file 'mailman/Archiver/Archiver.py'
--- a/mailman/Archiver/Archiver.py 2009-01-01 22:16:51 +0000
+++ b/mailman/Archiver/Archiver.py 2009-01-05 00:41:05 +0000
@@ -24,10 +24,8 @@
"""
import os
-import re
import errno
import logging
-import traceback
from cStringIO import StringIO
from string import Template
@@ -35,7 +33,6 @@
from mailman import Mailbox
from mailman import Utils
from mailman.config import config
-from mailman.i18n import _
log = logging.getLogger('mailman.error')
@@ -81,13 +78,14 @@
# the private directory, pointing directly to the private/listname
# which has o+rx permissions. Private archives do not have the
# symbolic links.
- archdir = archive_dir(self.fqdn_listname)
+ archdir = self.archive_dir(self.fqdn_listname)
omask = os.umask(0)
try:
try:
os.mkdir(archdir+'.mbox', 02775)
except OSError, e:
- if e.errno <> errno.EEXIST: raise
+ if e.errno <> errno.EEXIST:
+ raise
# We also create an empty pipermail archive directory into
# which we'll drop an empty index.html file into. This is so
# that lists that have not yet received a posting have
@@ -95,7 +93,8 @@
try:
os.mkdir(archdir, 02775)
except OSError, e:
- if e.errno <> errno.EEXIST: raise
+ if e.errno <> errno.EEXIST:
+ raise
# See if there's an index.html file there already and if not,
# write in the empty archive notice.
indexfile = os.path.join(archdir, 'index.html')
@@ -103,7 +102,8 @@
try:
fp = open(indexfile)
except IOError, e:
- if e.errno <> errno.ENOENT: raise
+ if e.errno <> errno.ENOENT:
+ raise
omask = os.umask(002)
try:
fp = open(indexfile, 'w')
@@ -163,7 +163,6 @@
cmd = Template(ar).safe_substitute(
listname=self.fqdn_listname,
hostname=self.host_name)
- cmd = ar % d
extarch = os.popen(cmd, 'w')
extarch.write(txt)
status = extarch.close()
=== modified file 'mailman/Bouncers/Caiwireless.py'
--- a/mailman/Bouncers/Caiwireless.py 2009-01-01 22:16:51 +0000
+++ b/mailman/Bouncers/Caiwireless.py 2009-01-05 00:41:05 +0000
@@ -19,7 +19,6 @@
import re
import email
-from cStringIO import StringIO
tcre = re.compile(r'the following recipients did not receive this message:',
re.IGNORECASE)
=== modified file 'mailman/Bouncers/DSN.py'
--- a/mailman/Bouncers/DSN.py 2009-01-01 22:16:51 +0000
+++ b/mailman/Bouncers/DSN.py 2009-01-05 00:41:05 +0000
@@ -21,7 +21,6 @@
been audited for differences between the two.
"""
-from cStringIO import StringIO
from email.Iterators import typed_subpart_iterator
from email.Utils import parseaddr
=== modified file 'mailman/Mailbox.py'
--- a/mailman/Mailbox.py 2009-01-01 22:16:51 +0000
+++ b/mailman/Mailbox.py 2009-01-05 00:41:05 +0000
@@ -24,7 +24,6 @@
from email.Errors import MessageParseError
from email.Generator import Generator
-from email.Parser import Parser
from mailman import Defaults
from mailman.Message import Message
=== modified file 'mailman/Utils.py'
--- a/mailman/Utils.py 2009-01-03 10:49:04 +0000
+++ b/mailman/Utils.py 2009-01-05 00:41:05 +0000
@@ -30,7 +30,6 @@
import base64
import random
import logging
-import urlparse
import htmlentitydefs
import email.Header
import email.Iterators
@@ -497,7 +496,8 @@
fp = open(filename)
raise OuterExit
except IOError, e:
- if e.errno <> errno.ENOENT: raise
+ if e.errno <> errno.ENOENT:
+ raise
# Okay, it doesn't exist, keep looping
fp = None
except OuterExit:
=== modified file 'mailman/app/bounces.py'
--- a/mailman/app/bounces.py 2009-01-01 22:16:51 +0000
+++ b/mailman/app/bounces.py 2009-01-05 00:41:05 +0000
@@ -21,12 +21,10 @@
'bounce_message',
]
-import re
import logging
from email.mime.message import MIMEMessage
from email.mime.text import MIMEText
-from email.utils import getaddresses
from mailman import Message
from mailman import Utils
=== modified file 'mailman/app/membership.py'
--- a/mailman/app/membership.py 2009-01-04 05:22:08 +0000
+++ b/mailman/app/membership.py 2009-01-05 00:41:05 +0000
@@ -32,8 +32,7 @@
from mailman.app.notifications import send_goodbye_message
from mailman.config import config
from mailman.core import errors
-from mailman.interfaces.member import (
- AlreadySubscribedError, DeliveryMode, MemberRole)
+from mailman.interfaces.member import AlreadySubscribedError, MemberRole
_ = i18n._
=== modified file 'mailman/archiving/pipermail.py'
--- a/mailman/archiving/pipermail.py 2009-01-03 10:13:41 +0000
+++ b/mailman/archiving/pipermail.py 2009-01-05 00:41:05 +0000
@@ -30,7 +30,6 @@
from zope.interface import implements
from zope.interface.interface import adapter_hooks
-from mailman import Defaults
from mailman.Utils import makedirs
from mailman.config import config
from mailman.interfaces.archiver import IArchiver, IPipermailMailingList
=== modified file 'mailman/bin/export.py'
--- a/mailman/bin/export.py 2009-01-01 22:16:51 +0000
+++ b/mailman/bin/export.py 2009-01-05 00:41:05 +0000
@@ -17,11 +17,7 @@
"""Export an XML representation of a mailing list."""
-import os
-import re
-import sha
import sys
-import base64
import codecs
import datetime
import optparse
@@ -260,7 +256,7 @@
def parseargs():
- parser = optparse.OptionParser(version=Version.MAILMAN_VERSION,
+ parser = optparse.OptionParser(version=MAILMAN_VERSION,
usage=_("""\
%prog [options]
=== modified file 'mailman/bin/genaliases.py'
--- a/mailman/bin/genaliases.py 2009-01-03 10:13:41 +0000
+++ b/mailman/bin/genaliases.py 2009-01-05 00:41:05 +0000
@@ -21,13 +21,9 @@
]
-import sys
-
-from mailman.config import config
from mailman.core.plugins import get_plugin
from mailman.i18n import _
from mailman.options import Options
-from mailman.version import MAILMAN_VERSION
=== modified file 'mailman/bin/list_lists.py'
--- a/mailman/bin/list_lists.py 2009-01-03 10:13:41 +0000
+++ b/mailman/bin/list_lists.py 2009-01-05 00:41:05 +0000
@@ -15,7 +15,6 @@
# You should have received a copy of the GNU General Public License along with
# GNU Mailman. If not, see <http://www.gnu.org/licenses/>.
-from mailman import Defaults
from mailman.config import config
from mailman.i18n import _
from mailman.options import Options
@@ -23,7 +22,7 @@
class ScriptOptions(Options):
- usage=_("""\
+ usage = _("""\
%prog [options]
List all mailing lists.""")
=== modified file 'mailman/bin/list_members.py'
--- a/mailman/bin/list_members.py 2009-01-03 10:47:41 +0000
+++ b/mailman/bin/list_members.py 2009-01-05 00:41:05 +0000
@@ -41,7 +41,7 @@
class ScriptOptions(SingleMailingListOptions):
- usage=_("""\
+ usage = _("""\
%prog [options]
List all the members of a mailing list. Note that with the options below, if
@@ -143,7 +143,7 @@
fqdn_listname = options.options.listname
if options.options.output:
try:
- fp = open(opts.output, 'w')
+ fp = open(options.output, 'w')
except IOError:
options.parser.error(
_('Could not open file for writing: $options.options.output'))
=== modified file 'mailman/bin/qrunner.py'
--- a/mailman/bin/qrunner.py 2009-01-03 10:13:41 +0000
+++ b/mailman/bin/qrunner.py 2009-01-05 00:41:05 +0000
@@ -55,7 +55,7 @@
class ScriptOptions(Options):
- usage=_("""\
+ usage = _("""\
Run one or more qrunners, once or repeatedly.
Each named runner class is run in round-robin fashion. In other words, the
=== modified file 'mailman/bin/remove_list.py'
--- a/mailman/bin/remove_list.py 2009-01-03 10:13:41 +0000
+++ b/mailman/bin/remove_list.py 2009-01-05 00:41:05 +0000
@@ -15,11 +15,8 @@
# You should have received a copy of the GNU General Public License along with
# GNU Mailman. If not, see <http://www.gnu.org/licenses/>.
-import os
import sys
-import shutil
-from mailman import Utils
from mailman.app.lifecycle import remove_list
from mailman.config import config
from mailman.i18n import _
@@ -28,7 +25,7 @@
class ScriptOptions(MultipleMailingListOptions):
- usage=_("""\
+ usage = _("""\
%prog [options]
Remove the components of a mailing list with impunity - beware!
=== modified file 'mailman/bin/show_qfiles.py'
--- a/mailman/bin/show_qfiles.py 2009-01-01 22:16:51 +0000
+++ b/mailman/bin/show_qfiles.py 2009-01-05 00:41:05 +0000
@@ -26,7 +26,7 @@
def parseargs():
- parser = optparse.OptionParser(version=Version.MAILMAN_VERSION,
+ parser = optparse.OptionParser(version=MAILMAN_VERSION,
usage=_("""\
%%prog [options] qfiles ...
=== modified file 'mailman/bin/unshunt.py'
--- a/mailman/bin/unshunt.py 2009-01-03 10:13:41 +0000
+++ b/mailman/bin/unshunt.py 2009-01-05 00:41:05 +0000
@@ -25,7 +25,6 @@
from mailman.config import config
from mailman.i18n import _
-from mailman.version import MAILMAN_VERSION
from mailman.options import Options
=== modified file 'mailman/bin/withlist.py'
--- a/mailman/bin/withlist.py 2009-01-03 10:13:41 +0000
+++ b/mailman/bin/withlist.py 2009-01-05 00:41:05 +0000
@@ -151,7 +151,7 @@
def main():
- global LAST_MLIST, VERBOSE
+ global VERBOSE
parser, opts, args = parseargs()
config_file = (os.getenv('MAILMAN_CONFIG_FILE')
=== removed file 'mailman/commands/cmd_stop.py'
--- a/mailman/commands/cmd_stop.py 2009-01-01 22:16:51 +0000
+++ b/mailman/commands/cmd_stop.py 1970-01-01 00:00:00 +0000
@@ -1,21 +0,0 @@
-# Copyright (C) 2002-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/>.
-
-"""stop is synonymous with the end command.
-"""
-
-from mailman.Commands.cmd_end import process
=== modified file 'mailman/commands/join.py'
--- a/mailman/commands/join.py 2009-01-04 05:22:08 +0000
+++ b/mailman/commands/join.py 2009-01-05 00:41:05 +0000
@@ -24,11 +24,9 @@
]
-from email.header import decode_header, make_header
from email.utils import formataddr, parseaddr
from zope.interface import implements
-from mailman.Utils import MakeRandomPassword
from mailman.config import config
from mailman.i18n import _
from mailman.interfaces.command import ContinueProcessing, IEmailCommand
=== modified file 'mailman/core/errors.py'
--- a/mailman/core/errors.py 2009-01-01 22:16:51 +0000
+++ b/mailman/core/errors.py 2009-01-05 00:41:05 +0000
@@ -102,6 +102,7 @@
class RejectMessage(HandlerError):
"""The message will be bounced back to the sender"""
def __init__(self, notice=None):
+ super(RejectMessage, self).__init__()
if notice is None:
notice = _('Your message was rejected')
if notice.endswith('\n\n'):
@@ -136,6 +137,7 @@
"""A bad password scheme was given."""
def __init__(self, scheme_name='unknown'):
+ super(BadPasswordSchemeError, self).__init__()
self.scheme_name = scheme_name
def __str__(self):
=== modified file 'mailman/core/logging.py'
--- a/mailman/core/logging.py 2009-01-01 22:16:51 +0000
+++ b/mailman/core/logging.py 2009-01-05 00:41:05 +0000
@@ -30,7 +30,6 @@
import sys
import codecs
import logging
-import ConfigParser
from lazr.config import as_boolean, as_log_level
=== modified file 'mailman/core/rules.py'
--- a/mailman/core/rules.py 2009-01-04 05:22:08 +0000
+++ b/mailman/core/rules.py 2009-01-05 00:41:05 +0000
@@ -23,7 +23,6 @@
]
-from zope.interface import implements
from zope.interface.verify import verifyObject
from mailman.config import config
=== modified file 'mailman/core/styles.py'
--- a/mailman/core/styles.py 2009-01-04 05:22:08 +0000
+++ b/mailman/core/styles.py 2009-01-05 00:41:05 +0000
@@ -33,7 +33,6 @@
from mailman import Defaults
from mailman import Utils
-from mailman.config import config
from mailman.core.plugins import get_plugins
from mailman.i18n import _
from mailman.interfaces import Action, NewsModeration
=== modified file 'mailman/database/member.py'
--- a/mailman/database/member.py 2009-01-04 05:22:08 +0000
+++ b/mailman/database/member.py 2009-01-05 00:41:05 +0000
@@ -15,16 +15,19 @@
# 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__ = [
+ 'Member',
+ ]
+
from storm.locals import *
from zope.interface import implements
-from mailman.Utils import split_listname
from mailman.config import config
from mailman.constants import SystemDefaultPreferences
from mailman.database.model import Model
from mailman.database.types import Enum
from mailman.interfaces.member import IMember
-from mailman.interfaces.preferences import IPreferences
=== modified file 'mailman/database/message.py'
--- a/mailman/database/message.py 2009-01-04 05:22:08 +0000
+++ b/mailman/database/message.py 2009-01-05 00:41:05 +0000
@@ -15,6 +15,11 @@
# 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__ = [
+ 'Message',
+ ]
+
from storm.locals import *
from zope.interface import implements
@@ -36,6 +41,7 @@
# This is a Messge-ID field representation, not a database row id.
def __init__(self, message_id, message_id_hash, path):
+ super(Message, self).__init__()
self.message_id = message_id
self.message_id_hash = message_id_hash
self.path = path
=== modified file 'mailman/database/model.py'
--- a/mailman/database/model.py 2009-01-01 22:16:51 +0000
+++ b/mailman/database/model.py 2009-01-05 00:41:05 +0000
@@ -49,6 +49,6 @@
-class Model(object):
+class Model:
"""Like Storm's `Storm` subclass, but with a bit extra."""
__metaclass__ = ModelMeta
=== modified file 'mailman/database/pending.py'
--- a/mailman/database/pending.py 2009-01-04 05:22:08 +0000
+++ b/mailman/database/pending.py 2009-01-05 00:41:05 +0000
@@ -17,6 +17,12 @@
"""Implementations of the IPendable and IPending interfaces."""
+__metaclass__ = type
+__all__ = [
+ 'Pended',
+ 'Pendings',
+ ]
+
import sys
import time
import random
@@ -56,6 +62,7 @@
implements(IPended)
def __init__(self, token, expiration_date):
+ super(Pended, self).__init__()
self.token = token
self.expiration_date = expiration_date
@@ -71,7 +78,7 @@
-class Pendings(object):
+class Pendings:
"""Implementation of the IPending interface."""
implements(IPendings)
=== modified file 'mailman/database/requests.py'
--- a/mailman/database/requests.py 2009-01-04 05:22:08 +0000
+++ b/mailman/database/requests.py 2009-01-05 00:41:05 +0000
@@ -129,6 +129,7 @@
mailing_list = Reference(mailing_list_id, 'MailingList.id')
def __init__(self, key, request_type, mailing_list, data_hash):
+ super(_Request, self).__init__()
self.key = key
self.request_type = request_type
self.mailing_list = mailing_list
=== modified file 'mailman/database/roster.py'
--- a/mailman/database/roster.py 2009-01-04 05:22:08 +0000
+++ b/mailman/database/roster.py 2009-01-05 00:41:05 +0000
@@ -39,7 +39,6 @@
from zope.interface import implements
from mailman.config import config
-from mailman.constants import SystemDefaultPreferences
from mailman.database.address import Address
from mailman.database.member import Member
from mailman.interfaces.member import DeliveryMode, MemberRole
=== modified file 'mailman/database/types.py'
--- a/mailman/database/types.py 2009-01-01 22:16:51 +0000
+++ b/mailman/database/types.py 2009-01-05 00:41:05 +0000
@@ -23,7 +23,7 @@
import sys
from storm.properties import SimpleProperty
-from storm.variables import UnicodeVariable, Variable
+from storm.variables import Variable
=== modified file 'mailman/database/user.py'
--- a/mailman/database/user.py 2009-01-04 05:22:08 +0000
+++ b/mailman/database/user.py 2009-01-05 00:41:05 +0000
@@ -15,7 +15,11 @@
# You should have received a copy of the GNU General Public License along with
# GNU Mailman. If not, see <http://www.gnu.org/licenses/>.
-from email.utils import formataddr
+__metaclass__ = type
+__all__ = [
+ 'User',
+ ]
+
from storm.locals import *
from zope.interface import implements
=== modified file 'mailman/database/usermanager.py'
--- a/mailman/database/usermanager.py 2009-01-04 05:22:08 +0000
+++ b/mailman/database/usermanager.py 2009-01-05 00:41:05 +0000
@@ -17,7 +17,10 @@
"""A user manager."""
-import os
+__metaclass__ = type
+__all__ = [
+ 'UserManager',
+ ]
from zope.interface import implements
=== modified file 'mailman/database/version.py'
--- a/mailman/database/version.py 2009-01-01 22:16:51 +0000
+++ b/mailman/database/version.py 2009-01-05 00:41:05 +0000
@@ -15,6 +15,11 @@
# 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__ = [
+ 'Version',
+ ]
+
from storm.locals import *
from mailman.database.model import Model
@@ -26,5 +31,6 @@
version = Int()
def __init__(self, component, version):
+ super(Version, self).__init__()
self.component = component
self.version = version
=== modified file 'mailman/i18n.py'
--- a/mailman/i18n.py 2009-01-04 05:22:08 +0000
+++ b/mailman/i18n.py 2009-01-05 00:41:05 +0000
@@ -34,7 +34,6 @@
import gettext
import mailman.messages
-from mailman.config import config
_translation = None
_missing = object()
@@ -157,7 +156,7 @@
if isinstance(date, str):
try:
year, mon, day, hh, mm, ss, wday, ydat, dst = time.strptime(date)
- if dst in (0,1):
+ if dst in (0, 1):
tzname = time.tzname[dst]
else:
# MAS: No exception but dst = -1 so try
=== modified file 'mailman/interfaces/database.py'
--- a/mailman/interfaces/database.py 2009-01-01 22:16:51 +0000
+++ b/mailman/interfaces/database.py 2009-01-05 00:41:05 +0000
@@ -23,6 +23,13 @@
Mailman's back end.
"""
+__metaclass__ = type
+__all__ = [
+ 'DatabaseError',
+ 'IDatabase',
+ 'SchemaVersionMismatchError',
+ ]
+
from zope.interface import Interface, Attribute
from mailman.interfaces.errors import MailmanError
@@ -38,6 +45,7 @@
"""The database schema version number did not match what was expected."""
def __init__(self, got):
+ super(SchemaVersionMismatchError, self).__init__()
self._got = got
def __str__(self):
=== modified file 'mailman/interfaces/member.py'
--- a/mailman/interfaces/member.py 2009-01-01 22:16:51 +0000
+++ b/mailman/interfaces/member.py 2009-01-05 00:41:05 +0000
@@ -72,6 +72,7 @@
"""The member is already subscribed to the mailing list with this role."""
def __init__(self, fqdn_listname, address, role):
+ super(AlreadySubscribedError, self).__init__()
self._fqdn_listname = fqdn_listname
self._address = address
self._role = role
=== modified file 'mailman/interfaces/mta.py'
--- a/mailman/interfaces/mta.py 2009-01-03 10:13:41 +0000
+++ b/mailman/interfaces/mta.py 2009-01-05 00:41:05 +0000
@@ -17,7 +17,13 @@
"""Interface for mail transport agent integration."""
-from zope.interface import Interface, Attribute
+__metaclass__ = type
+__all__ = [
+ 'IMailTransportAgent',
+ ]
+
+
+from zope.interface import Interface
=== modified file 'mailman/interfaces/registrar.py'
--- a/mailman/interfaces/registrar.py 2009-01-01 22:16:51 +0000
+++ b/mailman/interfaces/registrar.py 2009-01-05 00:41:05 +0000
@@ -22,7 +22,13 @@
or confirmation, while this interface does.
"""
-from zope.interface import Interface, Attribute
+__metaclass__ = type
+__all__ = [
+ 'IRegistrar',
+ ]
+
+
+from zope.interface import Interface
=== modified file 'mailman/languages.py'
--- a/mailman/languages.py 2009-01-04 05:22:08 +0000
+++ b/mailman/languages.py 2009-01-05 00:41:05 +0000
@@ -35,8 +35,8 @@
self._enabled.add(code)
def enable_language(self, code):
- # As per the interface, let KeyError percolate up.
- self._language_data[code]
+ if code not in self._language_data:
+ raise KeyError(code)
self._enabled.add(code)
def get_description(self, code):
=== removed file 'mailman/mta/Utils.py'
--- a/mailman/mta/Utils.py 2009-01-01 22:16:51 +0000
+++ b/mailman/mta/Utils.py 1970-01-01 00:00:00 +0000
@@ -1,87 +0,0 @@
-# Copyright (C) 2001-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/>.
-
-"""Utilities for list creation/deletion hooks."""
-
-import os
-import pwd
-
-from mailman.configuration import config
-
-
-
-def getusername():
- username = os.environ.get('USER') or os.environ.get('LOGNAME')
- if not username:
- import pwd
- username = pwd.getpwuid(os.getuid())[0]
- if not username:
- username = '<unknown>'
- return username
-
-
-
-def _makealiases_mailprog(mlist):
- wrapper = os.path.join(config.WRAPPER_DIR, 'mailman')
- # Most of the list alias extensions are quite regular. I.e. if the
- # message is delivered to listname-foobar, it will be filtered to a
- # program called foobar. There are two exceptions:
- #
- # 1) Messages to listname (no extension) go to the post script.
- # 2) Messages to listname-admin go to the bounces script. This is for
- # backwards compatibility and may eventually go away (we really have no
- # need for the -admin address anymore).
- #
- # Seed this with the special cases.
- listname = mlist.internal_name()
- fqdn_listname = mlist.fqdn_listname
- aliases = [
- (listname, '"|%s post %s"' % (wrapper, fqdn_listname)),
- ]
- for ext in ('admin', 'bounces', 'confirm', 'join', 'leave', 'owner',
- 'request', 'subscribe', 'unsubscribe'):
- aliases.append(('%s-%s' % (listname, ext),
- '"|%s %s %s"' % (wrapper, ext, fqdn_listname)))
- return aliases
-
-
-
-def _makealiases_maildir(mlist):
- maildir = config.MAILDIR_DIR
- listname = mlist.internal_name()
- fqdn_listname = mlist.fqdn_listname
- if not maildir.endswith('/'):
- maildir += '/'
- # Deliver everything using maildir style. This way there's no mail
- # program, no forking and no wrapper necessary!
- #
- # Note, don't use this unless your MTA leaves the envelope recipient in
- # Delivered-To:, Envelope-To:, or Apparently-To:
- aliases = [(listname, maildir)]
- for ext in ('admin', 'bounces', 'confirm', 'join', 'leave', 'owner',
- 'request', 'subscribe', 'unsubscribe'):
- aliases.append(('%s-%s' % (listname, ext), maildir))
- return aliases
-
-
-
-# XXX This won't work if Mailman.MTA.Utils is imported before the
-# configuration is loaded.
-if config.USE_MAILDIR:
- makealiases = _makealiases_maildir
-else:
- makealiases = _makealiases_mailprog
=== modified file 'mailman/pipeline/acknowledge.py'
--- a/mailman/pipeline/acknowledge.py 2009-01-04 05:22:08 +0000
+++ b/mailman/pipeline/acknowledge.py 2009-01-05 00:41:05 +0000
@@ -28,7 +28,6 @@
from mailman import Message
from mailman import Utils
-from mailman.config import config
from mailman.i18n import _
from mailman.interfaces.handler import IHandler
=== modified file 'mailman/pipeline/avoid_duplicates.py'
--- a/mailman/pipeline/avoid_duplicates.py 2009-01-04 05:22:08 +0000
+++ b/mailman/pipeline/avoid_duplicates.py 2009-01-05 00:41:05 +0000
@@ -30,7 +30,6 @@
from email.Utils import getaddresses, formataddr
from zope.interface import implements
-from mailman.config import config
from mailman.i18n import _
from mailman.interfaces.handler import IHandler
=== modified file 'mailman/pipeline/calculate_recipients.py'
--- a/mailman/pipeline/calculate_recipients.py 2009-01-04 05:22:08 +0000
+++ b/mailman/pipeline/calculate_recipients.py 2009-01-05 00:41:05 +0000
@@ -28,7 +28,6 @@
from zope.interface import implements
-from mailman import Message
from mailman import Utils
from mailman.config import config
from mailman.core import errors
=== modified file 'mailman/pipeline/cook_headers.py'
--- a/mailman/pipeline/cook_headers.py 2009-01-04 05:22:08 +0000
+++ b/mailman/pipeline/cook_headers.py 2009-01-05 00:41:05 +0000
@@ -25,7 +25,6 @@
import re
-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
@@ -33,7 +32,6 @@
from mailman import Utils
from mailman.config import config
-from mailman.core.plugins import get_plugins
from mailman.i18n import _
from mailman.interfaces.handler import IHandler
from mailman.interfaces.mailinglist import Personalization, ReplyToMunging
@@ -319,12 +317,12 @@
# At this point, we should rstrip() every string because some
# MUA deliberately add trailing spaces when composing return
# message.
- d = [(s.rstrip(),c) for (s,c) in d]
+ d = [(s.rstrip(), c) for (s, c) in d]
# Find all charsets in the original header. We use 'utf-8' rather
# than using the first charset (in mailman 2.1.x) if multiple
# charsets are used.
csets = []
- for (s,c) in d:
+ for (s, c) in d:
if c and c not in csets:
csets.append(c)
if len(csets) == 0:
=== modified file 'mailman/pipeline/decorate.py'
--- a/mailman/pipeline/decorate.py 2009-01-04 05:22:08 +0000
+++ b/mailman/pipeline/decorate.py 2009-01-05 00:41:05 +0000
@@ -28,7 +28,6 @@
from string import Template
from zope.interface import implements
-from mailman import Defaults
from mailman import Utils
from mailman.Message import Message
from mailman.config import config
=== modified file 'mailman/pipeline/mime_delete.py'
--- a/mailman/pipeline/mime_delete.py 2009-01-04 05:22:08 +0000
+++ b/mailman/pipeline/mime_delete.py 2009-01-05 00:41:05 +0000
@@ -37,7 +37,6 @@
from os.path import splitext
from zope.interface import implements
-from mailman.Message import UserNotification
from mailman.Utils import oneline
from mailman.config import config
from mailman.core import errors
@@ -217,7 +216,8 @@
try:
os.unlink(filename)
except OSError, e:
- if e.errno <> errno.ENOENT: raise
+ if e.errno <> errno.ENOENT:
+ raise
# Now replace the payload of the subpart and twiddle the Content-Type:
del subpart['content-transfer-encoding']
subpart.set_payload(plaintext)
=== modified file 'mailman/pipeline/smtp_direct.py'
--- a/mailman/pipeline/smtp_direct.py 2009-01-04 05:22:08 +0000
+++ b/mailman/pipeline/smtp_direct.py 2009-01-05 00:41:05 +0000
@@ -34,7 +34,6 @@
import copy
import time
-import email
import socket
import logging
import smtplib
=== modified file 'mailman/queue/bounce.py'
--- a/mailman/queue/bounce.py 2009-01-01 22:16:51 +0000
+++ b/mailman/queue/bounce.py 2009-01-05 00:41:05 +0000
@@ -23,17 +23,14 @@
import logging
import datetime
-from email.MIMEMessage import MIMEMessage
-from email.MIMEText import MIMEText
from email.Utils import parseaddr
from mailman import Defaults
from mailman import Utils
from mailman.Bouncers import BouncerAPI
-from mailman.Message import UserNotification
from mailman.config import config
from mailman.i18n import _
-from mailman.queue import Runner, Switchboard
+from mailman.queue import Runner
COMMASPACE = ', '
=== modified file 'mailman/queue/command.py'
--- a/mailman/queue/command.py 2009-01-04 05:22:08 +0000
+++ b/mailman/queue/command.py 2009-01-05 00:41:05 +0000
@@ -29,21 +29,16 @@
# -owner.
import re
-import sys
import logging
from StringIO import StringIO
from email.Errors import HeaderParseError
-from email.Header import decode_header, make_header, Header
+from email.Header import decode_header, make_header
from email.Iterators import typed_subpart_iterator
-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
from mailman.config import config
from mailman.i18n import _
from mailman.interfaces.command import ContinueProcessing, IEmailResults
=== modified file 'mailman/queue/incoming.py'
--- a/mailman/queue/incoming.py 2009-01-01 22:16:51 +0000
+++ b/mailman/queue/incoming.py 2009-01-05 00:41:05 +0000
@@ -26,7 +26,6 @@
immediately.
"""
-from mailman.config import config
from mailman.core.chains import process
from mailman.queue import Runner
=== modified file 'mailman/queue/lmtp.py'
--- a/mailman/queue/lmtp.py 2009-01-03 10:13:41 +0000
+++ b/mailman/queue/lmtp.py 2009-01-05 00:41:05 +0000
@@ -34,7 +34,6 @@
mechanism.
"""
-import os
import email
import smtpd
import logging
@@ -194,8 +193,8 @@
msgdata['tolist'] = True
queue = 'in'
elif subaddress == 'request':
- msgdata['torequest'] = True
- queue = 'command'
+ msgdata['torequest'] = True
+ queue = 'command'
else:
elog.error('Unknown sub-address: %s', subaddress)
status.append(ERR_550)
=== modified file 'mailman/queue/maildir.py'
--- a/mailman/queue/maildir.py 2009-01-01 22:16:51 +0000
+++ b/mailman/queue/maildir.py 2009-01-05 00:41:05 +0000
@@ -64,14 +64,14 @@
# We only care about the listname and the subq as in listname@ or
# listname-request@
-subqnames = ('admin','bounces','confirm','join','leave',
- 'owner','request','subscribe','unsubscribe')
+subqnames = ('admin', 'bounces', 'confirm', 'join', 'leave',
+ 'owner', 'request', 'subscribe', 'unsubscribe')
def getlistq(address):
localpart, domain = address.split('@', 1)
# TK: FIXME I only know configs of Postfix.
if config.POSTFIX_STYLE_VIRTUAL_DOMAINS:
- p = localpart.split(config.POSTFIX_VIRTUAL_SEPARATOR,1)
+ p = localpart.split(config.POSTFIX_VIRTUAL_SEPARATOR, 1)
if len(p) == 2:
localpart, domain = p
l = localpart.split('-')
@@ -105,7 +105,8 @@
try:
files = os.listdir(self._dir)
except OSError, e:
- if e.errno <> errno.ENOENT: raise
+ if e.errno <> errno.ENOENT:
+ raise
# Nothing's been delivered yet
return 0
for file in files:
=== modified file 'mailman/queue/news.py'
--- a/mailman/queue/news.py 2009-01-01 22:16:51 +0000
+++ b/mailman/queue/news.py 2009-01-05 00:41:05 +0000
@@ -24,7 +24,6 @@
import nntplib
from cStringIO import StringIO
-from email.utils import getaddresses, make_msgid
COMMASPACE = ', '
=== modified file 'mailman/queue/outgoing.py'
--- a/mailman/queue/outgoing.py 2009-01-01 22:16:51 +0000
+++ b/mailman/queue/outgoing.py 2009-01-05 00:41:05 +0000
@@ -18,19 +18,15 @@
"""Outgoing queue runner."""
import os
-import sys
-import copy
-import email
import socket
import logging
from datetime import datetime
from mailman import Defaults
-from mailman import Message
from mailman.config import config
from mailman.core import errors
-from mailman.queue import Runner, Switchboard
+from mailman.queue import Runner
from mailman.queue.bounce import BounceMixin
# This controls how often _do_periodic() will try to deal with deferred
@@ -67,7 +63,7 @@
self._func(mlist, msg, msgdata)
# Failsafe -- a child may have leaked through.
if pid <> os.getpid():
- log.error('child process leaked thru: %s', modname)
+ log.error('child process leaked thru: %s', pid)
os._exit(1)
self._logged = False
except socket.error:
=== modified file 'mailman/queue/pipeline.py'
--- a/mailman/queue/pipeline.py 2009-01-01 22:16:51 +0000
+++ b/mailman/queue/pipeline.py 2009-01-05 00:41:05 +0000
@@ -23,7 +23,6 @@
"""
from mailman.core.pipelines import process
-from mailman.config import config
from mailman.queue import Runner
=== modified file 'mailman/queue/virgin.py'
--- a/mailman/queue/virgin.py 2009-01-01 22:16:51 +0000
+++ b/mailman/queue/virgin.py 2009-01-05 00:41:05 +0000
@@ -24,7 +24,6 @@
"""
from mailman.core.pipelines import process
-from mailman.config import config
from mailman.queue import Runner
=== modified file 'mailman/rules/suspicious.py'
--- a/mailman/rules/suspicious.py 2009-01-04 05:22:08 +0000
+++ b/mailman/rules/suspicious.py 2009-01-05 00:41:05 +0000
@@ -18,17 +18,21 @@
"""The historical 'suspicious header' rule."""
__metaclass__ = type
-__all__ = ['SuspiciousHeader']
+__all__ = [
+ 'SuspiciousHeader',
+ ]
import re
+import logging
-from email.utils import getaddresses
from zope.interface import implements
from mailman.i18n import _
from mailman.interfaces.rules import IRule
+log = logging.getLogger('mailman.error')
+
class SuspiciousHeader:
=== modified file 'mailman/testing/helpers.py'
--- a/mailman/testing/helpers.py 2009-01-01 22:16:51 +0000
+++ b/mailman/testing/helpers.py 2009-01-05 00:41:05 +0000
@@ -35,15 +35,12 @@
import logging
import mailbox
import smtplib
-import tempfile
import threading
from Queue import Empty, Queue
-from datetime import datetime, timedelta
from mailman.bin.master import Loop as Master
from mailman.config import config
-from mailman.queue import Switchboard
from mailman.testing.smtplistener import Server
=== modified file 'mailman/testing/smtplistener.py'
--- a/mailman/testing/smtplistener.py 2009-01-01 22:16:51 +0000
+++ b/mailman/testing/smtplistener.py 2009-01-05 00:41:05 +0000
@@ -18,6 +18,7 @@
"""A test SMTP listener."""
import smtpd
+import socket
import logging
import asyncore
=== modified file 'mailman/tests/test_membership.py'
--- a/mailman/tests/test_membership.py 2009-01-01 22:16:51 +0000
+++ b/mailman/tests/test_membership.py 2009-01-05 00:41:05 +0000
@@ -17,11 +17,9 @@
"""Unit tests for OldStyleMemberships."""
-import os
import time
import unittest
-from mailman import Utils
from mailman import passwords
from mailman.config import config
from mailman.core.errors import NotAMemberError
@@ -136,7 +134,8 @@
eq = self.assertEqual
raises = self.assertRaises
# We don't really care what the bounce info is
- class Info: pass
+ class Info:
+ pass
info = Info()
mlist = self._mlist
mlist.setBounceInfo('[email protected]', info)
=== modified file 'mailman/tests/test_security_mgr.py'
--- a/mailman/tests/test_security_mgr.py 2009-01-01 22:16:51 +0000
+++ b/mailman/tests/test_security_mgr.py 2009-01-05 00:41:05 +0000
@@ -19,7 +19,6 @@
import os
import errno
-import Cookie
import unittest
# Don't use cStringIO because we're going to inherit
@@ -88,11 +87,13 @@
try:
os.unlink(config.SITE_PW_FILE)
except OSError, e:
- if e.errno <> errno.ENOENT: raise
+ if e.errno <> errno.ENOENT:
+ raise
try:
os.unlink(config.LISTCREATOR_PW_FILE)
except OSError, e:
- if e.errno <> errno.ENOENT: raise
+ if e.errno <> errno.ENOENT:
+ raise
def test_auth_creator(self):
self.assertEqual(self._mlist.Authenticate(
@@ -187,11 +188,13 @@
try:
os.unlink(config.SITE_PW_FILE)
except OSError, e:
- if e.errno <> errno.ENOENT: raise
+ if e.errno <> errno.ENOENT:
+ raise
try:
os.unlink(config.LISTCREATOR_PW_FILE)
except OSError, e:
- if e.errno <> errno.ENOENT: raise
+ if e.errno <> errno.ENOENT:
+ raise
del os.environ['HTTP_COOKIE']
def test_auth_site_admin(self):
--
Primary development focus
https://code.launchpad.net/~mailman-coders/mailman/3.0
You are receiving this branch notification because you are subscribed to it.
_______________________________________________
Mailman-checkins mailing list
[email protected]
Unsubscribe:
http://mail.python.org/mailman/options/mailman-checkins/archive%40jab.org