Skip to content

Instantly share code, notes, and snippets.

@ralphbean
Created May 3, 2012 01:20
Show Gist options
  • Select an option

  • Save ralphbean/2582372 to your computer and use it in GitHub Desktop.

Select an option

Save ralphbean/2582372 to your computer and use it in GitHub Desktop.
List the Fedora packages I own by their status in Upstream Release Monitoring.
#!/usr/bin/env python
"""
List the Fedora packages I own by their status in Upstream Release Monitoring.
Requires a few python modules::
$ sudo yum install python-fedora python-keyring python-vault
If you couldn't get python-vault, that's because it's not in F17 yet. Try::
$ sudo pip install vault
"""
import fedora.client
import urllib2
import vault
URL = "http://fedoraproject.org/wiki/Upstream_release_monitoring"
auth_system = 'Fedora Account System'
symbols = {
False: ' - ',
True: ' + ',
}
if __name__ == '__main__':
username = vault.get(auth_system, 'username')
password = vault.get(auth_system, 'password')
pkgdb = fedora.client.PackageDB(username=username, password=password)
pkgs = pkgdb.user_packages(username).pkgs
page = urllib2.urlopen(URL).read()
for pkg in pkgs:
print symbols[pkg.name in page], pkg.name
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment