added script to gather statistics from ppa repository

git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@4179 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
csoler 2011-04-30 12:00:22 +00:00
parent eafa3d5a87
commit 4e494c5453

View File

@ -0,0 +1,32 @@
#!/usr/bin/python
# Requires packages
# python-launchpad-integration
# python-launchpadlib
from launchpadlib.launchpad import Launchpad
PPAOWNER = "csoler-users" #the launchpad PPA owener. It's usually the first part of a PPA. Example: in "webupd8team/vlmc", the owener is "webupd8team".
distribs = ['jaunty','karmic','lucid','maverick','natty']
archs = ['i386','amd64']
ppas = ['retroshare','retroshare-snapshots']
total = 0
for PPA in ppas:
for distrib in distribs:
for arch in archs:
desired_dist_and_arch = 'https://api.edge.launchpad.net/devel/ubuntu/' + distrib + '/' + arch
#here, edit "maverick" and "i386" with the Ubuntu version and desired arhitecture
cachedir = "~/.launchpadlib/cache/"
lp_ = Launchpad.login_anonymously('ppastats', 'edge', cachedir, version='devel')
owner = lp_.people[PPAOWNER]
archive = owner.getPPAByName(name=PPA)
for individualarchive in archive.getPublishedBinaries(status='Published',distro_arch_series=desired_dist_and_arch):
print PPA + "\t" + arch + "\t" + individualarchive.binary_package_version + "\t" + str(individualarchive.getDownloadCount())
total += individualarchive.getDownloadCount()
print "Total downloads: " + str(total)