MCPcopy
hub / github.com/django/django / get

Method get

django/core/cache/backends/filebased.py:33–41  ·  view source on GitHub ↗
(self, key, default=None, version=None)

Source from the content-addressed store, hash-verified

31 return True
32
33 def get(self, key, default=None, version=None):
34 fname = self._key_to_file(key, version)
35 try:
36 with open(fname, "rb") as f:
37 if not self._is_expired(f):
38 return pickle.loads(zlib.decompress(f.read()))
39 except FileNotFoundError:
40 pass
41 return default
42
43 def _write_content(self, file, timeout, value):
44 expiry = self.get_backend_timeout(timeout)

Callers

nothing calls this directly

Calls 5

_key_to_fileMethod · 0.95
_is_expiredMethod · 0.95
loadsMethod · 0.45
decompressMethod · 0.45
readMethod · 0.45

Tested by

no test coverage detected