(self)
| 128 | lackadaisical_mkdir(self.seg_dir(segment)) |
| 129 | |
| 130 | def clear(self): |
| 131 | def warn_on_cant_remove(function, path, excinfo): |
| 132 | # Not really expected, so until complaints come in, just |
| 133 | # dump a ton of information. |
| 134 | logger.warning( |
| 135 | msg='cannot clear prefetch data', |
| 136 | detail='{0!r}\n{1!r}\n{2!r}'.format(function, path, excinfo), |
| 137 | hint=('Report this as a bug: ' |
| 138 | 'a better error message should be written.')) |
| 139 | |
| 140 | shutil.rmtree(self.prefetched_dir, False, warn_on_cant_remove) |
| 141 | |
| 142 | def clear_except(self, retained_segments): |
| 143 | sn = set(s.name for s in retained_segments) |
no outgoing calls