diff options
author | Anton Khirnov <wyskas@gmail.com> | 2009-03-08 09:57:22 +0100 |
---|---|---|
committer | Anton Khirnov <wyskas@gmail.com> | 2009-03-08 09:57:22 +0100 |
commit | 8f840736903fd821a5f49d5b0f72f83b4136990c (patch) | |
tree | d77f7e7a22cc9d852054e7330c28a80c56e9ff7d /nephilim | |
parent | 7599d034923a62c14e21d492306609e91a2bc8da (diff) |
Lyrics: check for exceptions when fetching lyrics.
Diffstat (limited to 'nephilim')
-rw-r--r-- | nephilim/plugins/Lyrics.py | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/nephilim/plugins/Lyrics.py b/nephilim/plugins/Lyrics.py index 3bffe49..0c3e4af 100644 --- a/nephilim/plugins/Lyrics.py +++ b/nephilim/plugins/Lyrics.py @@ -1,8 +1,8 @@ from PyQt4 import QtGui,QtCore from PyQt4.QtCore import QVariant -from thread import start_new_thread import logging +import socket from ..plugin import Plugin import LyricWiki_client @@ -74,7 +74,10 @@ class Lyrics(Plugin): req = LyricWiki_client.getSongRequest() req.Artist = song.artist() req.Song = song.title() - result = soap.getSong(req).Return.Lyrics.decode('utf-8').encode('iso8859').decode('utf-8') + try: + result = soap.getSong(req).Return.Lyrics.decode('utf-8').encode('iso8859').decode('utf-8') + except socket.error, e: + logging.error('Error downloading lyrics from LyricWiki: %s.'%e) + return None return result if result != 'Not found' else None - |