getting count of users

Hi folks,
I've written a little script to give me output of the following from any or all listservs we manage. Listname, Last Activity, List Creation Date, Anonymous List, Admins I'd like to add a count of users into the mix, but just cannot seem to get my head around it.
Here is my script : """Display the last post time for a list or all lists.
Save as bin/FSU_listCheck.py
Run via
bin/withlist -r FSU_listCheck listname
or
bin/withlist -a -r FSU_listCheck
to do all lists. """
import time
def FSU_listCheck(mlist): #This process outputs the following : listname, Last Activity, List Creation Date, Anonymous List, Admins print '%s; %s; %s; %s; %s' % ( mlist.real_name, time.strftime('%Y/%m/%d %I:%M %p',time.localtime(mlist.last_post_time)), time.strftime('%Y/%m/%d %I:%M %p',time.localtime(mlist.created_at)), mlist.advertised, mlist.owner )
I am sure it's some sort of mlist.usernames and then maybe using a cmd= 'wc -l' , but I cannot get it to jibe.. any help?
Thanks!
Dave Smith drsmith@fsu.edu<mailto:drsmith@fsu.edu> (850)645-8024 Linux Administrators its-unixadmins@fsu.edu<mailto:its-unixadmins@fsu.edu> (850)644-2591 Information Technology Services Florida State University

len(mlist.members) should work.
--
mat:houser mhouser@uwm.edu uwm:uits:iam-support
On Thu, 21 May 2015, Smith, David wrote:
Hi folks,
I've written a little script to give me output of the following from any or all listservs we manage. Listname, Last Activity, List Creation Date, Anonymous List, Admins I'd like to add a count of users into the mix, but just cannot seem to get my head around it.
Here is my script : """Display the last post time for a list or all lists.
Save as bin/FSU_listCheck.py
Run via
bin/withlist -r FSU_listCheck listname
or
bin/withlist -a -r FSU_listCheck
to do all lists. """
import time
def FSU_listCheck(mlist): #This process outputs the following : listname, Last Activity, List Creation Date, Anonymous List, Admins print '%s; %s; %s; %s; %s' % ( mlist.real_name, time.strftime('%Y/%m/%d %I:%M %p',time.localtime(mlist.last_post_time)), time.strftime('%Y/%m/%d %I:%M %p',time.localtime(mlist.created_at)), mlist.advertised, mlist.owner )
I am sure it's some sort of mlist.usernames and then maybe using a cmd= 'wc -l' , but I cannot get it to jibe.. any help?
Thanks!
Dave Smith drsmith@fsu.edu<mailto:drsmith@fsu.edu> (850)645-8024 Linux Administrators its-unixadmins@fsu.edu<mailto:its-unixadmins@fsu.edu> (850)644-2591 Information Technology Services Florida State University
Mailman-Users mailing list Mailman-Users@python.org https://mail.python.org/mailman/listinfo/mailman-users Mailman FAQ: http://wiki.list.org/x/AgA3 Security Policy: http://wiki.list.org/x/QIA9 Searchable Archives: http://www.mail-archive.com/mailman-users%40python.org/ Unsubscribe: https://mail.python.org/mailman/options/mailman-users/mhouser%40uwm.edu

PERFECT!
Thanks Mat .. that was the key ..
'len' I'll remember that one , I just wasn't even thinking about that.
I was so ingrained on using 'cmd' .. *sigh
Thanks!
Dave Smith drsmith@fsu.edu (850)645-8024 Linux Administrators its-unixadmins@fsu.edu (850)644-2591 Information Technology Services Florida State University
-----Original Message----- From: mat houser [mailto:mhouser@uwm.edu] Sent: Thursday, May 21, 2015 1:31 PM To: Smith, David Cc: mailman-users@python.org Subject: Re: [Mailman-Users] getting count of users
len(mlist.members) should work.
--
mat:houser mhouser@uwm.edu uwm:uits:iam-support
On Thu, 21 May 2015, Smith, David wrote:
Hi folks,
I've written a little script to give me output of the following from any or all listservs we manage. Listname, Last Activity, List Creation Date, Anonymous List, Admins I'd like to add a count of users into the mix, but just cannot seem to get my head around it.
Here is my script : """Display the last post time for a list or all lists.
Save as bin/FSU_listCheck.py
Run via
bin/withlist -r FSU_listCheck listname
or
bin/withlist -a -r FSU_listCheck
to do all lists. """
import time
def FSU_listCheck(mlist): #This process outputs the following : listname, Last Activity, List Creation Date, Anonymous List, Admins print '%s; %s; %s; %s; %s' % ( mlist.real_name, time.strftime('%Y/%m/%d %I:%M %p',time.localtime(mlist.last_post_time)), time.strftime('%Y/%m/%d %I:%M %p',time.localtime(mlist.created_at)), mlist.advertised, mlist.owner )
I am sure it's some sort of mlist.usernames and then maybe using a cmd= 'wc -l' , but I cannot get it to jibe.. any help?
Thanks!
Dave Smith drsmith@fsu.edu<mailto:drsmith@fsu.edu> (850)645-8024 Linux Administrators its-unixadmins@fsu.edu<mailto:its-unixadmins@fsu.edu> (850)644-2591 Information Technology Services Florida State University
Mailman-Users mailing list Mailman-Users@python.org https://mail.python.org/mailman/listinfo/mailman-users Mailman FAQ: http://wiki.list.org/x/AgA3 Security Policy: http://wiki.list.org/x/QIA9 Searchable Archives: http://www.mail-archive.com/mailman-users%40python.org/ Unsubscribe: https://mail.python.org/mailman/options/mailman-users/mhouser%40uwm.edu

mat houser wrote:
len(mlist.members) should work.
This is wrong for two reasons.
mlist.members is not defined in the MemberAdaptor API, it is an artifact of OldStyleMemberships.py which is the default MemberAdaptor, but not necessarily the one in use for a particular list, and more importantly,
even with OldStyleMemberships.py, the mlist.members dictionary only includes regular members, not digest members.
The proper public methods which return lists of all members, regular members and digest members are respectively getMembers, getRegularMemberKeys and getDigestMemberKeys.
Thus, as I posted previously, the way to get the total number of members is
len(mlist.getMembers())
-- Mark Sapiro <mark@msapiro.net> The highway is for gamblers, San Francisco Bay Area, California better use your sense - B. Dylan

On 05/21/2015 08:47 AM, Smith, David wrote:
Hi folks,
I've written a little script to give me output of the following from any or all listservs we manage.
I didn't think Listserv(r) was written in Python or had a withlist script ;)
See <http://wiki.list.org/DOC/Mailman%20is%20not%20Listserv>
I am sure it's some sort of mlist.usernames and then maybe using a cmd= 'wc -l' , but I cannot get it to jibe.. any help?
The number of list members is
len(mlist.getMembers())
-- Mark Sapiro <mark@msapiro.net> The highway is for gamblers, San Francisco Bay Area, California better use your sense - B. Dylan

Sorry Mark! :)
GNU Mailman will be remembered from now on ..
Thanks!
Dave Smith drsmith@fsu.edu (850)645-8024 Linux Administrators its-unixadmins@fsu.edu (850)644-2591 Information Technology Services Florida State University
-----Original Message----- From: Mailman-Users [mailto:mailman-users-bounces+drsmith=fsu.edu@python.org] On Behalf Of Mark Sapiro Sent: Thursday, May 21, 2015 2:06 PM To: mailman-users@python.org Subject: Re: [Mailman-Users] getting count of users
On 05/21/2015 08:47 AM, Smith, David wrote:
Hi folks,
I've written a little script to give me output of the following from any or all listservs we manage.
I didn't think Listserv(r) was written in Python or had a withlist script ;)
See <http://wiki.list.org/DOC/Mailman%20is%20not%20Listserv>
I am sure it's some sort of mlist.usernames and then maybe using a cmd= 'wc -l' , but I cannot get it to jibe.. any help?
The number of list members is
len(mlist.getMembers())
-- Mark Sapiro <mark@msapiro.net> The highway is for gamblers, San Francisco Bay Area, California better use your sense - B. Dylan
Mailman-Users mailing list Mailman-Users@python.org https://mail.python.org/mailman/listinfo/mailman-users Mailman FAQ: http://wiki.list.org/x/AgA3 Security Policy: http://wiki.list.org/x/QIA9 Searchable Archives: http://www.mail-archive.com/mailman-users%40python.org/ Unsubscribe: https://mail.python.org/mailman/options/mailman-users/drsmith%40fsu.edu
participants (3)
-
Mark Sapiro
-
mat houser
-
Smith, David