Created
March 7, 2012 16:36
-
-
Save kagesenshi/1994244 to your computer and use it in GitHub Desktop.
Query for email addresses of Fedora contributors by country
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
from fedora.client import AccountSystem | |
from getpass import getpass | |
import sys | |
if len(sys.argv) != 2: | |
print "Usage: %s <country code>" % (sys.argv[0]) | |
sys.exit(1) | |
country = sys.argv[1].upper().strip() | |
username = raw_input("FAS Username: ") | |
password = getpass() | |
fas = AccountSystem(username=username,password=password) | |
people = fas.people_by_key(key='username', fields=['human_name','username', 'country_code','email']) | |
for p in people: | |
if people[p]['country_code'] == country: | |
print '"%s" <%s>,' % (people[p]['human_name'],people[p]['email']) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment