diff options
| author | bwarsaw | 2006-05-02 02:08:07 +0000 |
|---|---|---|
| committer | bwarsaw | 2006-05-02 02:08:07 +0000 |
| commit | 237524b141e918d637c68135486714071d94b5e9 (patch) | |
| tree | ca61dc6256299c3898f18e99e7d3ce64e2c9634d /bin | |
| parent | 59bbe4f47bddd81e4d0b57be6be196f0e35f440b (diff) | |
| download | mailman-237524b141e918d637c68135486714071d94b5e9.tar.gz mailman-237524b141e918d637c68135486714071d94b5e9.tar.zst mailman-237524b141e918d637c68135486714071d94b5e9.zip | |
Convert list_owners
Diffstat (limited to 'bin')
| -rw-r--r-- | bin/Makefile.in | 6 | ||||
| -rw-r--r-- | bin/list_owners | 120 |
2 files changed, 3 insertions, 123 deletions
diff --git a/bin/Makefile.in b/bin/Makefile.in index 75c72d296..46ae3f09a 100644 --- a/bin/Makefile.in +++ b/bin/Makefile.in @@ -50,11 +50,11 @@ SCRIPTS= mmshell add_members \ config_list dumpdb cleanarch \ list_admins genaliases mailmanctl qrunner \ fix_url.py convert.py transcheck \ - list_owners msgfmt.py discard \ + msgfmt.py discard \ reset_pw.py templ2pot.py po2templ.py -LN_SCRIPTS= arch change_pw inject list_lists list_members mmsitepass \ - newlist rmlist show_qfiles unshunt version +LN_SCRIPTS= arch change_pw inject list_lists list_members list_owners \ + mmsitepass newlist rmlist show_qfiles unshunt version BUILDDIR= ../build/bin diff --git a/bin/list_owners b/bin/list_owners deleted file mode 100644 index 5b050450d..000000000 --- a/bin/list_owners +++ /dev/null @@ -1,120 +0,0 @@ -#! @PYTHON@ -# -# Copyright (C) 2002 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 -# as published by the Free Software Foundation; either version 2 -# of the License, or (at your option) any later version. -# -# This program 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 this program; if not, write to the Free Software -# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - -"""List the owners of a mailing list, or all mailing lists. - -Usage: %(PROGRAM)s [options] [listname ...] -Options: - - -w / --with-listnames - Group the owners by list names and include the list names in the - output. Otherwise, the owners will be sorted and uniquified based on - the email address. - - -m / --moderators - Include the list moderators in the output. - - -h / --help - Print this help message and exit. - - listname - Print the owners of the specified lists. More than one can appear - after the options. If there are no listnames provided, the owners of - all the lists will be displayed. -""" - -import sys -import getopt - -import paths -from Mailman import Utils -from Mailman.MailList import MailList -from Mailman.i18n import _ - -PROGRAM = sys.argv[0] - -try: - True, False -except NameError: - True = 1 - False = 0 - - - -def usage(code, msg=''): - if code: - fd = sys.stderr - else: - fd = sys.stdout - print >> fd, _(__doc__) - if msg: - print >> fd, msg - sys.exit(code) - - - -def main(): - try: - opts, args = getopt.getopt(sys.argv[1:], 'wmh', - ['with-listnames', 'moderators', 'help']) - except getopt.error, msg: - usage(1, msg) - - withnames = moderators = False - for opt, arg in opts: - if opt in ('-h', '--help'): - usage(0) - elif opt in ('-m', '--moderators'): - moderators = True - elif opt in ('-w', '--with-listnames'): - withnames = True - - listnames = args or Utils.list_names() - bylist = {} - - for listname in listnames: - mlist = MailList(listname, lock=0) - addrs = mlist.owner[:] - if moderators: - addrs.extend(mlist.moderator) - bylist[listname] = addrs - - if withnames: - for listname in listnames: - unique = {} - for addr in bylist[listname]: - unique[addr] = 1 - keys = unique.keys() - keys.sort() - print listname - for k in keys: - print '\t', k - else: - unique = {} - for listname in listnames: - for addr in bylist[listname]: - unique[addr] = 1 - keys = unique.keys() - keys.sort() - for k in keys: - print k - - - -if __name__ == '__main__': - main() |
