From 44512daa3e521cb003b1c5024b4f2564ffd478be Mon Sep 17 00:00:00 2001 From: Rijnder Wever Date: Fri, 13 Dec 2024 16:32:28 +0100 Subject: [PATCH] feat: allow setting `PRONOM_BACKEND` to siegfried with `sf` --- mdto/mdto.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/mdto/mdto.py b/mdto/mdto.py index 5b8a878..c30a34b 100755 --- a/mdto/mdto.py +++ b/mdto/mdto.py @@ -713,17 +713,17 @@ def pronominfo(file: str | Path) -> BegripGegevens: fido_found = shutil.which("fido") pronom_backend = os.environ.get("PRONOM_BACKEND", None) - if pronom_backend is not None and pronom_backend not in ("fido", "siegfried"): + if pronom_backend is not None and pronom_backend not in ("fido", "siegfried", "sf"): raise ValueError( - f"invalid PRONOM backend '{pronom_backend}' specified in PRONOM_BACKEND." - "Valid options are 'fido' or 'siegfried'" + f"invalid PRONOM backend '{pronom_backend}' specified in PRONOM_BACKEND. " + "Valid options are 'fido' or 'sf'" ) # If PRONOM_BACKEND is not set, default to siegfried, unless siegfried is not found. # In that case, fallback to fido. if pronom_backend is None: if siegfried_found: - pronom_backend = "siegfried" + pronom_backend = "sf" elif fido_found: pronom_backend = "fido" else: @@ -735,7 +735,7 @@ def pronominfo(file: str | Path) -> BegripGegevens: "or https://github.com/richardlehane/siegfried#install (siegfried)" ) - if pronom_backend == "siegfried": + if pronom_backend in ("sf", "siegfried"): if not siegfried_found: raise RuntimeError( "Program 'sf' (siegfried) not found. "