MCPcopy
hub / github.com/MinishLab/semble / find_index_from_cache_folder

Function find_index_from_cache_folder

src/semble/cache.py:23–32  ·  view source on GitHub ↗

Finds an index from a cache folder and a project path.

(path: str)

Source from the content-addressed store, hash-verified

21
22
23def find_index_from_cache_folder(path: str) -> Path:
24 """Finds an index from a cache folder and a project path."""
25 if is_git_url(path):
26 data = path.encode("utf-8")
27 else:
28 normalized = Path(path).expanduser().resolve()
29 data = str(normalized).encode("utf-8")
30 subdir_path = hashlib.new("sha256", data).hexdigest()
31 cache_dir = resolve_cache_folder() / subdir_path
32 return cache_dir / "index"
33
34
35def _windows_cache_dir(name: str) -> Path:

Callers 6

_maybe_save_indexFunction · 0.90
clear_cacheFunction · 0.85
save_index_to_cacheFunction · 0.85
get_validated_cacheFunction · 0.85

Calls 3

is_git_urlFunction · 0.90
resolve_cache_folderFunction · 0.85
encodeMethod · 0.45