diff options
| author | jvoisin | 2018-04-02 17:36:26 +0200 |
|---|---|---|
| committer | jvoisin | 2018-04-02 17:36:26 +0200 |
| commit | 6868f20065ef2e46f295c34f27c0736d54283535 (patch) | |
| tree | a76ef4cf903d763fe4435e282c402f2ebd0d0a82 /src/office.py | |
| parent | 6c29e0eae256ddb3d32fd78e9949d0aa81be033e (diff) | |
`parser_factory` now returns the mtype too
Diffstat (limited to 'src/office.py')
| -rw-r--r-- | src/office.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/office.py b/src/office.py index 0a34185..8d478c1 100644 --- a/src/office.py +++ b/src/office.py | |||
| @@ -38,9 +38,9 @@ class ArchiveBasedAbstractParser(abstract.AbstractParser): | |||
| 38 | 38 | ||
| 39 | def _clean_internal_file(self, item:zipfile.ZipInfo, temp_folder:str, zin:zipfile.ZipFile, zout:zipfile.ZipFile): | 39 | def _clean_internal_file(self, item:zipfile.ZipInfo, temp_folder:str, zin:zipfile.ZipFile, zout:zipfile.ZipFile): |
| 40 | zin.extract(member=item, path=temp_folder) | 40 | zin.extract(member=item, path=temp_folder) |
| 41 | tmp_parser = parser_factory.get_parser(os.path.join(temp_folder, item.filename)) | 41 | tmp_parser, mtype = parser_factory.get_parser(os.path.join(temp_folder, item.filename)) |
| 42 | if tmp_parser is None: | 42 | if tmp_parser is None: |
| 43 | print("%s isn't supported" % item.filename) | 43 | print("%s's format (%s) isn't supported" % (item.filename, mtype)) |
| 44 | return | 44 | return |
| 45 | tmp_parser.remove_all() | 45 | tmp_parser.remove_all() |
| 46 | zinfo = zipfile.ZipInfo(item.filename) | 46 | zinfo = zipfile.ZipInfo(item.filename) |
