Skip to content

Commit bd864d8

Browse files
committed
list_dirs_containing_filetype() -> find_dirs_containing_filetype()
This is done to avoid confusion with listdir_matching() (and also the Python os.listdir() from the standard library) as the "listdir" functions are returning entries (files and sub-folders) in a given path whereas this function is assembling a list of directories that fulfill a given criteria, hence the "find_dirs" prefix.
1 parent 7c89bf1 commit bd864d8

2 files changed

Lines changed: 5 additions & 4 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
* `imcflibs.pathtools.join2` can be used to join paths, much like
1111
`os.path.join` except that it will work with `java.io.File` objects as well
1212
(but doesn't support more than two path components / parameters).
13+
* `imcflibs.pathtools.find_dirs_containing_filetype`
1314
* New functions in `imcflibs.imagej.misc`:
1415
* `imcflibs.imagej.misc.calculate_mean_and_stdv`
1516
* `imcflibs.imagej.misc.elapsed_time_since`

src/imcflibs/pathtools.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -263,21 +263,21 @@ def derive_out_dir(in_dir, out_dir):
263263
return out_dir
264264

265265

266-
def list_dirs_containing_filetype(source, filetype):
267-
"""List all directories (recursive) that contain files with the given suffix.
266+
def find_dirs_containing_filetype(source, filetype):
267+
"""Recursively list directories containing files with a given suffix.
268268
269269
Parameters
270270
----------
271271
source : str
272-
Path to source dir.
272+
Path to base directory to start recursive search in.
273273
filetype : str
274274
Filetype (string pattern) that should be matched against filenames in
275275
the directories.
276276
277277
Returns
278278
-------
279279
list(str)
280-
List of all dirs that contain files of the given filetype.
280+
List of all dirs that contain files with the given suffix / filetype.
281281
"""
282282
dirs_containing_filetype = []
283283

0 commit comments

Comments
 (0)