Skip to content

Commit

Permalink
YDA-5992: replace itertools.ifilter with filter
Browse files Browse the repository at this point in the history
  • Loading branch information
lwesterhof committed Nov 29, 2024
1 parent dfb2ae9 commit 2bd3364
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions vault.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
__copyright__ = 'Copyright (c) 2019-2024, Utrecht University'
__license__ = 'GPLv3, see LICENSE'

import itertools
import os
import re
import subprocess
Expand Down Expand Up @@ -285,9 +284,7 @@ def api_vault_unpreservable_files(ctx, coll, list_name):
collection.data_objects(ctx, coll, recursive=True))

# Exclude Yoda metadata files
data_names = itertools.ifilter(lambda
x: not re.match(r"yoda\-metadata(\[\d+\])?\.(xml|json)", x),
data_names)
data_names = filter(lambda x: not re.match(r"yoda\-metadata(\[\d+\])?\.(xml|json)", x), data_names)

# Data names -> lowercase extensions, without the dot.
exts = set(list(map(lambda x: os.path.splitext(x)[1][1:].lower(), data_names)))
Expand Down

0 comments on commit 2bd3364

Please sign in to comment.