summaryrefslogtreecommitdiff
path: root/libmat2/exiftool.py
diff options
context:
space:
mode:
authorjvoisin2018-10-25 11:05:06 +0200
committerjvoisin2018-10-25 11:05:06 +0200
commit5a9dc388ade0604962cd86889dfd1658579539fa (patch)
tree511d9d25c45b04866db299033336b08ce3c7f4c5 /libmat2/exiftool.py
parent5a08f5b7bf42c8f04ef1c29796d0ac37e32ae79f (diff)
Minor refactorisation of how we're checking for exiftool's presence
Diffstat (limited to 'libmat2/exiftool.py')
-rw-r--r--libmat2/exiftool.py17
1 files changed, 8 insertions, 9 deletions
diff --git a/libmat2/exiftool.py b/libmat2/exiftool.py
index 9611a04..adec28e 100644
--- a/libmat2/exiftool.py
+++ b/libmat2/exiftool.py
@@ -53,15 +53,14 @@ class ExiftoolParser(abstract.AbstractParser):
53 return True 53 return True
54 54
55def _get_exiftool_path() -> str: # pragma: no cover 55def _get_exiftool_path() -> str: # pragma: no cover
56 exiftool_path = '/usr/bin/exiftool' 56 possible_pathes = {
57 if os.path.isfile(exiftool_path): 57 '/usr/bin/exiftool', # debian/fedora
58 if os.access(exiftool_path, os.X_OK): 58 '/usr/bin/vendor_perl/exiftool', # archlinux
59 return exiftool_path 59 }
60 60
61 # ArchLinux 61 for possible_path in possible_pathes:
62 exiftool_path = '/usr/bin/vendor_perl/exiftool' 62 if os.path.isfile(possible_path):
63 if os.path.isfile(exiftool_path): 63 if os.access(possible_path, os.X_OK):
64 if os.access(exiftool_path, os.X_OK): 64 return possible_path
65 return exiftool_path
66 65
67 raise RuntimeError("Unable to find exiftool") 66 raise RuntimeError("Unable to find exiftool")