From: Michael Tremer Date: Fri, 3 Oct 2008 15:43:32 +0000 (+0200) Subject: Fixed a small math error in DurationsConfig.get_avg(). X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=1e0061eb32b906b245bd6b71831de4d949de0fe3;p=ipfire.org.git Fixed a small math error in DurationsConfig.get_avg(). --- diff --git a/build/builder.py b/build/builder.py index 9a6d49df..c72aaf04 100644 --- a/build/builder.py +++ b/build/builder.py @@ -115,7 +115,12 @@ class DurationsConfig: def get(self, sort=0): c = self.db.cursor() c.execute("SELECT duration FROM durations") - ret = c.fetchall() + ret = [] + for value in c.fetchall(): + value = int("%s" % value) + if value < 5400: # 1,5h + continue + ret.append(value) c.close() if sort: ret.sort() return ret @@ -135,10 +140,7 @@ class DurationsConfig: if not len(durations): return None for value in durations: - duration = int("%s" % value) - if duration < 3600: - continue - sum += duration + sum += value avg = sum / len(durations) return avg