Update of /cvsroot/mailman/mailman/Mailman/MTA
In directory sc8-pr-cvs1:/tmp/cvs-serv12543
Modified Files:
Postfix.py
Log Message:
create(): Add a `quiet' flag which (for this MTA at least) is ignored.
Use True/False where appropriate.
Index: Postfix.py
===================================================================
RCS file: /cvsroot/mailman/mailman/Mailman/MTA/Postfix.py,v
retrieving revision 2.19
retrieving revision 2.20
diff -u -d -r2.19 -r2.20
--- Postfix.py 2 Jan 2003 06:19:50 -0000 2.19
+++ Postfix.py 22 Mar 2003 05:13:56 -0000 2.20
@@ -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