From 9a81b3adfd21fcbc38c09b5d28cbd35791ba6004 Mon Sep 17 00:00:00 2001
From: jvoisin <julien.voisin@dustri.org>
Date: Tue, 23 Oct 2018 16:32:28 +0200
Subject: [PATCH] Improve type annotation coverage

---
 libmat2/__init__.py | 2 +-
 libmat2/exiftool.py | 2 +-
 libmat2/pdf.py      | 2 +-
 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 = {
 
 
 
-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):(.+)>(.+)</\1:\2>", 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
-- 
GitLab