summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjvoisin2019-05-14 00:46:48 +0200
committerjvoisin2019-05-14 00:50:17 +0200
commitaa52a5c91c1d7f0dc6691fdd972e343fc63f6fc2 (patch)
treeb651fdc905c19466ebad5c03b69e8509f75b4951
parentf19f6ed8b6ded81d2a1cc9d2fe606f71fcd0e27a (diff)
Please mypy wrt. the last two commits
-rw-r--r--libmat2/__init__.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/libmat2/__init__.py b/libmat2/__init__.py
index 501baaa..ff899ff 100644
--- a/libmat2/__init__.py
+++ b/libmat2/__init__.py
@@ -1,15 +1,15 @@
1#!/usr/bin/env python3 1#!/usr/bin/env python3
2 2
3import collections
4import enum 3import enum
5import importlib 4import importlib
6from typing import Dict, Optional 5from typing import Dict, Optional, Union
7 6
8from . import exiftool, video 7from . import exiftool, video
9 8
10# make pyflakes happy 9# make pyflakes happy
11assert Dict 10assert Dict
12assert Optional 11assert Optional
12assert Union
13 13
14# A set of extension that aren't supported, despite matching a supported mimetype 14# A set of extension that aren't supported, despite matching a supported mimetype
15UNSUPPORTED_EXTENSIONS = { 15UNSUPPORTED_EXTENSIONS = {
@@ -68,7 +68,7 @@ CMD_DEPENDENCIES = {
68} 68}
69 69
70def check_dependencies() -> Dict[str, Dict[str, bool]]: 70def check_dependencies() -> Dict[str, Dict[str, bool]]:
71 ret = collections.defaultdict(bool) # type: Dict[str, bool] 71 ret = dict() # type: Dict[str, dict]
72 72
73 for key, value in DEPENDENCIES.items(): 73 for key, value in DEPENDENCIES.items():
74 ret[key] = { 74 ret[key] = {
@@ -76,7 +76,7 @@ def check_dependencies() -> Dict[str, Dict[str, bool]]:
76 'required': value['required'], 76 'required': value['required'],
77 } 77 }
78 try: 78 try:
79 importlib.import_module(value['module']) 79 importlib.import_module(value['module']) # type: ignore
80 except ImportError: # pragma: no cover 80 except ImportError: # pragma: no cover
81 ret[key]['found'] = False 81 ret[key]['found'] = False
82 82
@@ -86,7 +86,7 @@ def check_dependencies() -> Dict[str, Dict[str, bool]]:
86 'required': v['required'], 86 'required': v['required'],
87 } 87 }
88 try: 88 try:
89 v['cmd']() 89 v['cmd']() # type: ignore
90 except RuntimeError: # pragma: no cover 90 except RuntimeError: # pragma: no cover
91 ret[k]['found'] = False 91 ret[k]['found'] = False
92 92