• Home
  • Raw
  • Download

Lines Matching refs:path

227       path: str,
235 self.path = path
247 def __init__(self, path: str):
248 self.path = pathlib.Path(path)
251 def add(self, path: pathlib.Path, timestamp: float) -> str:
253 cache_key = path.as_posix() + str(timestamp)
256 content = path.read_bytes()
258 content_path = self.path.joinpath(content_hash[:2], content_hash[2:])
267 file_path = self.path.joinpath(content_hash[:2], content_hash[2:])
285 return self.path.joinpath('cache.json')
327 compose = lambda inner, outer: lambda path: outer(inner(path))
329 lambda path: path
330 if os.path.isabs(path)
331 else os.path.join(root_path, path)
342 def _is_excluded(self, path: str, exclude_paths: list[pathlib.Path]) -> bool:
345 path.startswith(exclude_path) for exclude_path in exclude_paths
356 path
357 for path in paths
358 if not self._is_excluded(os.path.join(root, path), exclude_paths)
400 def process_directory(path: pathlib.Path) -> None:
401 if path.is_symlink():
402 process_link(path)
404 relative_path = path.relative_to(root_path).as_posix()
411 permissions=path.stat().st_mode,
416 def process_file(path: pathlib.Path) -> None:
417 if path.is_symlink():
418 process_link(path)
420 relative_path = path.relative_to(root_path).as_posix()
421 timestamp = path.stat().st_mtime
425 content_hash=self._blob_store.add(path, timestamp)
426 if path.stat().st_size
428 permissions=path.stat().st_mode,
433 def process_link(path: pathlib.Path) -> None:
434 relative_path = path.relative_to(root_path).as_posix()
435 symlink_target = path.readlink()
450 def process_path(path: pathlib.Path) -> None:
451 if self._is_excluded(path.as_posix(), exclude_paths):
453 if path.is_symlink():
454 process_link(path)
455 elif path.is_file():
456 process_file(path)
457 elif path.is_dir():
458 process_directory(path)
459 for root, directories, files in os.walk(path):
469 logging.error('Unexpected path type: %s', path.as_posix())
471 for path in include_paths:
472 process_path(pathlib.Path(path))