summaryrefslogtreecommitdiff
path: root/libmat2
diff options
context:
space:
mode:
authorjvoisin2019-10-17 23:02:17 +0200
committerjvoisin2019-10-17 23:02:17 +0200
commit655c19d17d05a2a40a7d27555c5b94fd40a44c58 (patch)
treeeff81573f82be647e316b11bf09292f18a7f7c69 /libmat2
parenta389cc760aebc621bfc4016f6393d0ce2381d2d1 (diff)
Improve a bit the support for ppt files
Diffstat (limited to 'libmat2')
-rw-r--r--libmat2/office.py19
1 files changed, 10 insertions, 9 deletions
diff --git a/libmat2/office.py b/libmat2/office.py
index 52bf7c5..62d3b05 100644
--- a/libmat2/office.py
+++ b/libmat2/office.py
@@ -77,25 +77,26 @@ class MSOfficeParser(ZipParser):
77 self.files_to_keep = set(map(re.compile, { # type: ignore 77 self.files_to_keep = set(map(re.compile, { # type: ignore
78 r'^\[Content_Types\]\.xml$', 78 r'^\[Content_Types\]\.xml$',
79 r'^_rels/\.rels$', 79 r'^_rels/\.rels$',
80 r'^word/_rels/document\.xml\.rels$', 80 r'^(?:word|ppt)/_rels/document\.xml\.rels$',
81 r'^word/_rels/footer[0-9]*\.xml\.rels$', 81 r'^(?:word|ppt)/_rels/footer[0-9]*\.xml\.rels$',
82 r'^word/_rels/header[0-9]*\.xml\.rels$', 82 r'^(?:word|ppt)/_rels/header[0-9]*\.xml\.rels$',
83 r'^ppt/slideLayouts/_rels/slideLayout[0-9]+\.xml\.rels$',
83 84
84 # https://msdn.microsoft.com/en-us/library/dd908153(v=office.12).aspx 85 # https://msdn.microsoft.com/en-us/library/dd908153(v=office.12).aspx
85 r'^word/stylesWithEffects\.xml$', 86 r'^(?:word|ppt)/stylesWithEffects\.xml$',
86 })) 87 }))
87 self.files_to_omit = set(map(re.compile, { # type: ignore 88 self.files_to_omit = set(map(re.compile, { # type: ignore
88 r'^customXml/', 89 r'^customXml/',
89 r'webSettings\.xml$', 90 r'webSettings\.xml$',
90 r'^docProps/custom\.xml$', 91 r'^docProps/custom\.xml$',
91 r'^word/printerSettings/', 92 r'^(?:word|ppt)/printerSettings/',
92 r'^word/theme', 93 r'^(?:word|ppt)/theme',
93 r'^word/people\.xml$', 94 r'^(?:word|ppt)/people\.xml$',
94 r'^word/numbering\.xml$', 95 r'^(?:word|ppt)/numbering\.xml$',
95 96
96 # we have an allowlist in self.files_to_keep, 97 # we have an allowlist in self.files_to_keep,
97 # so we can trash everything else 98 # so we can trash everything else
98 r'^word/_rels/', 99 r'^(?:word|ppt)/_rels/',
99 })) 100 }))
100 101
101 if self.__fill_files_to_keep_via_content_types() is False: 102 if self.__fill_files_to_keep_via_content_types() is False: