lib.util.copy(): Support FileContext source, file types, and --parents #144

Merged
Jan Lindemann merged 8 commits from jan/feature/20261017-lib-util-copy-support-filecontext-source-file-types-and-parents into master 2026-10-17 11:57:05 +02:00 AGit
Showing only changes of commit d0eca89b63 - Show all commits

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
Jan Lindemann 2026-10-03 21:39:30 +02:00
Signed by: Jan Lindemann
GPG key ID: 3750640C9E25DD61

View file

@ -112,6 +112,10 @@ class FileContext(abc.ABC):
def root(self) -> str: def root(self) -> str:
return self.__uri.path return self.__uri.path
@property
def chroot(self) -> bool:
return self.__chroot
@property @property
def username(self) -> str | None: def username(self) -> str | None:
return self.__uri.username return self.__uri.username