Bouke Woudstra wrote:
It turned out that some flac files have tags like Artist=artistname and others
have artist=artistname. Therefore it couldn't find the artist! So now I just
look for 'rtist=' which works great.
You might want try using something like this:
wanted = set('artist album date title tracknumber genre'.split())
...
def read_and_call(self, flac, source):
parts = {}
for line in source:
try:
head, remainder = line.split('=', 1)
except ValueError:
pass # No equal sign in the line
else:
head = head.strip().lower()
if head in wanted:
parts[head] = remainder.strip()
self.wav2mp3(flac, **parts)
--
http://mail.python.org/mailman/listinfo/python-list