support path_prefix
authorFelix Domke <tmbinc@elitedvb.net>
Thu, 15 Jun 2006 17:35:05 +0000 (17:35 +0000)
committerFelix Domke <tmbinc@elitedvb.net>
Thu, 15 Jun 2006 17:35:05 +0000 (17:35 +0000)
lib/python/Tools/Directories.py

index 3204907..7c50bd9 100644 (file)
@@ -42,10 +42,14 @@ fallbackPaths = {
                SCOPE_HDD: [("/hdd/movies", PATH_MOVE)]
        }
 
-def resolveFilename(scope, base = ""):
+def resolveFilename(scope, base = "", path_prefix = None):
+       if base[0:2] == "~/":
+               # you can only use the ~/ if we have a prefix directory
+               assert path_prefix is not None
+               base = path_prefix + base[2:]
 
        # don't resolve absolute paths
-       if len(base) and base[0] == '/':
+       if base[0:1] == '/':
                return base
 
        path = defaultPaths[scope]