X-Git-Url: https://git.kaliko.me/?a=blobdiff_plain;f=sima%2Flib%2Fmeta.py;h=2adac1376b3b972f29acb1ac48df645910448a5c;hb=4354c875088ac413824ad881505676de417e19bf;hp=5c439c5742df959d36f17b9488d1f0fd357db178;hpb=f614be482ffd50db26939583fd43e8708c175b95;p=mpd-sima.git diff --git a/sima/lib/meta.py b/sima/lib/meta.py index 5c439c5..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 @@ -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 = []