diff options
| author | jvoisin | 2020-04-02 20:58:10 +0200 |
|---|---|---|
| committer | jvoisin | 2020-04-02 20:58:10 +0200 |
| commit | 599909a7606a3109d51f9ec07a8aa40ae704c496 (patch) | |
| tree | 295852a825246ab67f1176a4640df795063ca6ca /libmat2 | |
| parent | d008b1e2f016e83180ca029d1c1a42dc5c6e0115 (diff) | |
Improve xlsx support
Diffstat (limited to 'libmat2')
| -rw-r--r-- | libmat2/office.py | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/libmat2/office.py b/libmat2/office.py index d122fc8..fe2f189 100644 --- a/libmat2/office.py +++ b/libmat2/office.py | |||
| @@ -87,16 +87,16 @@ class MSOfficeParser(ZipParser): | |||
| 87 | self.files_to_keep = set(map(re.compile, { # type: ignore | 87 | self.files_to_keep = set(map(re.compile, { # type: ignore |
| 88 | r'^\[Content_Types\]\.xml$', | 88 | r'^\[Content_Types\]\.xml$', |
| 89 | r'^_rels/\.rels$', | 89 | r'^_rels/\.rels$', |
| 90 | r'^(?:word|ppt)/_rels/document\.xml\.rels$', | 90 | r'^(?:word|ppt|xl)/_rels/document\.xml\.rels$', |
| 91 | r'^(?:word|ppt)/_rels/footer[0-9]*\.xml\.rels$', | 91 | r'^(?:word|ppt|xl)/_rels/footer[0-9]*\.xml\.rels$', |
| 92 | r'^(?:word|ppt)/_rels/header[0-9]*\.xml\.rels$', | 92 | r'^(?:word|ppt|xl)/_rels/header[0-9]*\.xml\.rels$', |
| 93 | r'^ppt/slideLayouts/_rels/slideLayout[0-9]+\.xml\.rels$', | 93 | r'^ppt/slideLayouts/_rels/slideLayout[0-9]+\.xml\.rels$', |
| 94 | r'^ppt/slideLayouts/slideLayout[0-9]+\.xml$', | 94 | r'^ppt/slideLayouts/slideLayout[0-9]+\.xml$', |
| 95 | r'^(?:word|ppt)/tableStyles\.xml$', | 95 | r'^(?:word|ppt|xl)/tableStyles\.xml$', |
| 96 | r'^ppt/slides/_rels/slide[0-9]*\.xml\.rels$', | 96 | r'^ppt/slides/_rels/slide[0-9]*\.xml\.rels$', |
| 97 | r'^ppt/slides/slide[0-9]*\.xml$', | 97 | r'^ppt/slides/slide[0-9]*\.xml$', |
| 98 | # https://msdn.microsoft.com/en-us/library/dd908153(v=office.12).aspx | 98 | # https://msdn.microsoft.com/en-us/library/dd908153(v=office.12).aspx |
| 99 | r'^(?:word|ppt)/stylesWithEffects\.xml$', | 99 | r'^(?:word|ppt|xl)/stylesWithEffects\.xml$', |
| 100 | r'^ppt/presentation\.xml$', | 100 | r'^ppt/presentation\.xml$', |
| 101 | # TODO: check if p:bgRef can be randomized | 101 | # TODO: check if p:bgRef can be randomized |
| 102 | r'^ppt/slideMasters/slideMaster[0-9]+\.xml', | 102 | r'^ppt/slideMasters/slideMaster[0-9]+\.xml', |
| @@ -106,20 +106,20 @@ class MSOfficeParser(ZipParser): | |||
| 106 | r'^customXml/', | 106 | r'^customXml/', |
| 107 | r'webSettings\.xml$', | 107 | r'webSettings\.xml$', |
| 108 | r'^docProps/custom\.xml$', | 108 | r'^docProps/custom\.xml$', |
| 109 | r'^(?:word|ppt)/printerSettings/', | 109 | r'^(?:word|ppt|xl)/printerSettings/', |
| 110 | r'^(?:word|ppt)/theme', | 110 | r'^(?:word|ppt|xl)/theme', |
| 111 | r'^(?:word|ppt)/people\.xml$', | 111 | r'^(?:word|ppt|xl)/people\.xml$', |
| 112 | r'^(?:word|ppt)/numbering\.xml$', | 112 | r'^(?:word|ppt|xl)/numbering\.xml$', |
| 113 | r'^(?:word|ppt)/tags/', | 113 | r'^(?:word|ppt|xl)/tags/', |
| 114 | # View properties like view mode, last viewed slide etc | 114 | # View properties like view mode, last viewed slide etc |
| 115 | r'^(?:word|ppt)/viewProps\.xml$', | 115 | r'^(?:word|ppt|xl)/viewProps\.xml$', |
| 116 | # Additional presentation-wide properties like printing properties, | 116 | # Additional presentation-wide properties like printing properties, |
| 117 | # presentation show properties etc. | 117 | # presentation show properties etc. |
| 118 | r'^(?:word|ppt)/presProps\.xml$', | 118 | r'^(?:word|ppt|xl)/presProps\.xml$', |
| 119 | 119 | ||
| 120 | # we have an allowlist in self.files_to_keep, | 120 | # we have an allowlist in self.files_to_keep, |
| 121 | # so we can trash everything else | 121 | # so we can trash everything else |
| 122 | r'^(?:word|ppt)/_rels/', | 122 | r'^(?:word|ppt|xl)/_rels/', |
| 123 | })) | 123 | })) |
| 124 | 124 | ||
| 125 | if self.__fill_files_to_keep_via_content_types() is False: | 125 | if self.__fill_files_to_keep_via_content_types() is False: |
