# Copyright (C) 2016 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 contents of subscribe_auto_approval, ban_list and *_these_nonmembers for a list or lists. Save as bin/list_etc.py Run via bin/withlist -r list_etc to do a single list or bin/withlist -a -r list_etc to do all lists. """ 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 list_etc(mlist): print('List:%s' % mlist.real_name) for attr in ['subscribe_auto_approval', 'ban_list', 'accept_these_nonmembers', 'hold_these_nonmembers', 'reject_these_nonmembers', 'discard_these_nonmembers', ]: alist = getattr(mlist, attr, None) if alist: print(' %s:' % attr) for val in alist: print(' %s' % val)