]> git.donarmstrong.com Git - neurodebian.git/commitdiff
BF: nd_popcon2stats -- also capture Vendor field values as introduced recently in...
authorYaroslav Halchenko <debian@onerussian.com>
Sat, 9 Nov 2013 01:14:20 +0000 (17:14 -0800)
committerYaroslav Halchenko <debian@onerussian.com>
Sat, 9 Nov 2013 01:14:20 +0000 (17:14 -0800)
tools/nd_popcon2stats

index 5812849eea37924576afe177ae7396131ad9b8b4..8996076662e41321f1fec7d3b82fe0f87ee1836a 100755 (executable)
@@ -47,7 +47,8 @@ def read_popcon_stats(filename, read_packages=True):
     entry = dict(submissions = None,
                  package = {},
                  release = {},
-                 architecture = {})
+                 architecture = {},
+                 vendor = {})
 
     for line in fileinput.FileInput(filename, openhook=fileinput.hook_compressed):
         key, values = [x.strip().lower() for x in line.split(':', 1)]
@@ -59,13 +60,13 @@ def read_popcon_stats(filename, read_packages=True):
             except ValueError:
                 raise ValueError("Failed to split %s" % values)
             entry[key][pkg] = tuple(int(x) for x in (vote, old, recent, nofiles))
-        elif key in ('release', 'architecture'):
+        elif key in ('release', 'architecture', 'vendor'):
             kvalue, value = values.split()
             entry[key][kvalue] = int(value)
         elif key == 'submissions':
             entry[key] = int(values)
         else:
-            raise ValueError("Do not know how to handle line" % line)
+            raise ValueError("Do not know how to handle line %r" % line)
     return entry
 
 if __name__ == '__main__':