[gnome-applets] invest-applet: ignore unknown stocks, fixes part of bug #608842 - see https://bugzilla.gnome.org/sho



commit 9be66818e7b75df4db86b88154c7df47afda9a79
Author: Enrico Minack <enrico-minack gmx de>
Date:   Wed Jun 29 21:49:43 2011 +0200

    invest-applet: ignore unknown stocks, fixes part of bug #608842
    - see https://bugzilla.gnome.org/show_bug.cgi?id=608842#c5

 invest-applet/invest/quotes.py |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)
---
diff --git a/invest-applet/invest/quotes.py b/invest-applet/invest/quotes.py
index 4d09426..38eed6a 100644
--- a/invest-applet/invest/quotes.py
+++ b/invest-applet/invest/quotes.py
@@ -271,6 +271,11 @@ class QuoteUpdater(Gtk.ListStore):
 			for ticker, val in quote_items:
 				pb = None
 
+				# ignore unknown stocks
+				if ticker not in invest.STOCKS.keys():
+					invest.debug("Observed unknown stock: %s" % ticker)
+					continue
+
 				# get the label of this stock for later reuse
 				label = invest.STOCKS[ticker]["label"]
 				if len(label) == 0:



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]