diff options
| -rw-r--r-- | libmat2/__init__.py | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/libmat2/__init__.py b/libmat2/__init__.py index 1d945d4..46e56b3 100644 --- a/libmat2/__init__.py +++ b/libmat2/__init__.py | |||
| @@ -38,13 +38,14 @@ DEPENDENCIES = { | |||
| 38 | 'Mutagen': 'mutagen', | 38 | 'Mutagen': 'mutagen', |
| 39 | } | 39 | } |
| 40 | 40 | ||
| 41 | CMD_DEPENDENCIES = { | ||
| 42 | 'Exiftool': exiftool._get_exiftool_path, | ||
| 43 | 'Ffmpeg': video._get_ffmpeg_path, | ||
| 44 | } | ||
| 41 | 45 | ||
| 42 | def check_dependencies() -> Dict[str, bool]: | 46 | def check_dependencies() -> Dict[str, bool]: |
| 43 | ret = collections.defaultdict(bool) # type: Dict[str, bool] | 47 | ret = collections.defaultdict(bool) # type: Dict[str, bool] |
| 44 | 48 | ||
| 45 | ret['Exiftool'] = bool(exiftool._get_exiftool_path()) | ||
| 46 | ret['Ffmpeg'] = bool(video._get_ffmpeg_path()) | ||
| 47 | |||
| 48 | for key, value in DEPENDENCIES.items(): | 49 | for key, value in DEPENDENCIES.items(): |
| 49 | ret[key] = True | 50 | ret[key] = True |
| 50 | try: | 51 | try: |
| @@ -52,6 +53,13 @@ def check_dependencies() -> Dict[str, bool]: | |||
| 52 | except ImportError: # pragma: no cover | 53 | except ImportError: # pragma: no cover |
| 53 | ret[key] = False # pragma: no cover | 54 | ret[key] = False # pragma: no cover |
| 54 | 55 | ||
| 56 | for key, value in CMD_DEPENDENCIES.items(): | ||
| 57 | ret[key] = True | ||
| 58 | try: | ||
| 59 | value() | ||
| 60 | except RuntimeError: # pragma: no cover | ||
| 61 | ret[key] = False | ||
| 62 | |||
| 55 | return ret | 63 | return ret |
| 56 | 64 | ||
| 57 | 65 | ||
