]> xenbits.xensource.com Git - people/larsk/xenproject-org-gitdm.git/commitdiff
Added a report to count the number of hackers/employer
authorCédric Bosdonnat <cedricbosdo@openoffice.org>
Mon, 18 Oct 2010 20:05:26 +0000 (22:05 +0200)
committerJonathan Corbet <corbet@lwn.net>
Fri, 11 Feb 2011 16:20:32 +0000 (09:20 -0700)
reports.py

index 08805b8256cee1393bc314e4e84bee4781e01312..8f6ac900c504728746c41c8256f24880a462b7bf 100644 (file)
@@ -136,7 +136,6 @@ def ReportByPCEmpl (elist, cscount):
     EndReport ()
 
 
-
 def CompareELChanged (e1, e2):
     return e2.changed - e1.changed
 
@@ -296,6 +295,25 @@ def ReportByESOBs (elist):
         if count >= ListCount:
             break
     EndReport ()
+   
+def CompareHackers (e1, e2):
+    return len (e2.hackers) - len (e1.hackers)
+
+def ReportByEHackers (elist):
+    elist.sort (CompareHackers)
+    totalhackers = 0
+    for e in elist:
+        totalhackers += len (e.hackers)
+    count = 0
+    BeginReport ('Employers with the most hackers (total %d)' % totalhackers)
+    for e in elist:
+        nhackers = len (e.hackers)
+        if nhackers > 0:
+            ReportLine (e.name, nhackers, (nhackers*100.0)/totalhackers)
+        count += 1
+        if count >= ListCount:
+            break
+    EndReport ()
 
 
 def DevReports (hlist, totalchanged, cscount, totalremoved):
@@ -313,4 +331,5 @@ def EmplReports (elist, totalchanged, cscount):
     ReportByPCEmpl (elist, cscount)
     ReportByELChanged (elist, totalchanged)
     ReportByESOBs (elist)
+    ReportByEHackers (elist)