summaryrefslogtreecommitdiffstats
path: root/Lib/plat-irix5
diff options
context:
space:
mode:
authorSjoerd Mullender <sjoerd@acm.org>1995-02-01 14:23:37 (GMT)
committerSjoerd Mullender <sjoerd@acm.org>1995-02-01 14:23:37 (GMT)
commit3d697ce447a74e4979d578bc729b977b88a6e2d3 (patch)
tree1789f97627b2aab80a598348b16073f3610724c2 /Lib/plat-irix5
parentd09b41bf05a05a27a0cb49d9d050c36a25a0342f (diff)
downloadcpython-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-xLib/plat-irix5/cddb.py13
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]