]> kaliko git repositories - mpd-sima.git/blobdiff - sima/lib/meta.py
Fixed lastfm API use
[mpd-sima.git] / sima / lib / meta.py
index 5c439c5742df959d36f17b9488d1f0fd357db178..2adac1376b3b972f29acb1ac48df645910448a5c 100644 (file)
 Defines some object to handle audio file metadata
 """
 
-import collections.abc  # python >= 3.3
+try:
+    from collections.abc import Set # python >= 3.3
+except ImportError:
+    from collections import Set # python 3.2
 import logging
 import re
 
@@ -71,8 +74,8 @@ class Meta:
                 is_uuid4(kwargs.get('mbid'))
                 self.__mbid = kwargs.pop('mbid').lower()
             except WrongUUID4:
-                self.log.warning('Wrong mbid {}:{}'.format(self.__name,
-                                                         kwargs.get('mbid')))
+                self.log.warning('Wrong mbid %s:%s', self.__name,
+                                 kwargs.get('mbid'))
             # mbid immutable as hash rests on
         self.__dict__.update(**kwargs)
 
@@ -159,7 +162,7 @@ class Artist(Meta):
             mbid = kwargs.get('musicbrainz_albumartistid').split(', ')[0]
         super().__init__(name=name, mbid=mbid)
 
-class MetaContainer(collections.abc.Set):
+class MetaContainer(Set):
 
     def __init__(self, iterable):
         self.elements = lst = []