voting/foundation.gnome.org/elections/2001/list-addresses.py
Glynn Foster 2bb34eacfa Merge the new-template branch in to HEAD. The branch is now defunct, and
2003-11-01  Glynn Foster  <glynn.foster@sun.com>

	* Merge the new-template branch in to HEAD. The branch is now defunct,
	and we have a live updated foundation.gnome.org. Yay!
2003-11-02 05:06:55 +00:00

42 lines
814 B
Python

#! /usr/bin/python
import re
import sys
import string
nospam_re = re.compile ("no_spam\.?")
def unmunge_email (addr):
unmunged = nospam_re.sub ("", addr)
return unmunged
comment_re = re.compile ("^#.*")
entry_re = re.compile (" *(.*?)<(.*?)> *\((.*?)\) *")
filename = sys.argv[1]
handle = open (filename)
lines = handle.readlines ()
count = 0
for line in lines:
line = comment_re.sub ("", line)
string.strip (line)
if line == "" or line == "\n":
continue
match = entry_re.search (line)
if match:
name = string.strip (match.group (1))
email = unmunge_email (string.strip (match.group (2)))
contribution = string.strip (match.group (3))
count = count + 1
print email
else:
print "No match: " + line
handle.close ()