]> kaliko git repositories - mpd-sima.git/blobdiff - sima/plugins/internal/tags.py
Big cleanup, pyling warning, style, error
[mpd-sima.git] / sima / plugins / internal / tags.py
index 2e1ddac2dcee7ad97cf24b1de8bdebc09d50fe28..c891b779893f50f232d3d3b2bfab7f6d8e151b37 100644 (file)
@@ -1,5 +1,5 @@
 # -*- coding: utf-8 -*-
-# Copyright (c) 2020 kaliko <kaliko@azylum.org>
+# Copyright (c) 2020, 2021 kaliko <kaliko@azylum.org>
 #
 #  This file is part of sima
 #
@@ -42,13 +42,13 @@ def control_config(tags_config):
     if not tags_config.get('filter', None) and \
             config_tags.isdisjoint(sup_tags):
         log.warning('Found no config for Tags plugin! '
-                  'Need at least "filter" or a supported tag')
+                    'Need at least "filter" or a supported tag')
         log.info('Supported Tags are : %s', ', '.join(sup_tags))
         # raise PluginException('plugin misconfiguration')
         return False
     if config_tags.difference(sup_tags):
         log.error('Found unsupported tag in config: %s',
-                   config_tags.difference(sup_tags))
+                  config_tags.difference(sup_tags))
         # raise PluginException('plugin misconfiguration')
         return False
     return True
@@ -117,9 +117,9 @@ class Tags(AdvancedPlugin):
             if self.plugin_conf['filter']:
                 # Use window to limit response size
                 self.player.find(self.plugin_conf['filter'], "window", (0, 1))
-        except CommandError:
+        except CommandError as err:
             raise PluginException('Badly formated filter in tags plugin configuration: "%s"'
-                                  % self.plugin_conf['filter'])
+                                  % self.plugin_conf['filter']) from err
 
     def callback_need_track(self):
         candidates = []