summaryrefslogtreecommitdiff
path: root/libmat2
diff options
context:
space:
mode:
authorjvoisin2018-10-23 16:32:28 +0200
committerjvoisin2018-10-23 16:32:28 +0200
commit9a81b3adfd21fcbc38c09b5d28cbd35791ba6004 (patch)
tree6dea1ab714616eea190091f95a2c68825170721d /libmat2
parentf1a071d460507fd1bb1721deafd2a8d9f88f5b05 (diff)
Improve type annotation coverage
Diffstat (limited to 'libmat2')
-rw-r--r--libmat2/__init__.py2
-rw-r--r--libmat2/exiftool.py2
-rw-r--r--libmat2/pdf.py2
-rw-r--r--libmat2/video.py2
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
43def check_dependencies() -> dict: 43def 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