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

Function _maybe_save_index

src/semble/cli.py:35–42  ·  view source on GitHub ↗

Save the index to the cache folder if it was not loaded from disk.

(index: SembleIndex, path: str)

Source from the content-addressed store, hash-verified

33
34
35def _maybe_save_index(index: SembleIndex, path: str) -> None:
36 """Save the index to the cache folder if it was not loaded from disk."""
37 if not index.loaded_from_disk:
38 try:
39 cache_folder = find_index_from_cache_folder(path)
40 index.save(cache_folder)
41 except Exception as e:
42 print(f"Error saving index: {e}", file=sys.stderr)
43
44
45def _add_content_args(p: argparse.ArgumentParser) -> None:

Callers 3

_run_searchFunction · 0.85
_run_find_relatedFunction · 0.85

Calls 2

saveMethod · 0.45