cleanup¶
Summary¶
- cleanup(temp_dir, directories, files, should_delete)¶
This function serves as an aggregate entrypoint for the other two. Most functions, that need this functionality from other files will call this function rather than the calling remove_temp_directories and remove_temp_files directly. It also has the added bit of handling whether or not to delete the temporary directory (which is determined by whether or not we created the directory. This module otherwise will leave the directory but remove all the files it knows it extracted from the .zip archive.)
- Parameters:
temp_dir (Path) – The temporary directory.
directories (list[Path]) – A list of directories to remove.
files (list[Path]) – A list of files to remove.
should_delete (bool) – A bool determining whether or not to remove the directory passed through the temp_dir parameter.
Importing¶
from cs_board_tools.utilities.filesystem import cleanup