[Mailman-Developers] /bin/list_admins error

Danny Terweij danny@poema.yi.org
Wed, 8 May 2002 01:46:11 +0200

From: "Dale Newfield" <Dale@Newfield.org>

> > UnboundLocalError: local variable 'mlist' referenced before assignment

> > When just running from a terminal its going fine (./list_admins
Also tested more and from teminal window it worked fine.

> Then maybe the error is in the script, not list_admins?  Verify that $i is
> a list during that iteration, then show us that "list_admins
> specific_list_name" causes a problem, and we're starting down the
> debugging path.  As it is we don't have enough info.

Okay, more info :
As you see i want to stop grabbing the list-owner info from the config_list
and instead of that i want use list_admins

I did make a own stats generator. someone did post the original script at
mailman-users list a while ago for 2.0.x users.
Maybe.. i doing now realise.. de LIST= command not compatible with 2.1?
I do not even understand whats awk... sed.. and so on is doing :-)
It worked fine for mm2.0.x.

#! /bin/bash
TMPFILE=`mktemp /tmp/mm_list_members.XXXXXX` || exit 1
LIST="`/usr/local/mailman/bin/list_lists |awk '{print $1}' |sed -n '2,$p'`"
  echo " " > $TMPFILE
  echo " ***** mailinglists inormation *****" >> $TMPFILE
for i in $LIST

  echo " " >> $TMPFILE
  echo "===> Listname: $i" >> $TMPFILE

# TMPLST="/prv/mailman/$i.txt"
  /usr/local/mailman/bin/list_admins $i > $TMPOWN

# /usr/local/mailman/bin/config_list -o $TMPLST $i
# LSTOWNER=`grep -i "owner =" $TMPLST`
# echo "===> List-$LSTOWNER" >> $TMPFILE
  echo "===> $LSTOWNERX" >> $TMPFILE

[cutted some parts]

  echo "===> Subscribers:" >> $TMPFILE
  /usr/local/mailman/bin/list_members $i >> $TMPFILE
 echo " " >> $TMPFILE

  # Mail it
  mail -s "Mailing lists" root <$TMPFILE

# remove the temp file

What about this.. same kind of faillure? :

[root@lnx bin]# ./config_list -o config.test testlist
Traceback (most recent call last):
  File "./config_list", line 268, in ?
  File "./config_list", line 261, in main
    do_output(listname, outfile)
  File "./config_list", line 113, in do_output
    do_list_categories(mlist, k, None, outfp)
  File "./config_list", line 162, in do_list_categories
    lines = value.replace('\r', '').split('\n')
AttributeError: replace
[root@lnx bin]#