[views/iprogress] rename to make things easier to read and understand stable
authorNicolas Chauvat <nicolas.chauvat@logilab.fr>
Thu, 09 Jun 2011 10:36:28 +0200
branchstable
changeset 7475 a70456bbb4bd
parent 7472 9833c09460f1
child 7476 4be45b64d755
child 7477 3d64867f1019
[views/iprogress] rename to make things easier to read and understand
web/views/iprogress.py
--- 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')