diff options
| author | jvoisin | 2018-09-24 20:15:07 +0200 |
|---|---|---|
| committer | jvoisin | 2018-09-24 20:15:07 +0200 |
| commit | 719cdf20fa8c9921b81eaf6bf3df0d50c790de82 (patch) | |
| tree | 2da79f90984aee0bdcd5036c0608d463cc1a07f4 /libmat2 | |
| parent | 2e243355f51654c8c6392c80a17b090f9f012fd1 (diff) | |
Second pass of minor formatting
Diffstat (limited to 'libmat2')
| -rw-r--r-- | libmat2/archive.py | 4 | ||||
| -rw-r--r-- | libmat2/office.py | 3 | ||||
| -rw-r--r-- | libmat2/pdf.py | 1 | ||||
| -rw-r--r-- | libmat2/torrent.py | 1 |
4 files changed, 3 insertions, 6 deletions
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): | |||
| 25 | 25 | ||
| 26 | # what should the parser do if it encounters an unknown file in | 26 | # what should the parser do if it encounters an unknown file in |
| 27 | # the archive? | 27 | # the archive? |
| 28 | unknown_member_policy = UnknownMemberPolicy.ABORT # type: UnknownMemberPolicy | 28 | unknown_member_policy = UnknownMemberPolicy.ABORT # type: UnknownMemberPolicy |
| 29 | 29 | ||
| 30 | def __init__(self, filename): | 30 | def __init__(self, filename): |
| 31 | super().__init__(filename) | 31 | super().__init__(filename) |
| @@ -94,7 +94,7 @@ class ArchiveBasedAbstractParser(abstract.AbstractParser): | |||
| 94 | pass | 94 | pass |
| 95 | elif any(map(lambda r: r.search(item.filename), self.files_to_omit)): | 95 | elif any(map(lambda r: r.search(item.filename), self.files_to_omit)): |
| 96 | continue | 96 | continue |
| 97 | else: # supported files that we want to first clean, then add | 97 | else: # supported files that we want to first clean, then add |
| 98 | tmp_parser, mtype = parser_factory.get_parser(full_path) # type: ignore | 98 | tmp_parser, mtype = parser_factory.get_parser(full_path) # type: ignore |
| 99 | if not tmp_parser: | 99 | if not tmp_parser: |
| 100 | if self.unknown_member_policy == UnknownMemberPolicy.OMIT: | 100 | 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): | |||
| 138 | 138 | ||
| 139 | elements = list() | 139 | elements = list() |
| 140 | for element in tree.iterfind('.//w:ins', namespace): | 140 | for element in tree.iterfind('.//w:ins', namespace): |
| 141 | for position, item in enumerate(tree.iter()): #pragma: no cover | 141 | for position, item in enumerate(tree.iter()): # pragma: no cover |
| 142 | if item == element: | 142 | if item == element: |
| 143 | for children in element.iterfind('./*'): | 143 | for children in element.iterfind('./*'): |
| 144 | elements.append((element, position, children)) | 144 | elements.append((element, position, children)) |
| @@ -212,7 +212,6 @@ class LibreOfficeParser(ArchiveBasedAbstractParser): | |||
| 212 | '^Thumbnails/', | 212 | '^Thumbnails/', |
| 213 | })) | 213 | })) |
| 214 | 214 | ||
| 215 | |||
| 216 | @staticmethod | 215 | @staticmethod |
| 217 | def __remove_revisions(full_path: str) -> bool: | 216 | def __remove_revisions(full_path: str) -> bool: |
| 218 | try: | 217 | 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): | |||
| 118 | document.save('file://' + os.path.abspath(out_file)) | 118 | document.save('file://' + os.path.abspath(out_file)) |
| 119 | return True | 119 | return True |
| 120 | 120 | ||
| 121 | |||
| 122 | @staticmethod | 121 | @staticmethod |
| 123 | def __parse_metadata_field(data: str) -> dict: | 122 | def __parse_metadata_field(data: str) -> dict: |
| 124 | metadata = {} | 123 | 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): | |||
| 21 | metadata[key.decode('utf-8')] = value | 21 | metadata[key.decode('utf-8')] = value |
| 22 | return metadata | 22 | return metadata |
| 23 | 23 | ||
| 24 | |||
| 25 | def remove_all(self) -> bool: | 24 | def remove_all(self) -> bool: |
| 26 | cleaned = dict() | 25 | cleaned = dict() |
| 27 | for key, value in self.dict_repr.items(): | 26 | for key, value in self.dict_repr.items(): |
