aboutsummaryrefslogtreecommitdiffstats
path: root/dist-tools/getstats.py
blob: 33ddfd7ea9c08fec38b3b500ce5599199f291b82 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#!/usr/bin/env python
#
# Collect statistics on current release.

import commands, os, string, ftplib

# Get version and date
date = commands.getoutput("date")
pid = os.getpid()
# this is a fast variant using the base of the current working directory
# (ignores uncommitted modifications)
os.system("svn export -rBASE . /tmp/getstats.%d" % pid)
# this is a slower variant that may export the whole tree across the net
#os.system("svn export -rCOMMITTED . /tmp/getstats.%d" % pid)
ln = commands.getoutput("cat /tmp/getstats.%d/*.[chly] 2>/dev/null | wc -l" % pid)
os.system("rm -rf /tmp/getstats.%d" % pid)
vers = commands.getoutput("sed -n -e '/AC_INIT/s/AC_INIT(\[.*\],\[\\(.*\\)\])/\\1/p' <configure.ac")
print "fetchmail-" + vers + " (" + date + "), " + string.strip(ln) + " lines:"

# Use local listsize command to grab list statistics
friends = commands.getoutput("listsize friends").strip()
announce = commands.getoutput("listsize announce").strip()
print "There are %s people on fetchmail-friends and %s on fetchmail-announce."% (friends, announce)

# getstats.py