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 = { -def check_dependencies() -> dict: +def check_dependencies() -> Dict[str, bool]: ret = collections.defaultdict(bool) # type: Dict[str, bool] 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): meta.pop(key, None) return meta - def _lightweight_cleanup(self): + def _lightweight_cleanup(self) -> bool: if os.path.exists(self.output_filename): try: # 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): return True @staticmethod - def __parse_metadata_field(data: str) -> dict: + def __parse_metadata_field(data: str) -> Dict[str, str]: metadata = {} for (_, key, value) in re.findall(r"<(xmp|pdfx|pdf|xmpMM):(.+)>(.+)", data, re.I): 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): 'SampleRate', 'AvgBytesPerSec', 'BitsPerSample', 'Duration', 'ImageSize', 'Megapixels'} - def remove_all(self): + def remove_all(self) -> bool: cmd = [_get_ffmpeg_path(), '-i', self.filename, # input file '-y', # overwrite existing output file