(self, key)
| 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)) |