diff options
Diffstat (limited to 'libmat2')
| -rw-r--r-- | libmat2/__init__.py | 2 | ||||
| -rw-r--r-- | libmat2/exiftool.py | 2 | ||||
| -rw-r--r-- | libmat2/pdf.py | 2 | ||||
| -rw-r--r-- | libmat2/video.py | 2 |
4 files changed, 4 insertions, 4 deletions
diff --git a/libmat2/__init__.py b/libmat2/__init__.py index 399a364..58cf976 100644 --- a/libmat2/__init__.py +++ b/libmat2/__init__.py | |||
| @@ -40,7 +40,7 @@ DEPENDENCIES = { | |||
| 40 | 40 | ||
| 41 | 41 | ||
| 42 | 42 | ||
| 43 | def check_dependencies() -> dict: | 43 | def check_dependencies() -> Dict[str, bool]: |
| 44 | ret = collections.defaultdict(bool) # type: Dict[str, bool] | 44 | ret = collections.defaultdict(bool) # type: Dict[str, bool] |
| 45 | 45 | ||
| 46 | ret['Exiftool'] = True if exiftool._get_exiftool_path() else False | 46 | ret['Exiftool'] = True if exiftool._get_exiftool_path() else False |
diff --git a/libmat2/exiftool.py b/libmat2/exiftool.py index 23d0d89..9611a04 100644 --- a/libmat2/exiftool.py +++ b/libmat2/exiftool.py | |||
| @@ -24,7 +24,7 @@ class ExiftoolParser(abstract.AbstractParser): | |||
| 24 | meta.pop(key, None) | 24 | meta.pop(key, None) |
| 25 | return meta | 25 | return meta |
| 26 | 26 | ||
| 27 | def _lightweight_cleanup(self): | 27 | def _lightweight_cleanup(self) -> bool: |
| 28 | if os.path.exists(self.output_filename): | 28 | if os.path.exists(self.output_filename): |
| 29 | try: | 29 | try: |
| 30 | # exiftool can't force output to existing files | 30 | # exiftool can't force output to existing files |
diff --git a/libmat2/pdf.py b/libmat2/pdf.py index 17cd61e..b9f7c99 100644 --- a/libmat2/pdf.py +++ b/libmat2/pdf.py | |||
| @@ -125,7 +125,7 @@ class PDFParser(abstract.AbstractParser): | |||
| 125 | return True | 125 | return True |
| 126 | 126 | ||
| 127 | @staticmethod | 127 | @staticmethod |
| 128 | def __parse_metadata_field(data: str) -> dict: | 128 | def __parse_metadata_field(data: str) -> Dict[str, str]: |
| 129 | metadata = {} | 129 | metadata = {} |
| 130 | for (_, key, value) in re.findall(r"<(xmp|pdfx|pdf|xmpMM):(.+)>(.+)</\1:\2>", data, re.I): | 130 | for (_, key, value) in re.findall(r"<(xmp|pdfx|pdf|xmpMM):(.+)>(.+)</\1:\2>", data, re.I): |
| 131 | metadata[key] = value | 131 | metadata[key] = value |
diff --git a/libmat2/video.py b/libmat2/video.py index b7ba0a0..85b5b2e 100644 --- a/libmat2/video.py +++ b/libmat2/video.py | |||
| @@ -24,7 +24,7 @@ class AVIParser(exiftool.ExiftoolParser): | |||
| 24 | 'SampleRate', 'AvgBytesPerSec', 'BitsPerSample', | 24 | 'SampleRate', 'AvgBytesPerSec', 'BitsPerSample', |
| 25 | 'Duration', 'ImageSize', 'Megapixels'} | 25 | 'Duration', 'ImageSize', 'Megapixels'} |
| 26 | 26 | ||
| 27 | def remove_all(self): | 27 | def remove_all(self) -> bool: |
| 28 | cmd = [_get_ffmpeg_path(), | 28 | cmd = [_get_ffmpeg_path(), |
| 29 | '-i', self.filename, # input file | 29 | '-i', self.filename, # input file |
| 30 | '-y', # overwrite existing output file | 30 | '-y', # overwrite existing output file |
