[Mailman-Developers] List of list admins

Juan Carlos Rey Anaya jcrey@uma.es
Wed, 20 Dec 2000 10:26:13 +0100


This is a multi-part message in MIME format.
--------------87810137DF8E63374BEE4034
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: quoted-printable

Maryann Stopha wrote:
> =

> Hi,
> I need to get a list of all the admins for our Mailman system, and
> wondered if anyone could help me with this.  I have tried to grep them
> out, but it has not worked with getting info out of the .db files.
>  Does anyone know a simple way to accomplish this?
-- =

                          ___
                         / F \
                        [[[]]]]
                        ( O O )
   #----------------0000--(_)--0000---------------#
   |    Juan Carlos Rey Anaya (jcrey@uma.es)      |
   |      Servicio Central de inform=E1tica         |
   |       Universidad de M=E1laga - Espa=F1a         |
   #----------------------------------------------#
   #      Solo se que cada vez se menos :-|       #
   #----------------------------------------------#
--------------87810137DF8E63374BEE4034
Content-Type: text/plain; charset=iso-8859-1;
 name="list_admin"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline;
 filename="list_admin"

#! /usr/bin/env python
#
# Copyright (C) 1998 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, U=
SA.

"""List all the owners of a mailing list.

Usage: %(program)s =


    --help
    -h
        Print this help message and exit.


"""

import sys
import getopt
import paths
from Mailman import MailList, Utils
from Mailman import Errors

program =3D sys.argv[0]

def usage(status, msg=3D''):
    print __doc__ % globals()
    if msg:
        print msg
    sys.exit(status)


=0C
def main():
    try:
        opts, args =3D getopt.getopt(
            sys.argv[1:],
            'h',
            ['help'])
    except getopt.error, msg:
        usage(1, msg)

    for opt, arg in opts:
        if opt in ('-h', '--help'):
            usage(0)

    for L in Utils.list_names():

       try:
           mlist =3D MailList.MailList(L, lock=3D0)
       except (Errors.MMUnknownListError, Errors.MMListNotReady):
           print "La lista ", L, "no se puede abrir :-("

       print "Lista:", L, "\tPropietario:", mlist.owner

if __name__ =3D=3D '__main__':
    main()

--------------87810137DF8E63374BEE4034--