[Python-checkins] r56631 - doctools/trunk/sphinx/web/application.py

georg.brandl python-checkins at python.org
Mon Jul 30 21:47:15 CEST 2007


Author: georg.brandl
Date: Mon Jul 30 21:47:15 2007
New Revision: 56631

Modified:
   doctools/trunk/sphinx/web/application.py
Log:
Make module cloud sizes relative to the smallest number that's present, not 0.


Modified: doctools/trunk/sphinx/web/application.py
==============================================================================
--- doctools/trunk/sphinx/web/application.py	(original)
+++ doctools/trunk/sphinx/web/application.py	Mon Jul 30 21:47:15 2007
@@ -339,11 +339,13 @@
         """
         most_frequent = heapq.nlargest(30, self.freqmodules.iteritems(),
                                        lambda x: x[1])
-        most_frequent = [{
-            'name':         x[0],
-            'size':         100 + math.log(x[1] or 1) * 20,
-            'count':        x[1]
-        } for x in sorted(most_frequent)]
+        if most_frequent:
+            base_count = most_frequent[0][1]
+            most_frequent = [{
+                'name':         x[0],
+                'size':         100 + math.log((x[1] - base_count) + 1) * 20,
+                'count':        x[1]
+                } for x in sorted(most_frequent)]
 
         showpf = None
         newpf = req.args.get('pf')


More information about the Python-checkins mailing list