(self, timeout)
| 300 | os.remove(path) |
| 301 | |
| 302 | def cleanup(self, timeout): |
| 303 | if not os.path.isdir(self.root): |
| 304 | return |
| 305 | |
| 306 | now = time.time() |
| 307 | for f in os.listdir(self.root): |
| 308 | path = self._get_path(f) |
| 309 | atime = os.stat(path).st_atime |
| 310 | if now - atime > timeout: |
| 311 | if os.path.isdir(path): |
| 312 | shutil.rmtree(path) |
| 313 | else: |
| 314 | os.remove(path) |
| 315 | |
| 316 | |
| 317 | class DBStore(Store): |