Minor refactorisation of how we're checking for exiftool's presence
This commit is contained in:
parent
5a08f5b7bf
commit
5a9dc388ad
@ -53,15 +53,14 @@ class ExiftoolParser(abstract.AbstractParser):
|
|||||||
return True
|
return True
|
||||||
|
|
||||||
def _get_exiftool_path() -> str: # pragma: no cover
|
def _get_exiftool_path() -> str: # pragma: no cover
|
||||||
exiftool_path = '/usr/bin/exiftool'
|
possible_pathes = {
|
||||||
if os.path.isfile(exiftool_path):
|
'/usr/bin/exiftool', # debian/fedora
|
||||||
if os.access(exiftool_path, os.X_OK):
|
'/usr/bin/vendor_perl/exiftool', # archlinux
|
||||||
return exiftool_path
|
}
|
||||||
|
|
||||||
# ArchLinux
|
for possible_path in possible_pathes:
|
||||||
exiftool_path = '/usr/bin/vendor_perl/exiftool'
|
if os.path.isfile(possible_path):
|
||||||
if os.path.isfile(exiftool_path):
|
if os.access(possible_path, os.X_OK):
|
||||||
if os.access(exiftool_path, os.X_OK):
|
return possible_path
|
||||||
return exiftool_path
|
|
||||||
|
|
||||||
raise RuntimeError("Unable to find exiftool")
|
raise RuntimeError("Unable to find exiftool")
|
||||||
|
Loading…
Reference in New Issue
Block a user