Convert target path from Path to str & PurePath
The target path is just read as string from the CLI now, to allow more complex targets (such as URLs) that don't directly map to a path. The Packer subclass now handles the conversion from that string to a `pathlib.PurePath`, and specific subclasses & transfer classes can convert those to a `pathlib.Path` to perform actual filesystem operations when necessary.
This commit is contained in:
@@ -59,11 +59,12 @@ class FileCopier(transfer.FileTransferer):
|
||||
|
||||
pool = multiprocessing.pool.ThreadPool(processes=self.transfer_threads)
|
||||
|
||||
for src, dst, act in self.iter_queue():
|
||||
for src, pure_dst, act in self.iter_queue():
|
||||
try:
|
||||
if self._error.is_set() or self._abort.is_set():
|
||||
raise AbortTransfer()
|
||||
|
||||
dst = pathlib.Path(pure_dst)
|
||||
if self._skip_file(src, dst, act):
|
||||
continue
|
||||
|
||||
|
||||
Reference in New Issue
Block a user