3
3
__copyright__ = 'Copyright (c) 2019-2024, Utrecht University'
4
4
__license__ = 'GPLv3, see LICENSE'
5
5
6
- import itertools
7
6
import os
8
7
import re
9
8
import subprocess
@@ -264,13 +263,13 @@ def api_vault_preservable_formats_lists(ctx):
264
263
265
264
@api .make ()
266
265
def api_vault_unpreservable_files (ctx , coll , list_name ):
267
- """Retrieve the set of unpreservable file formats in a collection.
266
+ """Retrieve list of unpreservable file formats in a collection.
268
267
269
268
:param ctx: Combined type of a callback and rei struct
270
269
:param coll: Collection of folder to check
271
270
:param list_name: Name of preservable file format list
272
271
273
- :returns: Set of unpreservable file formats
272
+ :returns: List of unpreservable file formats
274
273
"""
275
274
space , zone , _ , _ = pathutil .info (coll )
276
275
if space not in [pathutil .Space .RESEARCH , pathutil .Space .VAULT ]:
@@ -285,9 +284,7 @@ def api_vault_unpreservable_files(ctx, coll, list_name):
285
284
collection .data_objects (ctx , coll , recursive = True ))
286
285
287
286
# Exclude Yoda metadata files
288
- data_names = itertools .ifilter (lambda
289
- x : not re .match (r"yoda\-metadata(\[\d+\])?\.(xml|json)" , x ),
290
- data_names )
287
+ data_names = filter (lambda x : not re .match (r"yoda\-metadata(\[\d+\])?\.(xml|json)" , x ), data_names )
291
288
292
289
# Data names -> lowercase extensions, without the dot.
293
290
exts = set (list (map (lambda x : os .path .splitext (x )[1 ][1 :].lower (), data_names )))
0 commit comments