From d0eca89b63fccc2f9f47690befbdf9c10c0966c2 Mon Sep 17 00:00:00 2001 From: Jan Lindemann Date: Sat, 3 Oct 2026 21:39:30 +0200 Subject: [PATCH] lib.FileContext.chroot: Add property Give FileContext a read-only property to access self.__chroot, so a caller holding a context can predict whether the addresses it passes in are relative to the URI path or absolute. Signed-off-by: Jan Lindemann Assisted-by: unsloth/Qwen3.8-27B-GGUF:Q4_K_M with pi.dev v1.0.1 --- src/python/jw/pkg/lib/FileContext.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/python/jw/pkg/lib/FileContext.py b/src/python/jw/pkg/lib/FileContext.py index aa61f10d..736caa97 100644 --- a/src/python/jw/pkg/lib/FileContext.py +++ b/src/python/jw/pkg/lib/FileContext.py @@ -112,6 +112,10 @@ class FileContext(abc.ABC): def root(self) -> str: return self.__uri.path + @property + def chroot(self) -> bool: + return self.__chroot + @property def username(self) -> str | None: return self.__uri.username