------------------------------------------------------------
revno: 6655
committer: Barry Warsaw <[email protected]>
branch nick: 3.0
timestamp: Sat 2009-01-03 05:47:41 -0500
message:
  "Fix" Pipermail in the sense that it doesn't traceback.
  
  Fix some typos in Utils.py
  
  Fix add_members and list_members
  
  Add a testing MTA.
added:
  mailman/testing/mta.py
modified:
  mailman/Archiver/HyperArch.py
  mailman/Utils.py
  mailman/bin/add_members.py
  mailman/bin/list_members.py
  mailman/pipeline/smtp_direct.py

=== modified file 'mailman/Archiver/HyperArch.py'
--- a/mailman/Archiver/HyperArch.py     2009-01-01 22:16:51 +0000
+++ b/mailman/Archiver/HyperArch.py     2009-01-03 10:47:41 +0000
@@ -1139,8 +1139,7 @@
                     length = len(text)
                     if Defaults.ARCHIVER_OBSCURES_EMAILADDRS:
                         text = re.sub('@', atmark, text)
-                        URL = self.maillist.GetScriptURL(
-                            'listinfo', absolute=1)
+                        URL = self.maillist.script_url('listinfo')
                     else:
                         URL = 'mailto:' + text
                     pos = j

=== modified file 'mailman/Utils.py'
--- a/mailman/Utils.py  2009-01-01 22:16:51 +0000
+++ b/mailman/Utils.py  2009-01-03 10:47:41 +0000
@@ -40,10 +40,12 @@
 
 import mailman.templates
 
+from mailman import Defaults
 from mailman import passwords
 from mailman.config import config
 from mailman.core import errors
 
+
 AT = '@'
 CR = '\r'
 DOT = '.'
@@ -301,7 +303,8 @@
                         # We have no available source of cryptographically
                         # secure random characters.  Log an error and fallback
                         # to the user friendly passwords.
-                        log.error('urandom not available, passwords not 
secure')
+                        log.errorf(
+                            'urandom not available, passwords not secure')
                         return UserFriendly_MakeRandomPassword(length)
                 newbytes = os.read(fd, length - bytesread)
             bytes.append(newbytes)
@@ -316,8 +319,8 @@
 
 def MakeRandomPassword(length=None):
     if length is None:
-        length = config.MEMBER_PASSWORD_LENGTH
-    if config.USER_FRIENDLY_PASSWORDS:
+        length = Defaults.MEMBER_PASSWORD_LENGTH
+    if Defaults.USER_FRIENDLY_PASSWORDS:
         password = UserFriendly_MakeRandomPassword(length)
     else:
         password = Secure_MakeRandomPassword(length)

=== modified file 'mailman/bin/add_members.py'
--- a/mailman/bin/add_members.py        2009-01-01 22:16:51 +0000
+++ b/mailman/bin/add_members.py        2009-01-03 10:47:41 +0000
@@ -22,12 +22,12 @@
 from cStringIO import StringIO
 from email.utils import parseaddr
 
-from mailman import errors
 from mailman import Message
 from mailman import Utils
 from mailman import i18n
 from mailman.app.membership import add_member
-from mailman.configuration import config
+from mailman.config import config
+from mailman.core import errors
 from mailman.interfaces import AlreadySubscribedError, DeliveryMode
 from mailman.options import SingleMailingListOptions
 
@@ -117,7 +117,8 @@
                 fullname = u''
             password = Utils.MakeRandomPassword()
             add_member(mlist, address, fullname, password, delivery_mode,
-                       config.DEFAULT_SERVER_LANGUAGE, ack, admin_notify)
+                       unicode(config.mailman.default_language))
+            # XXX Support ack and admin_notify
         except AlreadySubscribedError:
             print >> tee, _('Already a member: $subscriber')
         except errors.InvalidEmailAddress:

=== modified file 'mailman/bin/list_members.py'
--- a/mailman/bin/list_members.py       2009-01-01 22:16:51 +0000
+++ b/mailman/bin/list_members.py       2009-01-03 10:47:41 +0000
@@ -19,9 +19,9 @@
 
 from email.Utils import formataddr
 
-from mailman import errors
 from mailman import Utils
-from mailman.configuration import config
+from mailman.config import config
+from mailman.core import errors
 from mailman.i18n import _
 from mailman.interfaces import DeliveryStatus
 from mailman.options import SingleMailingListOptions

=== modified file 'mailman/pipeline/smtp_direct.py'
--- a/mailman/pipeline/smtp_direct.py   2009-01-01 22:16:51 +0000
+++ b/mailman/pipeline/smtp_direct.py   2009-01-03 10:47:41 +0000
@@ -185,7 +185,7 @@
         sender      = origsender,
         recip       = len(recips),
         size        = msg.original_size,
-        seconds     = t1 - t0,
+        time        = t1 - t0,
         refused     = len(refused),
         smtpcode    = 'n/a',
         smtpmsg     = 'n/a',

=== added file 'mailman/testing/mta.py'
--- a/mailman/testing/mta.py    1970-01-01 00:00:00 +0000
+++ b/mailman/testing/mta.py    2009-01-03 10:47:41 +0000
@@ -0,0 +1,44 @@
+# Copyright (C) 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/>.
+
+"""Fake MTA for testing purposes."""
+
+__metaclass__ = type
+__all__ = [
+    'FakeMTA',
+    ]
+
+
+from zope.interface import implements
+
+from mailman.interfaces.mta import IMailTransportAgent
+
+
+
+class FakeMTA:
+    """Fake MTA for testing purposes."""
+
+    implements(IMailTransportAgent)
+
+    def create(self, mlist):
+        pass
+
+    def delete(self, mlist):
+        pass
+
+    def regenerate(self):
+        pass



--
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

Reply via email to