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

Function _get_valid_user_cache_dir

src/semble/cache.py:54–64  ·  view source on GitHub ↗

Gets the user cache dir if it is set and is a valid path.

()

Source from the content-addressed store, hash-verified

52
53
54def _get_valid_user_cache_dir() -> Path | None:
55 """Gets the user cache dir if it is set and is a valid path."""
56 user_cache_location = os.getenv("SEMBLE_CACHE_LOCATION")
57 if user_cache_location is None:
58 return None
59 user_cache_dir = Path(user_cache_location)
60 if not user_cache_dir.is_absolute():
61 logger.warning("SEMBLE_CACHE_LOCATION is not an absolute path: %s", user_cache_location)
62 return None
63
64 return user_cache_dir
65
66
67def resolve_cache_folder() -> Path:

Calls

no outgoing calls