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

Method __setitem__

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

Source from the content-addressed store, hash-verified

11 self._label = label or self._cache_dir
12
13 def __setitem__(self, key, value):
14 if value is None:
15 debug(f'Cache value for {key} should not be set to {value}')
16 return
17
18 path = os.path.join(self._cache_dir, key)
19
20 os.makedirs(os.path.dirname(path), exist_ok=True)
21 with open(os.path.join(self._cache_dir, key), 'w') as f:
22 f.write(value)
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)):

Callers

nothing calls this directly

Calls 1

debugFunction · 0.90

Tested by

no test coverage detected