]> kaliko git repositories - mpd-sima.git/blobdiff - sima/lib/meta.py
Clean some linter warnings and errors
[mpd-sima.git] / sima / lib / meta.py
index e6b9f46229554e008422017281de51db7d9be680..f118e82dcfd19c7dce1b3d426ff2c6dd0c08485c 100644 (file)
@@ -31,6 +31,7 @@ UUID_RE = r'^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[89AB][a-f0-9]{3}-[a-f0-9]{12}$
 # separator. It is used then to split back the string to tags list.
 SEPARATOR = chr(0x1F)  # ASCII Unit Separator
 
+
 def is_uuid4(uuid):
     """Controls MusicBrainz UUID4 format
 
@@ -42,6 +43,7 @@ def is_uuid4(uuid):
         return True
     return False
 
+
 class MetaException(Exception):
     """Generic Meta Exception"""
 
@@ -61,8 +63,8 @@ def serialize(func):
     def wrapper(*args, **kwargs):
         ans = func(*args, **kwargs)
         if isinstance(ans, set):
-            return {s.replace("'", r"\'") for s in ans}
-        return ans.replace("'", r"\'")
+            return {s.replace("'", r"\'").replace('"', r'\"') for s in ans}
+        return ans.replace("'", r"\'").replace('"', r'\"')
     return wrapper
 
 
@@ -170,7 +172,7 @@ class Meta:
     @property
     def names(self):
         """aliases + name"""
-        return self.__aliases | {self.__name,}
+        return self.__aliases | {self.__name, }
 
     @property
     @serialize