* morituri/image/image.py:

If paths are relative, make them relative to cue file.
This commit is contained in:
Thomas Vander Stichele
2009-04-11 21:57:45 +00:00
parent 6804df4b73
commit 59ebcc85ad
2 changed files with 10 additions and 1 deletions

View File

@@ -1,3 +1,8 @@
2009-04-11 Thomas Vander Stichele <thomas at apestaart dot org>
* morituri/image/image.py:
If paths are relative, make them relative to cue file.
2009-04-11 Thomas Vander Stichele <thomas at apestaart dot org>
* morituri/common/task.py:

View File

@@ -45,8 +45,12 @@ class Image:
if os.path.exists(path):
return path
# .cue FILE statements have Windows-style path separators
# .cue FILE statements have Windows-style path separators, so convert
tpath = os.path.join(*path.split('\\'))
# if the path is relative, make it absolute relative to the cue file
if tpath != os.path.abspath(tpath):
tpath = os.path.join(os.path.dirname(self._path), tpath)
noext, _ = os.path.splitext(tpath)
for ext in ['wav', 'flac']:
cpath = '%s.%s' % (noext, ext)