1
0
mirror of https://gitlab.com/fdroid/fdroidserver.git synced 2024-09-17 18:50:11 +02:00

Order counter stats by value, not key

This commit is contained in:
Daniel Martí 2015-04-23 16:42:22 +02:00
parent e7ac90b6b8
commit ca483069c0

View File

@ -226,8 +226,7 @@ def main():
rtype = common.getsrclibvcs(app['Repo']) rtype = common.getsrclibvcs(app['Repo'])
repotypes[rtype] += 1 repotypes[rtype] += 1
f = open('stats/repotypes.txt', 'w') f = open('stats/repotypes.txt', 'w')
for rtype in sorted(repotypes): for rtype, count in repotypes.most_common():
count = repotypes[rtype]
f.write(rtype + ' ' + str(count) + '\n') f.write(rtype + ' ' + str(count) + '\n')
f.close() f.close()
@ -242,8 +241,7 @@ def main():
checkmode = checkmode[:4] checkmode = checkmode[:4]
ucms[checkmode] += 1 ucms[checkmode] += 1
f = open('stats/update_check_modes.txt', 'w') f = open('stats/update_check_modes.txt', 'w')
for checkmode in sorted(ucms): for checkmode, count in ucms.most_common():
count = ucms[checkmode]
f.write(checkmode + ' ' + str(count) + '\n') f.write(checkmode + ' ' + str(count) + '\n')
f.close() f.close()
@ -253,8 +251,7 @@ def main():
for category in app['Categories']: for category in app['Categories']:
ctgs[category] += 1 ctgs[category] += 1
f = open('stats/categories.txt', 'w') f = open('stats/categories.txt', 'w')
for category in sorted(ctgs): for category, count in ctgs.most_common():
count = ctgs[category]
f.write(category + ' ' + str(count) + '\n') f.write(category + ' ' + str(count) + '\n')
f.close() f.close()
@ -267,8 +264,7 @@ def main():
for antifeature in antifeatures: for antifeature in antifeatures:
afs[antifeature] += 1 afs[antifeature] += 1
f = open('stats/antifeatures.txt', 'w') f = open('stats/antifeatures.txt', 'w')
for antifeature in sorted(afs): for antifeature, count in afs.most_common():
count = afs[antifeature]
f.write(antifeature + ' ' + str(count) + '\n') f.write(antifeature + ' ' + str(count) + '\n')
f.close() f.close()
@ -279,8 +275,7 @@ def main():
license = app['License'] license = app['License']
licenses[license] += 1 licenses[license] += 1
f = open('stats/licenses.txt', 'w') f = open('stats/licenses.txt', 'w')
for license in sorted(licenses): for license, count in licenses.most_common():
count = licenses[license]
f.write(license + ' ' + str(count) + '\n') f.write(license + ' ' + str(count) + '\n')
f.close() f.close()