summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnton Khirnov <anton@khirnov.net>2013-04-25 07:59:58 +0200
committerAnton Khirnov <anton@khirnov.net>2013-04-25 10:00:20 +0200
commit0bc4b4ea73464e175012c89251d685a5992efaf1 (patch)
tree003e3a8c97b6d3d5bbd4cb70a49fb12059069c06
parent8901b6955f1c74436c2033b4a8ac43f01a067682 (diff)
song: drop SongRef
It adds a lot of complexity for little real benefit.
-rw-r--r--nephilim/song.py21
1 files changed, 0 insertions, 21 deletions
diff --git a/nephilim/song.py b/nephilim/song.py
index 709934a..d68b21c 100644
--- a/nephilim/song.py
+++ b/nephilim/song.py
@@ -26,7 +26,6 @@ class Song(dict):
Song provides a dictionary-like wrapper around song metadata.
Its instances are generated by MPClient, don't instantiate it
directly.
- Its instances _shouldn't_ be stored, use SongRef for that.
Access '?tag' to get always at least an empty string.
"""
@@ -89,23 +88,3 @@ class Song(dict):
ret = Template(s)
ret = ret.safe_substitute(self)
return ret
-
-class SongRef:
- """SongRef stores only a reference to the song (uri) instead
- of full metadata to conserve memory. Song's tags can be accessed
- as in Song, but it requires a call to MPD for each tag. """
- path = None
- mpclient = None
-
- def __init__(self, mpclient, path):
- self.mpclient = mpclient
- self.path = path
-
- def __getitem__(self, key):
- return self.song()[key]
-
- def __nonzero__(self):
- return bool(self.path)
-
- def song(self):
- return list(self.mpclient.find_sync('file', self.path))[0]