X-Git-Url: https://git.kaliko.me/?a=blobdiff_plain;f=sima%2Flib%2Fmeta.py;h=2adac1376b3b972f29acb1ac48df645910448a5c;hb=1c01e4a7aa37eeef825c6918fc90b154a7f4ccc7;hp=5bf1e5fbbca9c9cf93e99cb1801c25427afee101;hpb=6402445cb58902ab23298df19c020bd453914048;p=mpd-sima.git diff --git a/sima/lib/meta.py b/sima/lib/meta.py index 5bf1e5f..2adac13 100644 --- a/sima/lib/meta.py +++ b/sima/lib/meta.py @@ -21,7 +21,10 @@ 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 @@ -69,10 +72,10 @@ class Meta: if 'mbid' in kwargs and kwargs.get('mbid'): try: is_uuid4(kwargs.get('mbid')) - self.__mbid = kwargs.pop('mbid').upper() + 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 = []