# HG changeset patch # User Nicolas Chauvat # Date 1307608588 -7200 # Node ID a70456bbb4bddc9e1a9b5a075836edd3c858c4c1 # Parent 9833c09460f1398de8c030aae970839749088eb0 [views/iprogress] rename to make things easier to read and understand diff -r 9833c09460f1 -r a70456bbb4bd 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')