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 <jan@janware.com>
Assisted-by: unsloth/Qwen3.8-27B-GGUF:Q4_K_M with pi.dev v1.0.1
This commit is contained in:
Jan Lindemann 2026-10-03 21:39:30 +02:00
commit d0eca89b63
Signed by: Jan Lindemann
GPG key ID: 3750640C9E25DD61

View file

@ -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