From 719cdf20fa8c9921b81eaf6bf3df0d50c790de82 Mon Sep 17 00:00:00 2001 From: jvoisin Date: Mon, 24 Sep 2018 20:15:07 +0200 Subject: Second pass of minor formatting --- libmat2/archive.py | 4 ++-- libmat2/office.py | 3 +-- libmat2/pdf.py | 1 - libmat2/torrent.py | 1 - 4 files changed, 3 insertions(+), 6 deletions(-) (limited to 'libmat2') diff --git a/libmat2/archive.py b/libmat2/archive.py index dd63c50..d812531 100644 --- a/libmat2/archive.py +++ b/libmat2/archive.py @@ -25,7 +25,7 @@ class ArchiveBasedAbstractParser(abstract.AbstractParser): # what should the parser do if it encounters an unknown file in # the archive? - unknown_member_policy = UnknownMemberPolicy.ABORT # type: UnknownMemberPolicy + unknown_member_policy = UnknownMemberPolicy.ABORT # type: UnknownMemberPolicy def __init__(self, filename): super().__init__(filename) @@ -94,7 +94,7 @@ class ArchiveBasedAbstractParser(abstract.AbstractParser): pass elif any(map(lambda r: r.search(item.filename), self.files_to_omit)): continue - else: # supported files that we want to first clean, then add + else: # supported files that we want to first clean, then add tmp_parser, mtype = parser_factory.get_parser(full_path) # type: ignore if not tmp_parser: if self.unknown_member_policy == UnknownMemberPolicy.OMIT: diff --git a/libmat2/office.py b/libmat2/office.py index c6b324b..bad352b 100644 --- a/libmat2/office.py +++ b/libmat2/office.py @@ -138,7 +138,7 @@ class MSOfficeParser(ArchiveBasedAbstractParser): elements = list() for element in tree.iterfind('.//w:ins', namespace): - for position, item in enumerate(tree.iter()): #pragma: no cover + for position, item in enumerate(tree.iter()): # pragma: no cover if item == element: for children in element.iterfind('./*'): elements.append((element, position, children)) @@ -212,7 +212,6 @@ class LibreOfficeParser(ArchiveBasedAbstractParser): '^Thumbnails/', })) - @staticmethod def __remove_revisions(full_path: str) -> bool: try: diff --git a/libmat2/pdf.py b/libmat2/pdf.py index 5e19ef7..c8769aa 100644 --- a/libmat2/pdf.py +++ b/libmat2/pdf.py @@ -118,7 +118,6 @@ class PDFParser(abstract.AbstractParser): document.save('file://' + os.path.abspath(out_file)) return True - @staticmethod def __parse_metadata_field(data: str) -> dict: metadata = {} diff --git a/libmat2/torrent.py b/libmat2/torrent.py index 049807b..c56e971 100644 --- a/libmat2/torrent.py +++ b/libmat2/torrent.py @@ -21,7 +21,6 @@ class TorrentParser(abstract.AbstractParser): metadata[key.decode('utf-8')] = value return metadata - def remove_all(self) -> bool: cleaned = dict() for key, value in self.dict_repr.items(): -- cgit v1.3