From: kaliko Date: Sun, 9 Feb 2014 15:52:06 +0000 (+0100) Subject: Converging webservices plugins X-Git-Tag: mpd-sima/0.12.0pr4~29 X-Git-Url: https://git.kaliko.me/?a=commitdiff_plain;h=279a3160534cad04c64c0d0b17f437c08ebb2703;p=mpd-sima.git Converging webservices plugins --- diff --git a/sima/plugins/internal/echonest.py b/sima/plugins/internal/echonest.py index 4cd2f1d..a5c1ede 100644 --- a/sima/plugins/internal/echonest.py +++ b/sima/plugins/internal/echonest.py @@ -13,7 +13,7 @@ from hashlib import md5 # local import from ...lib.plugin import Plugin -from ...lib.simaecho import SimaEch, EchoError, EchoNotFound +from ...lib.simaecho import SimaEch, EchoError from ...lib.track import Track from ...lib.meta import Artist @@ -182,13 +182,10 @@ class EchoNest(Plugin): try: # TODO: let's propagate Artist type [as_art.append(str(art)) for art in as_artists] - except EchoNotFound as err: - self.log.warning(err) except EchoError as err: self.log.warning('EchoNest: {0}'.format(err)) if as_art: - self.log.debug('Fetched {0} artist(s) from echonest'.format( - len(as_art))) + self.log.debug('Fetched {0} artist(s)'.format(len(as_art))) self.log.debug('x-ratelimit-remaining: {}'.format(SimaEch.ratelimit)) return as_art diff --git a/sima/plugins/internal/lastfm.py b/sima/plugins/internal/lastfm.py index 0cb3532..9ca859f 100644 --- a/sima/plugins/internal/lastfm.py +++ b/sima/plugins/internal/lastfm.py @@ -13,7 +13,7 @@ from hashlib import md5 # local import from ...lib.plugin import Plugin -from ...lib.simafm import SimaFM, WSHTTPError, WSNotFound, WSError +from ...lib.simafm import SimaFM, WSError from ...lib.track import Track from ...lib.meta import Artist @@ -186,14 +186,10 @@ class Lastfm(Plugin): try: # TODO: let's propagate Artist type [as_art.append((str(a), m)) for a, m in as_artists] - except WSHTTPError as err: - self.log.warning('last.fm http error: %s' % err) - except WSNotFound as err: - self.log.warning("last.fm: %s" % err) except WSError as err: - self.log.warning('last.fm module error: %s' % err) + self.log.warning('Last.fm: {0}'.format(err)) if as_art: - self.log.debug('Fetched %d artist(s) from last.fm' % len(as_art)) + self.log.debug('Fetched {0} artist(s)'.format(len(as_art))) return as_art def get_recursive_similar_artist(self):