diff options
author | infirit <[email protected]> | 2014-02-08 16:31:57 +0100 |
---|---|---|
committer | infirit <[email protected]> | 2014-02-08 17:26:53 +0100 |
commit | a7f9a26bd33c8df60a200736cb754814f6c6a9e8 (patch) | |
tree | bd0a1a97aa1f515dd6422f02260a7c889a1396f7 | |
parent | def0518872318b85e1663109323b64be2a7cdb9b (diff) | |
download | mate-applets-a7f9a26bd33c8df60a200736cb754814f6c6a9e8.tar.bz2 mate-applets-a7f9a26bd33c8df60a200736cb754814f6c6a9e8.tar.xz |
invest-applet: Add more debug info to quotes.py.
Based on gnome's invest applet.
-rw-r--r-- | invest-applet/invest/quotes.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/invest-applet/invest/quotes.py b/invest-applet/invest/quotes.py index 0a48dc1e..011ce4f2 100644 --- a/invest-applet/invest/quotes.py +++ b/invest-applet/invest/quotes.py @@ -58,8 +58,10 @@ class QuotesRetriever(Thread, _IdleObject): self.retrieved = False self.data = [] self.currencies = [] + invest.debug("QuotesRetriever created"); def run(self): + invest.debug("QuotesRetriever started"); quotes_url = QUOTES_URL % {"s": self.tickers} try: quotes_file = urlopen(quotes_url, proxies = mate_invest.PROXY) @@ -115,12 +117,16 @@ class QuoteUpdater(Gtk.ListStore): return False if len(mate_invest.STOCKS) == 0: + invest.debug("No stocks configured") return True tickers = '+'.join(mate_invest.STOCKS.keys()) + invest.debug("creating QuotesRetriever") quotes_retriever = QuotesRetriever(tickers) quotes_retriever.connect("completed", self.on_retriever_completed) + invest.debug("starting QuotesRetriever") quotes_retriever.start() + invest.debug("started QuotesRetriever") return True @@ -135,12 +141,14 @@ class QuoteUpdater(Gtk.ListStore): def on_retriever_completed(self, retriever): if retriever.retrieved == False: + invest.debug("QuotesRetriever failed"); tooltip = [_('Invest could not connect to Yahoo! Finance')] if self.last_updated != None: # Translators: %s is an hour (%H:%M) tooltip.append(_('Updated at %s') % self.last_updated.strftime("%H:%M")) self.set_tooltip_callback('\n'.join(tooltip)) else: + invest.debug("QuotesRetriever completed"); self.populate(self.parse_yahoo_csv(csv.reader(retriever.data))) self.updated = True self.last_updated = datetime.datetime.now() |