MCPcopy Create free account
hub / github.com/bigdra50/unity-cli / get

Method get

unity_cli/api/schema_cache.py:28–37  ·  view source on GitHub ↗

Return cached schema or None if not cached.

(self, version: str)

Source from the content-addressed store, hash-verified

26 return self._dir / f"{version}.json"
27
28 def get(self, version: str) -> dict[str, Any] | None:
29 """Return cached schema or None if not cached."""
30 path = self._path(version)
31 if not path.exists():
32 return None
33 try:
34 data: dict[str, Any] = json.loads(path.read_text(encoding="utf-8"))
35 return data
36 except (json.JSONDecodeError, OSError):
37 return None
38
39 def put(self, version: str, schema: dict[str, Any]) -> None:
40 """Write schema to cache."""

Callers 1

schema_cache.pyFile · 0.45

Calls 1

_pathMethod · 0.95

Tested by

no test coverage detected