diff options
| author | jvoisin | 2018-09-01 15:07:01 +0200 |
|---|---|---|
| committer | jvoisin | 2018-09-01 15:41:22 +0200 |
| commit | 91e80527fc63140dc0c0a7afebe74f37494abd68 (patch) | |
| tree | bfc63057fae5a8bf73423e6a02a5a1551e2083a9 /libmat2/__init__.py | |
| parent | 7877ba0da5970de0615c1299b462d067218f5d18 (diff) | |
Add archlinux to the CI
Diffstat (limited to 'libmat2/__init__.py')
| -rw-r--r-- | libmat2/__init__.py | 21 |
1 files changed, 16 insertions, 5 deletions
diff --git a/libmat2/__init__.py b/libmat2/__init__.py index 6072b42..6067861 100644 --- a/libmat2/__init__.py +++ b/libmat2/__init__.py | |||
| @@ -3,7 +3,7 @@ | |||
| 3 | import os | 3 | import os |
| 4 | import collections | 4 | import collections |
| 5 | import importlib | 5 | import importlib |
| 6 | from typing import Dict | 6 | from typing import Dict, Optional |
| 7 | 7 | ||
| 8 | # make pyflakes happy | 8 | # make pyflakes happy |
| 9 | assert Dict | 9 | assert Dict |
| @@ -35,13 +35,24 @@ DEPENDENCIES = { | |||
| 35 | 'mutagen': 'Mutagen', | 35 | 'mutagen': 'Mutagen', |
| 36 | } | 36 | } |
| 37 | 37 | ||
| 38 | def _get_exiftool_path() -> Optional[str]: | ||
| 39 | exiftool_path = '/usr/bin/exiftool' | ||
| 40 | if os.path.isfile(exiftool_path): | ||
| 41 | if os.access(exiftool_path, os.X_OK): # pragma: no cover | ||
| 42 | return exiftool_path | ||
| 43 | |||
| 44 | # ArchLinux | ||
| 45 | exiftool_path = '/usr/bin/vendor_perl/exiftool' | ||
| 46 | if os.path.isfile(exiftool_path): | ||
| 47 | if os.access(exiftool_path, os.X_OK): # pragma: no cover | ||
| 48 | return exiftool_path | ||
| 49 | |||
| 50 | return None | ||
| 51 | |||
| 38 | def check_dependencies() -> dict: | 52 | def check_dependencies() -> dict: |
| 39 | ret = collections.defaultdict(bool) # type: Dict[str, bool] | 53 | ret = collections.defaultdict(bool) # type: Dict[str, bool] |
| 40 | 54 | ||
| 41 | exiftool = '/usr/bin/exiftool' | 55 | ret['Exiftool'] = True if _get_exiftool_path() else False |
| 42 | ret['Exiftool'] = False | ||
| 43 | if os.path.isfile(exiftool) and os.access(exiftool, os.X_OK): # pragma: no cover | ||
| 44 | ret['Exiftool'] = True | ||
| 45 | 56 | ||
| 46 | for key, value in DEPENDENCIES.items(): | 57 | for key, value in DEPENDENCIES.items(): |
| 47 | ret[value] = True | 58 | ret[value] = True |
