chiark / gitweb /
stats: simpler repo type logic
authorDaniel Martí <mvdan@mvdan.cc>
Sat, 16 Aug 2014 09:42:51 +0000 (11:42 +0200)
committerDaniel Martí <mvdan@mvdan.cc>
Sat, 16 Aug 2014 09:42:51 +0000 (11:42 +0200)
fdroidserver/stats.py

index 255d230447f1e1094dd007b1fa5a37ceaf53fc79..e6ca4d03440873092fe10b7b4d39a4f7252af7b0 100644 (file)
@@ -214,13 +214,9 @@ def main():
     logging.info("Processing repo types...")
     repotypes = Counter()
     for app in metaapps:
-        if len(app['Repo Type']) == 0:
-            rtype = 'none'
-        else:
-            if app['Repo Type'] == 'srclib':
-                rtype = common.getsrclibvcs(app['Repo'])
-            else:
-                rtype = app['Repo Type']
+        rtype = app['Repo Type'] or 'none'
+        if rtype == 'srclib':
+            rtype = common.getsrclibvcs(app['Repo'])
         repotypes[rtype] += 1
     f = open('stats/repotypes.txt', 'w')
     for rtype in repotypes: