web/views/iprogress.py
branchstable
changeset 7475 a70456bbb4bd
parent 6496 21bbb561809b
child 8037 a36bd56f33bb
--- a/web/views/iprogress.py	Wed Jun 08 15:11:45 2011 +0200
+++ b/web/views/iprogress.py	Thu Jun 09 10:36:28 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')