FileRemoverMixin
A helper class to delete files from the system.
Source code in tools/mixins/file_remover.py
7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 | |
remove_all(filepaths)
Deletes all the files in the given iterable or path.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
filepaths
|
Union[List[Path], Tuple[Path], Path]
|
A list of paths, a tuple of paths, or a single path to delete. |
required |
Raises:
| Type | Description |
|---|---|
TypeError
|
If the input is not a list, tuple, or Path. |
Source code in tools/mixins/file_remover.py
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 | |
remove_file(path)
Deletes one file from the system.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
path
|
Path
|
The path of the file to delete. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
bool |
bool
|
True if the file was deleted successfully, False otherwise. |
Source code in tools/mixins/file_remover.py
30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 | |