From 80142f3601c48b627eeb08b3685db230e4a8cefb Mon Sep 17 00:00:00 2001 From: kaliko Date: Tue, 8 Jun 2021 16:30:01 +0200 Subject: [PATCH] PlayerError inherit from MPDError instead of plain Exception --- sima/mpdclient.py | 2 +- sima/utils/blcli.py | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/sima/mpdclient.py b/sima/mpdclient.py index 539f8b8..1d86813 100644 --- a/sima/mpdclient.py +++ b/sima/mpdclient.py @@ -32,7 +32,7 @@ from .lib.simastr import SimaStr from .utils.leven import levenshtein_ratio -class PlayerError(Exception): +class PlayerError(MPDError): """Fatal error in the player.""" diff --git a/sima/utils/blcli.py b/sima/utils/blcli.py index 5f0d14a..63d3bf4 100644 --- a/sima/utils/blcli.py +++ b/sima/utils/blcli.py @@ -21,7 +21,7 @@ import atexit import sys # local import -from ..mpdclient import MPD, PlayerError, Artist, Album +from ..mpdclient import MPD, MPDError, Artist, Album from ..lib.simadb import SimaDB @@ -37,7 +37,7 @@ class BLCli(MPD): return try: getattr(self, cmd.replace('-', '_'))() - except PlayerError as err: + except MPDError as err: self.log.error(err) sys.exit(1) @@ -46,14 +46,14 @@ class BLCli(MPD): for entry in ['artist', 'album', 'title']: header = False for bl in blocklist: - art = bl.get(entry, '') + val = bl.get(entry, '') mbid = bl.get(f'musicbrainz_{entry}', '') - if art or mbid: + if val or mbid: if not header: header = True self.log.info(f'{entry.capitalize()}' '(id name musicbranzID):') - self.log.info(f'{bl["id"]} "{art}"\t\t{mbid}') + self.log.info(f'{bl["id"]} "{val}"\t\t{mbid}') def bl_add_artist(self): artist = self.options.get('artist', None) -- 2.39.5