diff options
author | Sjoerd Mullender <sjoerd@acm.org> | 1995-02-01 14:23:37 (GMT) |
---|---|---|
committer | Sjoerd Mullender <sjoerd@acm.org> | 1995-02-01 14:23:37 (GMT) |
commit | 3d697ce447a74e4979d578bc729b977b88a6e2d3 (patch) | |
tree | 1789f97627b2aab80a598348b16073f3610724c2 /Lib/plat-irix5 | |
parent | d09b41bf05a05a27a0cb49d9d050c36a25a0342f (diff) | |
download | cpython-3d697ce447a74e4979d578bc729b977b88a6e2d3.zip cpython-3d697ce447a74e4979d578bc729b977b88a6e2d3.tar.gz cpython-3d697ce447a74e4979d578bc729b977b88a6e2d3.tar.bz2 |
Support for album.notes and trackN.artist via notes and trackartist
instance variables.
Diffstat (limited to 'Lib/plat-irix5')
-rwxr-xr-x | Lib/plat-irix5/cddb.py | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/Lib/plat-irix5/cddb.py b/Lib/plat-irix5/cddb.py index 68d26c0..53a3981 100755 --- a/Lib/plat-irix5/cddb.py +++ b/Lib/plat-irix5/cddb.py @@ -77,10 +77,12 @@ class Cddb: self.artist = '' self.title = '' self.track = [None] + [''] * ntracks + self.trackartist = [None] + [''] * ntracks + self.notes = [] if not hasattr(self, 'file'): return import regex - reg = regex.compile('^\\([^.]*\\)\\.\\([^:]*\\):\t\\(.*\\)') + reg = regex.compile('^\\([^.]*\\)\\.\\([^:]*\\):[\t ]+\\(.*\\)') while 1: line = f.readline() if not line: @@ -101,6 +103,8 @@ class Cddb: self.toc = value if self.toc != value: print 'toc\'s don\'t match' + elif name2 == 'notes': + self.notes.append(value) elif name1[:5] == 'track': try: trackno = string.atoi(name1[5:]) @@ -112,7 +116,10 @@ class Cddb: ' in file ' + file + \ ' out of range' continue - self.track[trackno] = value + if name2 == 'title': + self.track[trackno] = value + elif name2 == 'artist': + self.trackartist[trackno] = value f.close() for i in range(2, len(self.track)): track = self.track[i] @@ -181,6 +188,8 @@ class Cddb: f.write('album.title:\t' + self.title + '\n') f.write('album.artist:\t' + self.artist + '\n') f.write('album.toc:\t' + self.toc + '\n') + for note in self.notes: + f.write('album.notes:\t' + note + '\n') prevpref = None for i in range(1, len(self.track)): track = self.track[i] |