Update of /cvsroot/mailman/mailman/Mailman/MTA
In directory sc8-pr-cvs1:/tmp/cvs-serv24139/Mailman/MTA

Modified Files:
      Tag: Release_2_1-maint
        Manual.py Postfix.py 
Log Message:
Backporting from trunk





Index: Manual.py
===================================================================
RCS file: /cvsroot/mailman/mailman/Mailman/MTA/Manual.py,v
retrieving revision 2.7
retrieving revision 2.7.2.1
diff -u -d -r2.7 -r2.7.2.1
--- Manual.py   25 Oct 2002 20:39:50 -0000      2.7
+++ Manual.py   31 Mar 2003 21:49:42 -0000      2.7.2.1
@@ -1,4 +1,4 @@
-# Copyright (C) 2001,2002 by the Free Software Foundation, Inc.
+# Copyright (C) 2001-2003 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,6 +26,12 @@
 from Mailman.i18n import _
 from Mailman.MTA.Utils import makealiases
 
+try:
+    True, False
+except NameError:
+    True = 1
+    False = 0
+
 
 
 # no-ops for interface compliance
@@ -33,7 +39,7 @@
     class Dummy:
         def lock(self):
             pass
-        def unlock(self, unconditionally=0):
+        def unlock(self, unconditionally=False):
             pass
     return Dummy()
 
@@ -44,7 +50,7 @@
 
 
 # nolock argument is ignored, but exists for interface compliance
-def create(mlist, cgi=0, nolock=0):
+def create(mlist, cgi=False, nolock=False, quiet=False):
     if mlist is None:
         return
     listname = mlist.internal_name()
@@ -54,7 +60,8 @@
         # an email message to mailman-owner requesting that the proper aliases
         # be installed.
         sfp = StringIO()
-        print >> sfp, _("""\
+        if not quiet:
+            print >> sfp, _("""\
 The mailing list `%(listname)s' has been created via the through-the-web
 interface.  In order to complete the activation of this mailing list, the
 proper /etc/aliases (or equivalent) file must be updated.  The program
@@ -64,11 +71,13 @@
 """)
         outfp = sfp
     else:
-        print _("""
+        if not quiet:
+            print _("""\
 To finish creating your mailing list, you must edit your /etc/aliases (or
 equivalent) file by adding the following lines, and possibly running the
 `newaliases' program:
-
+""")
+        print _("""\
 ## %(listname)s mailing list""")
         outfp = sys.stdout
     # Common path
@@ -92,7 +101,7 @@
 
 
 
-def remove(mlist, cgi=0):
+def remove(mlist, cgi=False):
     listname = mlist.internal_name()
     fieldsz = len(listname) + len('-unsubscribe')
     if cgi:

Index: Postfix.py
===================================================================
RCS file: /cvsroot/mailman/mailman/Mailman/MTA/Postfix.py,v
retrieving revision 2.18.2.1
retrieving revision 2.18.2.2
diff -u -d -r2.18.2.1 -r2.18.2.2
--- Postfix.py  2 Jan 2003 06:18:46 -0000       2.18.2.1
+++ Postfix.py  31 Mar 2003 21:49:43 -0000      2.18.2.2
@@ -18,10 +18,10 @@
 """
 
 import os
-import time
-import errno
 import pwd
 import grp
+import time
+import errno
 from stat import *
 
 from Mailman import mm_cfg
@@ -35,6 +35,12 @@
 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():
@@ -160,7 +166,7 @@
         os.umask(omask)
     try:
         # Find the start of the loop address block
-        while 1:
+        while True:
             line = infp.readline()
             if not line:
                 break
@@ -168,7 +174,7 @@
             if line.startswith('# LOOP ADDRESSES START'):
                 break
         # Now see if our domain has already been written
-        while 1:
+        while True:
             line = infp.readline()
             if not line:
                 break
@@ -212,8 +218,8 @@
         _check_for_virtual_loopaddr(mlist, textfile)
 
 
-def create(mlist, cgi=0, nolock=0):
-    # Acquire the global list database lock
+def create(mlist, cgi=False, nolock=False, quiet=False):
+    # Acquire the global list database lock.  quiet flag is ignored.
     lock = None
     if not nolock:
         lock = makelock()
@@ -226,7 +232,7 @@
         _update_maps()
     finally:
         if lock:
-            lock.unlock(unconditionally=1)
+            lock.unlock(unconditionally=True)
 
 
 
@@ -247,7 +253,7 @@
             outfp = open(textfile + '.tmp', 'w')
         finally:
             os.umask(omask)
-        filteroutp = 0
+        filteroutp = False
         start = '# STANZA START: ' + listname
         end = '# STANZA END: ' + listname
         while 1:
@@ -260,7 +266,7 @@
             # marker.
             if filteroutp:
                 if line.strip() == end:
-                    filteroutp = 0
+                    filteroutp = False
                     # Discard the trailing blank line, but don't worry if
                     # we're at the end of the file.
                     infp.readline()
@@ -268,7 +274,7 @@
             else:
                 if line.strip() == start:
                     # Filter out this stanza
-                    filteroutp = 1
+                    filteroutp = True
                 else:
                     outfp.write(line)
     # Close up shop, and rotate the files
@@ -278,18 +284,18 @@
     os.rename(textfile+'.tmp', textfile)
 
 
-def remove(mlist, cgi=0):
+def remove(mlist, cgi=False):
     # Acquire the global list database lock
     lock = makelock()
     lock.lock()
     try:
-        _do_remove(mlist, ALIASFILE, 0)
+        _do_remove(mlist, ALIASFILE, False)
         if mlist.host_name in mm_cfg.POSTFIX_STYLE_VIRTUAL_DOMAINS:
-            _do_remove(mlist, VIRTFILE, 1)
+            _do_remove(mlist, VIRTFILE, True)
         # Regenerate the alias and map files
         _update_maps()
     finally:
-        lock.unlock(unconditionally=1)
+        lock.unlock(unconditionally=True)
 
 
 



_______________________________________________
Mailman-checkins mailing list
[EMAIL PROTECTED]
http://mail.python.org/mailman/listinfo/mailman-checkins

Reply via email to