summaryrefslogtreecommitdiff
path: root/libmat2/__init__.py
diff options
context:
space:
mode:
Diffstat (limited to 'libmat2/__init__.py')
-rw-r--r--libmat2/__init__.py18
1 files changed, 4 insertions, 14 deletions
diff --git a/libmat2/__init__.py b/libmat2/__init__.py
index f55a14c..399a364 100644
--- a/libmat2/__init__.py
+++ b/libmat2/__init__.py
@@ -1,11 +1,12 @@
1#!/usr/bin/env python3 1#!/usr/bin/env python3
2 2
3import os
4import collections 3import collections
5import enum 4import enum
6import importlib 5import importlib
7from typing import Dict, Optional 6from typing import Dict, Optional
8 7
8from . import exiftool, video
9
9# make pyflakes happy 10# make pyflakes happy
10assert Dict 11assert Dict
11assert Optional 12assert Optional
@@ -37,24 +38,13 @@ DEPENDENCIES = {
37 'mutagen': 'Mutagen', 38 'mutagen': 'Mutagen',
38 } 39 }
39 40
40def _get_exiftool_path() -> str: # pragma: no cover
41 exiftool_path = '/usr/bin/exiftool'
42 if os.path.isfile(exiftool_path):
43 if os.access(exiftool_path, os.X_OK):
44 return exiftool_path
45
46 # ArchLinux
47 exiftool_path = '/usr/bin/vendor_perl/exiftool'
48 if os.path.isfile(exiftool_path):
49 if os.access(exiftool_path, os.X_OK):
50 return exiftool_path
51 41
52 raise ValueError
53 42
54def check_dependencies() -> dict: 43def check_dependencies() -> dict:
55 ret = collections.defaultdict(bool) # type: Dict[str, bool] 44 ret = collections.defaultdict(bool) # type: Dict[str, bool]
56 45
57 ret['Exiftool'] = True if _get_exiftool_path() else False 46 ret['Exiftool'] = True if exiftool._get_exiftool_path() else False
47 ret['Ffmpeg'] = True if video._get_ffmpeg_path() else False
58 48
59 for key, value in DEPENDENCIES.items(): 49 for key, value in DEPENDENCIES.items():
60 ret[value] = True 50 ret[value] = True