Skip to content

Commit

Permalink
Filename filter lost code
Browse files Browse the repository at this point in the history
  • Loading branch information
stijn-uva committed Oct 23, 2024
1 parent f98addc commit c479a85
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions backend/lib/processor.py
Original file line number Diff line number Diff line change
Expand Up @@ -497,6 +497,8 @@ def iterate_archive_contents(self, path, staging_area=None, immediately_delete=T
:param bool immediately_delete: Temporary files are removed after yielded;
False keeps files until the staging_area is removed (usually during processor
cleanup)
:param list filename_filter: Whitelist of filenames to iterate.
Other files will be ignored. If empty, do not ignore anything.
:return: An iterator with a Path item for each file
"""

Expand All @@ -513,6 +515,9 @@ def iterate_archive_contents(self, path, staging_area=None, immediately_delete=T
archive_contents = sorted(archive_file.namelist())

for archived_file in archive_contents:
if filename_filter and archived_file not in filename_filter:
continue

info = archive_file.getinfo(archived_file)
if info.is_dir():
continue
Expand Down

0 comments on commit c479a85

Please sign in to comment.