Skip to content

Commit

Permalink
Merge pull request #688 from christian-monch/nail_down_kwargs
Browse files Browse the repository at this point in the history
consolidate keyword argument indicator
  • Loading branch information
mih committed May 16, 2024
2 parents 096a567 + 2aee6e8 commit a63cce6
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
4 changes: 2 additions & 2 deletions datalad_next/patches/replace_sshremoteio.py
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ def put(self, src, dst, progress_cb):
PurePosixPath(dst),
# the given callback only takes a single int, but posix.upload
# gives two (cur, target) -> have an adaptor
lambda c, m: progress_cb(c),
progress_callback=lambda c, m: progress_cb(c),
check=True,
)

Expand All @@ -218,7 +218,7 @@ def get(self, src, dst, progress_cb):
Path(dst),
# the given callback only takes a single int, but posix.download
# gives two (cur, target) -> have an adaptor
lambda c, m: progress_cb(c),
progress_callback=lambda c, m: progress_cb(c),
check=True,
)

Expand Down
9 changes: 7 additions & 2 deletions datalad_next/shell/operations/posix.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ def upload(
shell: ShellCommandExecutor,
local_path: Path,
remote_path: PurePosixPath,
*,
progress_callback: Callable[[int, int], None] | None = None,
check: bool = False,
) -> ExecutionResult:
Expand Down Expand Up @@ -96,7 +97,11 @@ def upload(
"""

def signaling_read(
file: BinaryIO, size: int, queue: Queue, chunk_size: int = COPY_BUFSIZE
file: BinaryIO,
size: int,
queue: Queue,
*,
chunk_size: int = COPY_BUFSIZE
):
"""iterator that reads from a file and signals EOF via a queue
Expand Down Expand Up @@ -158,8 +163,8 @@ def download(
shell: ShellCommandExecutor,
remote_path: PurePosixPath,
local_path: Path,
progress_callback: Callable[[int, int], None] | None = None,
*,
progress_callback: Callable[[int, int], None] | None = None,
response_generator_class: type[
DownloadResponseGenerator
] = DownloadResponseGeneratorPosix,
Expand Down

0 comments on commit a63cce6

Please sign in to comment.