def _prefix_destdir(path):
     destdir = subst_vars("$destdir", variables)
     if path:
         tail = explode_path(path)[1:]
         if not tail:
             raise ValueError("Invalid target directory in section %r " "(not absolute: %r)" % (name, path))
         return os.path.join(destdir, os.path.join(*tail))
     else:
         raise ValueError("Invalid target directory in section " "%r: %r" % (name, path))
 def _prefix_destdir(path):
     destdir = subst_vars("$destdir", variables)
     if path:
         tail = explode_path(path)[1:]
         if not tail:
             raise ValueError("Invalid target directory in section %r "
                              "(not absolute: %r)" % (name, path))
         return os.path.join(destdir, os.path.join(*tail))
     else:
         raise ValueError("Invalid target directory in section "
                          "%r: %r" % (name, path))
Example #3
0
 def test_empty(self):
     path = ""
     self.assertEqual(explode_path(path), [])
Example #4
0
 def test_ends_with_sep(self):
     path = "/home/joe/"
     self.assertEqual(explode_path(path), ["/", "home", "joe"])
Example #5
0
    def test_simple(self):
        path = "/home/joe"
        self.assertEqual(explode_path(path), ["/", "home", "joe"])

        path = "home/joe"
        self.assertEqual(explode_path(path), ["home", "joe"])
Example #6
0
 def test_empty(self):
     path = ""
     self.assertEqual(explode_path(path), [])
Example #7
0
 def test_ends_with_sep(self):
     path = "/home/joe/"
     self.assertEqual(explode_path(path), ["/", "home", "joe"])
Example #8
0
    def test_simple(self):
        path = "/home/joe"
        self.assertEqual(explode_path(path), ["/", "home", "joe"])

        path = "home/joe"
        self.assertEqual(explode_path(path), ["home", "joe"])