diff options
Diffstat (limited to 'libmat2/archive.py')
| -rw-r--r-- | libmat2/archive.py | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/libmat2/archive.py b/libmat2/archive.py index beadd50..847f81c 100644 --- a/libmat2/archive.py +++ b/libmat2/archive.py | |||
| @@ -49,15 +49,15 @@ class ArchiveBasedAbstractParser(abstract.AbstractParser): | |||
| 49 | 49 | ||
| 50 | # Those are the files that have a format that _isn't_ | 50 | # Those are the files that have a format that _isn't_ |
| 51 | # supported by mat2, but that we want to keep anyway. | 51 | # supported by mat2, but that we want to keep anyway. |
| 52 | self.files_to_keep = set() # type: Set[Pattern] | 52 | self.files_to_keep: Set[Pattern] = set() |
| 53 | 53 | ||
| 54 | # Those are the files that we _do not_ want to keep, | 54 | # Those are the files that we _do not_ want to keep, |
| 55 | # no matter if they are supported or not. | 55 | # no matter if they are supported or not. |
| 56 | self.files_to_omit = set() # type: Set[Pattern] | 56 | self.files_to_omit: Set[Pattern] = set() |
| 57 | 57 | ||
| 58 | # what should the parser do if it encounters an unknown file in | 58 | # what should the parser do if it encounters an unknown file in |
| 59 | # the archive? | 59 | # the archive? |
| 60 | self.unknown_member_policy = UnknownMemberPolicy.ABORT # type: UnknownMemberPolicy | 60 | self.unknown_member_policy: UnknownMemberPolicy = UnknownMemberPolicy.ABORT |
| 61 | 61 | ||
| 62 | # The LGTM comment is to mask a false-positive, | 62 | # The LGTM comment is to mask a false-positive, |
| 63 | # see https://lgtm.com/projects/g/jvoisin/mat2/ | 63 | # see https://lgtm.com/projects/g/jvoisin/mat2/ |
| @@ -134,7 +134,7 @@ class ArchiveBasedAbstractParser(abstract.AbstractParser): | |||
| 134 | return member | 134 | return member |
| 135 | 135 | ||
| 136 | def get_meta(self) -> Dict[str, Union[str, Dict]]: | 136 | def get_meta(self) -> Dict[str, Union[str, Dict]]: |
| 137 | meta = dict() # type: Dict[str, Union[str, Dict]] | 137 | meta: Dict[str, Union[str, Dict]] = dict() |
| 138 | 138 | ||
| 139 | with self.archive_class(self.filename) as zin: | 139 | with self.archive_class(self.filename) as zin: |
| 140 | temp_folder = tempfile.mkdtemp() | 140 | temp_folder = tempfile.mkdtemp() |
| @@ -174,7 +174,7 @@ class ArchiveBasedAbstractParser(abstract.AbstractParser): | |||
| 174 | 174 | ||
| 175 | # Sort the items to process, to reduce fingerprinting, | 175 | # Sort the items to process, to reduce fingerprinting, |
| 176 | # and keep them in the `items` variable. | 176 | # and keep them in the `items` variable. |
| 177 | items = list() # type: List[ArchiveMember] | 177 | items: List[ArchiveMember] = list() |
| 178 | for item in sorted(self._get_all_members(zin), key=self._get_member_name): | 178 | for item in sorted(self._get_all_members(zin), key=self._get_member_name): |
| 179 | # Some fileformats do require to have the `mimetype` file | 179 | # Some fileformats do require to have the `mimetype` file |
| 180 | # as the first file in the archive. | 180 | # as the first file in the archive. |
