summaryrefslogtreecommitdiff
path: root/src/office.py
diff options
context:
space:
mode:
authorjvoisin2018-04-02 23:35:03 +0200
committerjvoisin2018-04-02 23:35:03 +0200
commit721ee78d15b69d06bd46920a2c1e988ea8d44288 (patch)
tree63d2a7d5f4e251d49fcd7b806bc19c310581fbef /src/office.py
parent0cc7e1e68075b8366c358031d91393d1ac74fb01 (diff)
Fix a mistake wrt. office handling
Diffstat (limited to 'src/office.py')
-rw-r--r--src/office.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/office.py b/src/office.py
index 8d478c1..1c5e795 100644
--- a/src/office.py
+++ b/src/office.py
@@ -39,14 +39,14 @@ class ArchiveBasedAbstractParser(abstract.AbstractParser):
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, mtype = 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 not tmp_parser:
43 print("%s's format (%s) isn't supported" % (item.filename, mtype)) 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)
47 item = self._clean_zipinfo(item) 47 clean_zinfo = self._clean_zipinfo(zinfo)
48 with open(tmp_parser.output_filename, 'rb') as f: 48 with open(tmp_parser.output_filename, 'rb') as f:
49 zout.writestr(zinfo, f.read()) 49 zout.writestr(clean_zinfo, f.read())
50 50
51class MSOfficeParser(ArchiveBasedAbstractParser): 51class MSOfficeParser(ArchiveBasedAbstractParser):
52 mimetypes = { 52 mimetypes = {