diff rhodecode/lib/helpers.py @ 1258:3954bdaf6243 beta

fixed possible float division, and changeset ranges bug introduced in stat changeset.
author Marcin Kuzminski <marcin@python-works.com>
date Thu, 14 Apr 2011 01:07:18 +0200
parents 0a2a10a1912f
children 4209cd4b7823
line wrap: on
line diff
--- a/rhodecode/lib/helpers.py	Thu Apr 14 00:43:23 2011 +0200
+++ b/rhodecode/lib/helpers.py	Thu Apr 14 01:07:18 2011 +0200
@@ -644,8 +644,9 @@
 
 def fancy_file_stats(stats):
     a, d, t = stats[0], stats[1], stats[0] + stats[1]
+    print stats
     width = 100
-    unit = float(width) / t
+    unit = float(width) / (t or 1)
 
     a_p = max(9, unit * a) if a > 0 else 0# needs > 9% to be visible
     d_p = max(9, unit * d) if d > 0 else 0 # needs > 9% to be visible