merge changes from stable branch
authorNicolas Chauvat <nicolas.chauvat@logilab.fr>
Thu, 09 Jun 2011 10:37:01 +0200
changeset 7476 4be45b64d755
parent 7474 7dc405ad7bf3 (current diff)
parent 7475 a70456bbb4bd (diff)
child 7478 9e213becdcf4
merge changes from stable branch
--- a/web/views/iprogress.py	Wed Jun 08 17:10:39 2011 +0200
+++ b/web/views/iprogress.py	Thu Jun 09 10:37:01 2011 +0200
@@ -177,12 +177,11 @@
 
     @classmethod
     def overrun(cls, iprogress):
-        """overrun = done + todo - """
         done = iprogress.done or 0
         todo = iprogress.todo or 0
-        revised_cost = iprogress.revised_cost or 0
-        if done + todo > revised_cost:
-            overrun = done + todo - revised_cost
+        budget = iprogress.revised_cost or 0
+        if done + todo > budget:
+            overrun = done + todo - budget
         else:
             overrun = 0
         if overrun < cls.precision:
@@ -191,11 +190,10 @@
 
     @classmethod
     def overrun_percentage(cls, iprogress):
-        """pourcentage overrun = overrun / budget"""
-        revised_cost = iprogress.revised_cost or 0
-        if revised_cost == 0:
+        budget = iprogress.revised_cost or 0
+        if budget == 0:
             return 0
-        return cls.overrun(iprogress) * 100. / revised_cost
+        return cls.overrun(iprogress) * 100. / budget
 
     def cell_call(self, row, col):
         self._cw.add_css('cubicweb.iprogress.css')