selector.cleanup
This module is for cleaning up temporary files.
Classes
|
Cleaning up old, unused temp files. |
- class selector.cleanup.TempFileCleaner(logger, temp_dir=None, age_limit=600)[source]
Bases:
objectCleaning up old, unused temp files.
Note
Only in use if scenario.cleanup is True.
- Parameters:
logger (logging.Logger) – Initialized logging object.
temp_dir (str) – Path to the temporary directory.
age_limit (int) – Number of seconds a file can exist unused before removal.
- file_in_use(file_path)[source]
Check if the file is locked or in use.
- Parameters:
file_path (str) – Path to the file to look after.
- Returns:
Whether the file is in use.
- Return type:
bool