Get the breadcrumb file path for a given URL in the cache directory. Args: cache_dir: Base cache directory url: URL being downloaded (used to generate unique directory) filename: Name of the breadcrumb file (default: info.json) Returns: Path to the brea
(cache_dir: Path, url: str, filename: str = "info.json")
| 20 | |
| 21 | |
| 22 | def get_breadcrumb_path(cache_dir: Path, url: str, filename: str = "info.json") -> Path: |
| 23 | """ |
| 24 | Get the breadcrumb file path for a given URL in the cache directory. |
| 25 | |
| 26 | Args: |
| 27 | cache_dir: Base cache directory |
| 28 | url: URL being downloaded (used to generate unique directory) |
| 29 | filename: Name of the breadcrumb file (default: info.json) |
| 30 | |
| 31 | Returns: |
| 32 | Path to the breadcrumb file |
| 33 | """ |
| 34 | cache_key = str(sanitize_url_for_path(url)) |
| 35 | artifact_dir = cache_dir / cache_key |
| 36 | return artifact_dir / filename |
| 37 | |
| 38 | |
| 39 | def read_breadcrumb(breadcrumb_path: Path) -> Optional[dict[str, Any]]: |
no test coverage detected