diff options
author | bwarsaw <> | 2003-03-31 20:07:57 +0000 |
---|---|---|
committer | bwarsaw <> | 2003-03-31 20:07:57 +0000 |
commit | d258eeb3b86fc7a084e68428f3354789ef8e3b4c (patch) | |
tree | c5e669fcefd0fa98790159734d09c0d37d63c204 /bin/remove_members | |
parent | 5a6aeea41cd141bc4e962381284cbeeefa7bf4d9 (diff) | |
download | mailman2-d258eeb3b86fc7a084e68428f3354789ef8e3b4c.tar.gz mailman2-d258eeb3b86fc7a084e68428f3354789ef8e3b4c.tar.xz mailman2-d258eeb3b86fc7a084e68428f3354789ef8e3b4c.zip |
Backporting various fixes and improvements from the trunk.
Diffstat (limited to 'bin/remove_members')
-rwxr-xr-x | bin/remove_members | 51 |
1 files changed, 29 insertions, 22 deletions
diff --git a/bin/remove_members b/bin/remove_members index 888dfa51..b8f92f5e 100755 --- a/bin/remove_members +++ b/bin/remove_members @@ -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 @@ -31,21 +31,23 @@ Options: --all -a Remove all members of the mailing list. - (mutually exclusive with --fromall) + (mutually exclusive with --fromall) --fromall - Removes the given addresses from all the lists on this system - regardless of virtual domains if you have any. This option cannot be - used -a/--all. Also, you should not specify a listname when using this - option. + Removes the given addresses from all the lists on this system + regardless of virtual domains if you have any. This option cannot be + used -a/--all. Also, you should not specify a listname when using + this option. --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 Utils 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 @@ def ReadFile(filename): 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 @@ def main(): 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 @@ def main(): 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 @@ def main(): 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() |