utils.files module¶
-
class
IMTreatment.utils.files.
Files
[source]¶ Bases:
object
-
IMTreatment.utils.files.
remove_files_in_dirs
(rootpath, dir_regex, file_regex, depth='all', remove_dir=False, remove_files=True)[source]¶ make a recursive search for directories satisfying “dir_regex’ from “rootpath”, and remove all the files satisfying ‘file_regex’ in it.
Parameters: - rootpath (string) – Path where to begin searching.
- dir_regex (string) – Regular expression matching the directory where we want to remove stuff.
- file_regex (string) – Regular expression matching the files we want to delete.
- depth (integer or 'all') – Number of directory layer to go through.
- remove_dir –