From 5ac91cd4f94a822c81bd0bc55a2f7034b31eee7a Mon Sep 17 00:00:00 2001 From: Brolf Date: Wed, 20 Feb 2019 00:45:27 +0100 Subject: Refactor {black,white}list into {block,allow}list Closes #96 --- libmat2/office.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'libmat2/office.py') diff --git a/libmat2/office.py b/libmat2/office.py index f3a5b22..2c9cbff 100644 --- a/libmat2/office.py +++ b/libmat2/office.py @@ -89,7 +89,7 @@ class MSOfficeParser(ArchiveBasedAbstractParser): r'^word/theme', r'^word/people\.xml$', - # we have a whitelist in self.files_to_keep, + # we have an allowlist in self.files_to_keep, # so we can trash everything else r'^word/_rels/', })) @@ -100,7 +100,7 @@ class MSOfficeParser(ArchiveBasedAbstractParser): def __fill_files_to_keep_via_content_types(self) -> bool: """ There is a suer-handy `[Content_Types].xml` file in MS Office archives, describing what each other file contains. - The self.content_types_to_keep member contains a type whitelist, + The self.content_types_to_keep member contains a type allowlist, so we're using it to fill the self.files_to_keep one. """ with zipfile.ZipFile(self.filename) as zin: @@ -220,7 +220,7 @@ class MSOfficeParser(ArchiveBasedAbstractParser): for file_to_omit in self.files_to_omit: if file_to_omit.search(fname): matches = map(lambda r: r.search(fname), self.files_to_keep) - if any(matches): # the file is whitelisted + if any(matches): # the file is in the allowlist continue removed_fnames.add(fname) break -- cgit v1.3