]> kaliko git repositories - mpd-goodies.git/blobdiff - lib/mpdutils.py
* fixes some bugs on mtopls
[mpd-goodies.git] / lib / mpdutils.py
index a64d23908d0e5be0776200ee7a766597b7641c37..ea58b89c6b8f66a687f0d6f56b27e70ccbeb9a37 100644 (file)
@@ -73,7 +73,7 @@ def mpdAuth(client, secret):#{{{
     return True#}}}
 
 
-def mconnect():
+def mconnect():#{{{
     """"""
     ## get connection id
     con_id, passwd = get_mpd_environ()
@@ -95,7 +95,14 @@ def mconnect():
             print 'ERROR: fail trying to pass auth. Check password?'
             client.disconnect()
             sys.exit(1)
-    return client
+    return client#}}}
+
+def collapse_tags(value):
+    if isinstance(value, list):
+        #self.__dict__[tag] = ", ".join(set(value))
+        self.collapse_tags_bool = True
+        return ', '.join(set(value))
+    return value#}}}
 
 # Script starts here
 if __name__ == '__main__':