From 35d550d229b219f5a02cb9194c3bd24329f975ed Mon Sep 17 00:00:00 2001 From: jvoisin Date: Thu, 16 May 2019 00:31:40 +0200 Subject: Use memoization get _*_path() functions This shouldn't make a big difference in the CLI/extension usage, but might improve the performances of long-running instances, or people misusing the API. --- libmat2/exiftool.py | 2 ++ 1 file changed, 2 insertions(+) (limited to 'libmat2/exiftool.py') diff --git a/libmat2/exiftool.py b/libmat2/exiftool.py index d18b1fb..2e83f13 100644 --- a/libmat2/exiftool.py +++ b/libmat2/exiftool.py @@ -1,3 +1,4 @@ +import functools import json import logging import os @@ -56,6 +57,7 @@ class ExiftoolParser(abstract.AbstractParser): return False return True +@functools.lru_cache() def _get_exiftool_path() -> str: # pragma: no cover possible_pathes = { '/usr/bin/exiftool', # debian/fedora -- cgit v1.3