def _committers_py_path(self): # extension can sometimes be .pyc, we always want .py (path, extension) = os.path.splitext(committers.__file__) # FIXME: When we're allowed to use python 2.6 we can use the real # os.path.relpath path = relpath(path, self._checkout_root()) return ".".join([path, "py"])
def default_configuration(self): # This is a bit of a hack. This state exists in a much nicer form in # perl-land. configuration = ospath.relpath( self._webkit_build_directory(["--configuration"]), self._webkit_build_directory(["--top-level"]) ) assert configuration == "Debug" or configuration == "Release" return configuration
def default_configuration(self): # This is a bit of a hack. This state exists in a much nicer form in # perl-land. configuration = ospath.relpath( self._webkit_build_directory(["--configuration"]), self._webkit_build_directory(["--top-level"])) assert (configuration == "Debug" or configuration == "Release") return configuration
def __init__(self, cwd, patch_directories, executive=None): SCM.__init__(self, cwd, executive) self._bogus_dir = None if patch_directories == []: # FIXME: ScriptError is for Executive, this should probably be a normal Exception. raise ScriptError(script_args=svn_info_args, message='Empty list of patch directories passed to SCM.__init__') elif patch_directories == None: self._patch_directories = [ospath.relpath(cwd, self.checkout_root)] else: self._patch_directories = patch_directories
def get_relative_test_path(filename, relative_to, checkout_root=scm.find_checkout_root()): """Constructs a relative path to |filename| from |relative_to|. Args: filename: The test file we're trying to get a relative path to. relative_to: The absolute path we're relative to. Returns: A relative path to filename or None if |filename| is not below |relative_to|. """ layout_test_dir = os.path.join(checkout_root, "LayoutTests") abs_path = os.path.join(layout_test_dir, filename) return ospath.relpath(abs_path, relative_to)
def get_relative_test_path(filename, relative_to, checkout_root=scm.find_checkout_root()): """Constructs a relative path to |filename| from |relative_to|. Args: filename: The test file we're trying to get a relative path to. relative_to: The absolute path we're relative to. Returns: A relative path to filename or None if |filename| is not below |relative_to|. """ layout_test_dir = os.path.join(checkout_root, 'LayoutTests') abs_path = os.path.join(layout_test_dir, filename) return ospath.relpath(abs_path, relative_to)
def relpath(self, path, start='.'): return ospath.relpath(path, start)
def relpath(self, path, start='.'): return ospath.relpath(path, start, self.abspath, self.sep)
def _rel_path(self, path, abs_start_path): return relpath(path, abs_start_path, self.os_path_abspath)