Skip to content

Instantly share code, notes, and snippets.

@kagesenshi
Created March 7, 2012 16:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kagesenshi/1994244 to your computer and use it in GitHub Desktop.
Save kagesenshi/1994244 to your computer and use it in GitHub Desktop.
Query for email addresses of Fedora contributors by country
#!/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