diff --git a/src/python/jw/pkg/lib/util.py b/src/python/jw/pkg/lib/util.py index 8f108da9..ab06270c 100644 --- a/src/python/jw/pkg/lib/util.py +++ b/src/python/jw/pkg/lib/util.py @@ -16,6 +16,7 @@ if TYPE_CHECKING: from argparse import Namespace from .ExecContext import ExecContext + from .PathFilter import PathFilter from .ProcFilter import ProcFilter, ProcPipeline T = TypeVar('T') @@ -177,6 +178,7 @@ async def copy( throw: bool = True, recursive: bool = False, parents: bool = False, + default_path_filter: str | PathFilter | None = None, ) -> Exception | str | list[str]: async def __copy_tree(src_path: str, dst_path: str) -> list[str]: @@ -211,7 +213,17 @@ async def copy( if not isinstance(src, (str, FileContext)): ret = [] for uri in src: # TODO: Group identical netlocs into one CopyContext - rr = await copy(uri, dst, owner, group, mode, throw, recursive, parents) + rr = await copy( + uri, + dst, + owner, + group, + mode, + throw, + recursive, + parents, + default_path_filter, + ) if isinstance(rr, Exception): return rr if isinstance(rr, list): @@ -226,7 +238,8 @@ async def copy( from .CopyContext import CopyContext - async with CopyContext(src, dst) as ctx: + async with CopyContext(src, dst, + default_path_filter = default_path_filter) as ctx: src_uri = src.uri if isinstance(src, FileContext) else Uri(src) ret = '' if ctx.dst.chroot else ctx.dst.root