Skip to content

Commit

Permalink
Little fix in function for recursive find sources (#95)
Browse files Browse the repository at this point in the history
* Avoid filtering for direct file calls
  • Loading branch information
yasakova-anastasia authored Jan 20, 2021
1 parent 529cc6a commit 30c0648
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions datumaro/components/extractor.py
Original file line number Diff line number Diff line change
Expand Up @@ -623,11 +623,11 @@ def _find_sources_recursive(cls, path, ext, extractor_name,
sources = []
for d in range(max_depth + 1):
sources.extend({'url': p, 'format': extractor_name} for p in
iglob(osp.join(path, *('*' * d), dirname, filename + ext)))
iglob(osp.join(path, *('*' * d), dirname, filename + ext))
if (callable(file_filter) and file_filter(p)) \
or (not callable(file_filter)))
if sources:
break
if callable(file_filter):
sources = [s for s in sources if file_filter(s['url'])]
return sources

class Transform(Extractor):
Expand Down

0 comments on commit 30c0648

Please sign in to comment.