Add cache to find_path tool

This commit is contained in:
Cédric Krier
2025-09-18 10:18:54 +02:00
parent 33d85882ad
commit d80a166f2a
+2 -1
View File
@@ -14,7 +14,7 @@ import unicodedata
import warnings
from array import array
from collections.abc import Iterable, Sized
from functools import wraps
from functools import cache, wraps
from itertools import chain, islice, tee, zip_longest
from sql import As, Literal, Select
@@ -54,6 +54,7 @@ def file_open(name, mode="r", subdir='modules', encoding=None):
_root_path = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
@cache
def find_path(name, subdir='modules', _test=os.path.isfile):
"Return path from the root directory, using subdir folder"