* HACKING:
More unicode notes. * morituri/common/program.py: * morituri/image/table.py: * morituri/image/toc.py: * morituri/result/result.py: * morituri/rip/cd.py: * morituri/test/test_image_toc.py: Further unicode fixes, for options, CD-Text, paths, ...
This commit is contained in:
@@ -60,6 +60,8 @@ class Track:
|
||||
@type indexes: dict of number -> L{Index}
|
||||
@ivar isrc: ISRC code (12 alphanumeric characters)
|
||||
@type isrc: str
|
||||
@ivar cdtext: dictionary of CD Text information; see L{CDTEXT_KEYS}.
|
||||
@type cdtext: str -> unicode
|
||||
"""
|
||||
|
||||
number = None
|
||||
|
||||
@@ -128,16 +128,21 @@ class TocFile(object, log.Loggable):
|
||||
if m:
|
||||
key = m.group('key')
|
||||
value = m.group('value')
|
||||
# usually, value is encoded with octal escapes and in latin-1
|
||||
# FIXME: other encodings are possible, does cdrdao handle
|
||||
# them ?
|
||||
value = value.decode('string-escape').decode('latin-1')
|
||||
if key in table.CDTEXT_FIELDS:
|
||||
# FIXME: consider ISRC separate for now, but this
|
||||
# is a limitation of our parser approach
|
||||
if state == 'HEADER':
|
||||
self.table.cdtext[key] = value
|
||||
self.debug('Found disc CD-Text %s: %s', key, value)
|
||||
self.debug('Found disc CD-Text %s: %r', key, value)
|
||||
elif state == 'TRACK':
|
||||
if key != 'ISRC' or not currentTrack \
|
||||
or currentTrack.isrc is not None:
|
||||
self.debug('Found track CD-Text %s: %s', key, value)
|
||||
self.debug('Found track CD-Text %s: %r',
|
||||
key, value)
|
||||
currentTrack.cdtext[key] = value
|
||||
|
||||
# look for header elements
|
||||
|
||||
Reference in New Issue
Block a user