Ubuntu Pastebin

Paste from balogh at Mon, 2 May 2016 14:26:48 +0000

Download as text
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#!/usr/bin/python
import sys
from launchpadlib.launchpad import Launchpad
PPAOWNER = "ubuntu-sdk-team"
PPA = "ppa"
series = ('trusty', 'vivid', 'wily','xenial')
archs = ('amd64','i386')
binary = "ubuntu-sdk-ide"
cachedir = "~/.launchpadlib/cache/"
print PPAOWNER + " " + PPA + " / " + ":" + binary
lp_ = Launchpad.login_anonymously('ppastats', 'production', cachedir, version='devel')
owner = lp_.people[PPAOWNER]
archive = owner.getPPAByName(name=PPA)
overall_count=0
for dist in series:
    dist_count=0
    for arch in archs:
        desired_dist_and_arch = 'https://api.launchpad.net/devel/ubuntu/' + dist + '/' + arch
        packageinfo = archive.getPublishedBinaries(status='Published', binary_name=binary, exact_match=True ,distro_arch_series=desired_dist_and_arch)[0]
        count = packageinfo.getDownloadCount()
        dist_count += count
        overall_count += count 
    print dist + "\t=\t" + str(dist_count)
print 'Overall\t=\t' + str(overall_count)
Download as text