[SCM] morituri/master: * morituri/image/image.py: If paths are relative, make them relative to cue file.

js at users.alioth.debian.org js at users.alioth.debian.org
Sun Oct 19 20:08:44 UTC 2014


The following commit has been merged in the master branch:
commit 59ebcc85adf41f055766efa43bf308b6ec23fdf4
Author: Thomas Vander Stichele <thomas (at) apestaart (dot) org>
Date:   Sat Apr 11 21:57:45 2009 +0000

    	* morituri/image/image.py:
    	  If paths are relative, make them relative to cue file.

diff --git a/ChangeLog b/ChangeLog
index 0cbaa6e..8a18f44 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,10 @@
 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:
 	  clear with whitespace.
 
diff --git a/morituri/image/image.py b/morituri/image/image.py
index e0ea5df..2dd07a3 100644
--- a/morituri/image/image.py
+++ b/morituri/image/image.py
@@ -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)

-- 
morituri packaging



More information about the pkg-multimedia-commits mailing list