1
0
Fork 0

Fix a mistake in office file revisions handling

This commit is contained in:
jvoisin 2018-07-07 18:05:54 +02:00
parent 9f631a1bb1
commit 85455a4419
1 changed files with 4 additions and 4 deletions

View File

@ -51,7 +51,7 @@ class ArchiveBasedAbstractParser(abstract.AbstractParser):
def _specific_cleanup(self, full_path: str) -> bool: def _specific_cleanup(self, full_path: str) -> bool:
""" This method can be used to apply specific treatment """ This method can be used to apply specific treatment
to files present in the archive.""" to files present in the archive."""
return True return True # pragma: no cover
def _clean_zipinfo(self, zipinfo: zipfile.ZipInfo) -> zipfile.ZipInfo: def _clean_zipinfo(self, zipinfo: zipfile.ZipInfo) -> zipfile.ZipInfo:
zipinfo.create_system = 3 # Linux zipinfo.create_system = 3 # Linux
@ -147,9 +147,9 @@ class MSOfficeParser(ArchiveBasedAbstractParser):
tree, ns = _parse_xml(full_path) tree, ns = _parse_xml(full_path)
# No revisions are present # No revisions are present
if tree.find('.//w:del', ns) is None: del_presence = tree.find('.//w:del', ns)
return True ins_presence = tree.find('.//w:ins', ns)
elif tree.find('.//w:ins', ns) is None: if del_presence is None and ins_presence is None:
return True return True
parent_map = {c:p for p in tree.iter() for c in p} parent_map = {c:p for p in tree.iter() for c in p}