MCPcopy Create free account
hub / github.com/psf/cachecontrol / get

Method get

cachecontrol/caches/file_cache.py:65–72  ·  view source on GitHub ↗
(self, key: str)

Source from the content-addressed store, hash-verified

63 return os.path.join(self.directory, *parts)
64
65 def get(self, key: str) -> bytes | None:
66 name = self._fn(key)
67 try:
68 with open(name, "rb") as fh:
69 return fh.read()
70
71 except FileNotFoundError:
72 return None
73
74 def set(
75 self, key: str, value: bytes, expires: int | datetime | None = None

Callers

nothing calls this directly

Calls 2

_fnMethod · 0.95
readMethod · 0.80

Tested by

no test coverage detected