MCPcopy Create free account
hub / github.com/dflook/terraform-github-actions / __getitem__

Method __getitem__

image/src/github_actions/cache.py:25–31  ·  view source on GitHub ↗
(self, key)

Source from the content-addressed store, hash-verified

23 debug(f'Wrote {key} to {self._label}')
24
25 def __getitem__(self, key):
26 if os.path.isfile(os.path.join(self._cache_dir, key)):
27 with open(os.path.join(self._cache_dir, key)) as f:
28 debug(f'Read {key} from {self._label}')
29 return f.read()
30
31 raise IndexError(key)
32
33 def __contains__(self, key):
34 return os.path.isfile(os.path.join(self._cache_dir, key))

Callers

nothing calls this directly

Calls 1

debugFunction · 0.90

Tested by

no test coverage detected