Delete old files in "tmp".
(self)
| 478 | os.rmdir(path) |
| 479 | |
| 480 | def clean(self): |
| 481 | """Delete old files in "tmp".""" |
| 482 | now = time.time() |
| 483 | for entry in os.listdir(os.path.join(self._path, 'tmp')): |
| 484 | path = os.path.join(self._path, 'tmp', entry) |
| 485 | if now - os.path.getatime(path) > 129600: # 60 * 60 * 36 |
| 486 | os.remove(path) |
| 487 | |
| 488 | _count = 1 # This is used to generate unique file names. |
| 489 |