diff options
author | Anton Khirnov <wyskas@gmail.com> | 2010-04-30 08:10:56 +0200 |
---|---|---|
committer | Anton Khirnov <wyskas@gmail.com> | 2010-04-30 08:10:56 +0200 |
commit | 1ff1ec58b8ad638e7ffa901a38351cecb3478320 (patch) | |
tree | 989be504d32215adef01a5cc2fdd68cd213cacc1 /nephilim/song.py | |
parent | 60088b7f5c672a3544edbacd88020e591017f653 (diff) |
song: raise KeyError instead of returning empty string
Diffstat (limited to 'nephilim/song.py')
-rw-r--r-- | nephilim/song.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/nephilim/song.py b/nephilim/song.py index fb18ed3..6cf0a6b 100644 --- a/nephilim/song.py +++ b/nephilim/song.py @@ -65,7 +65,10 @@ class Song(dict): return self['file'] elif key == 'albumartist': return self['artist'] - return '' + elif key == 'songdir': + return os.path.dirname(self['file']) + + raise KeyError def __contains__(self, item): if dict.__contains__(self, item): |