]> kaliko git repositories - mpd-sima.git/blobdiff - sima/lib/meta.py
Ensure python 3.2 compatibility
[mpd-sima.git] / sima / lib / meta.py
index 5bf1e5fbbca9c9cf93e99cb1801c25427afee101..cf130969b3193f7838d0200cc7654356dfbba9d5 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
 
@@ -69,7 +72,7 @@ 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')))
@@ -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 = []