Files
Giacomo Vercesi b622fe8f19 Implement FileProvider interface
Implement the `FileProvider` interface, this allows pipes to request
files given a `FileRequest` (hash and optional size/name).
2025-10-16 17:48:45 +02:00

16 lines
335 B
Python

#
# This file is distributed under the MIT License. See LICENSE.md for details.
#
import os
from pathlib import Path
from xdg import xdg_cache_home
def cache_directory() -> Path:
if "PYPELINE_CACHE_DIR" in os.environ:
return Path(os.environ["PYPELINE_CACHE_DIR"])
else:
return xdg_cache_home() / "pypeline"