From c67bbafb2c60782096af4f6225d94e18225d2ecf Mon Sep 17 00:00:00 2001 From: jvoisin Date: Mon, 1 Oct 2018 22:26:35 +0200 Subject: Use [Content_Types].xml to improve MS Office coverage --- libmat2/archive.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'libmat2/archive.py') diff --git a/libmat2/archive.py b/libmat2/archive.py index d812531..b29d690 100644 --- a/libmat2/archive.py +++ b/libmat2/archive.py @@ -17,7 +17,7 @@ class ArchiveBasedAbstractParser(abstract.AbstractParser): """ Office files (.docx, .odt, …) are zipped files. """ # Those are the files that have a format that _isn't_ # supported by MAT2, but that we want to keep anyway. - files_to_keep = set() # type: Set[str] + files_to_keep = set() # type: Set[Pattern] # Those are the files that we _do not_ want to keep, # no matter if they are supported or not. @@ -89,7 +89,7 @@ class ArchiveBasedAbstractParser(abstract.AbstractParser): abort = True continue - if item.filename in self.files_to_keep: + if any(map(lambda r: r.search(item.filename), self.files_to_keep)): # those files aren't supported, but we want to add them anyway pass elif any(map(lambda r: r.search(item.filename), self.files_to_omit)): -- cgit v1.3