Skip to content
Snippets Groups Projects
Commit 5a9dc388 authored by Julien (jvoisin) Voisin's avatar Julien (jvoisin) Voisin
Browse files

Minor refactorisation of how we're checking for exiftool's presence

parent 5a08f5b7
No related branches found
No related tags found
No related merge requests found
......@@ -53,15 +53,14 @@ class ExiftoolParser(abstract.AbstractParser):
return True
def _get_exiftool_path() -> str: # pragma: no cover
exiftool_path = '/usr/bin/exiftool'
if os.path.isfile(exiftool_path):
if os.access(exiftool_path, os.X_OK):
return exiftool_path
possible_pathes = {
'/usr/bin/exiftool', # debian/fedora
'/usr/bin/vendor_perl/exiftool', # archlinux
}
# ArchLinux
exiftool_path = '/usr/bin/vendor_perl/exiftool'
if os.path.isfile(exiftool_path):
if os.access(exiftool_path, os.X_OK):
return exiftool_path
for possible_path in possible_pathes:
if os.path.isfile(possible_path):
if os.access(possible_path, os.X_OK):
return possible_path
raise RuntimeError("Unable to find exiftool")
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment