From ec784ff155f0c9c48b46c377fd512eeadfdb66ed Mon Sep 17 00:00:00 2001 From: smagnin <simon@smagnin.org> Date: Wed, 10 Oct 2018 21:15:24 +0200 Subject: [PATCH] Correct self method --- libmat2/archive.py | 3 +-- libmat2/office.py | 4 ++-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/libmat2/archive.py b/libmat2/archive.py index 205312b..3d70a9a 100644 --- a/libmat2/archive.py +++ b/libmat2/archive.py @@ -49,7 +49,6 @@ class ArchiveBasedAbstractParser(abstract.AbstractParser): zipinfo.date_time = (1980, 1, 1, 0, 0, 0) # this is as early as a zipfile can be return zipinfo - @staticmethod def _get_zipinfo_meta(self, zipinfo: zipfile.ZipInfo) -> Dict[str, str]: metadata = {} if zipinfo.create_system == 3: # this is Linux @@ -146,7 +145,7 @@ class ZIPParser(ArchiveBasedAbstractParser): metadata = {} zipin = zipfile.ZipFile(self.filename) for item in zipin.infolist(): - for key, value in self._get_zipinfo_meta(self, item).items(): + for key, value in self._get_zipinfo_meta(item).items(): metadata[key] = value zipin.close() return metadata diff --git a/libmat2/office.py b/libmat2/office.py index 73d5d9a..32e7b75 100644 --- a/libmat2/office.py +++ b/libmat2/office.py @@ -312,7 +312,7 @@ class MSOfficeParser(ArchiveBasedAbstractParser): metadata[key] = value except (TypeError, UnicodeDecodeError): # We didn't manage to parse the xml file metadata[item.filename] = 'harmful content' - for key, value in self._get_zipinfo_meta(self, item).items(): + for key, value in self._get_zipinfo_meta(item).items(): metadata[key] = value zipin.close() return metadata @@ -397,7 +397,7 @@ class LibreOfficeParser(ArchiveBasedAbstractParser): metadata[key] = value except (TypeError, UnicodeDecodeError): # We didn't manage to parse the xml file metadata[item.filename] = 'harmful content' - for key, value in self._get_zipinfo_meta(self, item).items(): + for key, value in self._get_zipinfo_meta(item).items(): metadata[key] = value zipin.close() return metadata -- GitLab