INNER CODE UNIT · Python

_abspath

GoogleCloudPlatform/terraform-python-testing-helper · tftest.py:348

  def _abspath(self, path):
    """Make relative path absolute from base dir."""
    path_obj = Path(path)
    if path_obj.is_absolute():
      return path
    return str(Path(self._basedir) / path)

  def _dirhash(self, directory, hash, ignore_hidden=False,
               exclude_directories=[], excluded_extensions=[]):
    """Returns hash of directory's file contents"""
    assert Path(directory).is_dir()
    try:
      dir_iter = sorted(Path(directory).iterdir(), key=lambda p: str(p).lower())
    except FileNotFoundError:
      return hash
    for path in dir_iter:
      if path.is_file():
        if ignore_hidden and path.name.startswith("."):

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…