Update of /cvsroot/mailman/mailman/bin
In directory sc8-pr-cvs1:/tmp/cvs-serv16102

Modified Files:
        remove_members 
Log Message:
If -n and -N are not given, then the list defaults are used.

Use True/False where appropriate.


Index: remove_members
===================================================================
RCS file: /cvsroot/mailman/mailman/bin/remove_members,v
retrieving revision 2.7
retrieving revision 2.8
diff -u -d -r2.7 -r2.8
--- remove_members      10 Dec 2002 06:07:51 -0000      2.7
+++ remove_members      22 Mar 2003 15:48:23 -0000      2.8
@@ -1,6 +1,6 @@
 #! @PYTHON@
 #
-# Copyright (C) 1998,1999,2000,2001,2002 by the Free Software Foundation, Inc.
+# Copyright (C) 1998-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
@@ -41,11 +41,13 @@
 
     --nouserack
     -n
-        Don't send the user acknowledgements.
+        Don't send the user acknowledgements.  If not specified, the list
+        default value is used.
 
     --noadminack
     -N
-        Don't send the admin acknowledgements.
+        Don't send the admin acknowledgements.  If not specified, the list
+        default value is used.
 
     --help
     -h
@@ -66,6 +68,12 @@
 from Mailman import Errors
 from Mailman.i18n import _
 
+try:
+    True, False
+except NameError:
+    True = 1
+    False = 0
+
 
 
 def usage(code, msg=''):
@@ -83,10 +91,10 @@
     lines = []
     if filename == "-":
         fp = sys.stdin
-        closep = 0
+        closep = False
     else:
         fp = open(filename)
-        closep = 1
+        closep = True
     lines = filter(None, [line.strip() for line in fp.readlines()])
     if closep:
         fp.close()
@@ -106,10 +114,11 @@
         usage(1)
 
     filename = None
-    all = 0
-    alllists = 0
-    userack = 1
-    admin_notif = 1
+    all = False
+    alllists = False
+    # None means use list default
+    userack = None
+    admin_notif = None
 
     for opt, arg in opts:
         if opt in ('-h', '--help'):
@@ -117,13 +126,13 @@
         elif opt in ('-f', '--file'):
             filename = arg
         elif opt in ('-a', '--all'):
-            all = 1
+            all = True
         elif opt == '--fromall':
-            alllists = 1
+            alllists = True
         elif opt in ('-n', '--nouserack'):
-            userack = 0
+            userack = False
         elif opt in ('-N', '--noadminack'):
-            admin_notif = 0
+            admin_notif = False
 
     # You probably don't want to delete all the users of all the lists -- Marc
     if all and alllists:
@@ -163,10 +172,8 @@
                    if not alllists:
                        print _('No such member: %(addr)s')
                    continue
-               mlist.ApprovedDeleteMember(addr,
-                                          'bin/remove_members',
-                                          admin_notif,
-                                          userack)
+               mlist.ApprovedDeleteMember(addr, 'bin/remove_members',
+                                          admin_notif, userack)
                if alllists:
                    print _("User `%(addr)s' removed from list: %(listname)s.")
            mlist.Save()



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

Reply via email to