[hamster-applet] max does not like empty sets.
- From: Toms Baugis <tbaugis src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [hamster-applet] max does not like empty sets.
- Date: Fri, 9 Apr 2010 16:25:14 +0000 (UTC)
commit ed122e6862132e1bee829d1b5a8b3ecd596e1734
Author: Toms Bauģis <toms baugis gmail com>
Date: Fri Apr 9 17:25:08 2010 +0100
max does not like empty sets.
src/hamster/charting.py | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
---
diff --git a/src/hamster/charting.py b/src/hamster/charting.py
index ca2304d..7d62d6e 100644
--- a/src/hamster/charting.py
+++ b/src/hamster/charting.py
@@ -128,7 +128,7 @@ class Chart(graphics.Scene):
def plot(self, keys, data):
bars = dict([(bar.key, bar.normalized) for bar in self.bars])
- max_val = float(max(data))
+ max_val = float(max(data or [0]))
new_bars, new_labels = [], []
for key, value in zip(keys, data):
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]