diff options
| author | jvoisin | 2019-05-14 00:46:48 +0200 |
|---|---|---|
| committer | jvoisin | 2019-05-14 00:50:17 +0200 |
| commit | aa52a5c91c1d7f0dc6691fdd972e343fc63f6fc2 (patch) | |
| tree | b651fdc905c19466ebad5c03b69e8509f75b4951 /libmat2/__init__.py | |
| parent | f19f6ed8b6ded81d2a1cc9d2fe606f71fcd0e27a (diff) | |
Please mypy wrt. the last two commits
Diffstat (limited to '')
| -rw-r--r-- | libmat2/__init__.py | 10 |
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 | ||
| 3 | import collections | ||
| 4 | import enum | 3 | import enum |
| 5 | import importlib | 4 | import importlib |
| 6 | from typing import Dict, Optional | 5 | from typing import Dict, Optional, Union |
| 7 | 6 | ||
| 8 | from . import exiftool, video | 7 | from . import exiftool, video |
| 9 | 8 | ||
| 10 | # make pyflakes happy | 9 | # make pyflakes happy |
| 11 | assert Dict | 10 | assert Dict |
| 12 | assert Optional | 11 | assert Optional |
| 12 | assert 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 |
| 15 | UNSUPPORTED_EXTENSIONS = { | 15 | UNSUPPORTED_EXTENSIONS = { |
| @@ -68,7 +68,7 @@ CMD_DEPENDENCIES = { | |||
| 68 | } | 68 | } |
| 69 | 69 | ||
| 70 | def check_dependencies() -> Dict[str, Dict[str, bool]]: | 70 | def 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 | ||
