Conversation
|
EDIT: please wait for this to be merged: #120 |
|
Okay please merge the main branch into yours and you should get a working CI again. Sorry for the turmoil, keeping this up takes some effort. |
|
Thank for fixing the CI, maintaning such projects is hard. I just noticed that pycyphal has a |
|
Progress callbacks in FileClient2 would be a welcome addition! |
|
I think this should be ready, just needs the pycyphal PR to be merged. Also probably a release? The |
| @@ -0,0 +1,168 @@ | |||
| # Copyright (c) 2021 OpenCyphal | |||
| # This software is distributed under the terms of the MIT License. | |||
| # Author: Pavel Kirienko <pavel@opencyphal.org> | |||
There was a problem hiding this comment.
Please update the authorship remark. I didn't write this module.
There was a problem hiding this comment.
Ah, ok, I thought file headers are consistent for entire repository 🤔
| __license__ = "MIT" | ||
|
|
||
| from .main import main as main, subcommand as subcommand, Purser as Purser, pass_purser as pass_purser | ||
| from .main import main as main, subcommand as subcommand, commandgroup as commandgroup, Purser as Purser, pass_purser as pass_purser |
| @@ -0,0 +1,443 @@ | |||
| # Copyright (c) 2021 OpenCyphal | |||
| # This software is distributed under the terms of the MIT License. | |||
| # Author: Pavel Kirienko <pavel@opencyphal.org> | |||
There was a problem hiding this comment.
| # Author: Pavel Kirienko <pavel@opencyphal.org> |
| from pycyphal.application.file import FileClient2 | ||
|
|
||
| src = PurePosixPath(src) | ||
| dst = Path(dst) if dst else Path(src.name) |
There was a problem hiding this comment.
I think the default behavior should be to stream the data into stdout in binary mode (sys.stdout.buffer.write(...)), because this is the unix way and is probably expected by default.
There was a problem hiding this comment.
I would argue that cp src dst is a more unix way than cat src > dst for moving files. Also, when using pipes the progress can not be displayed, though correct me on this.
| @click.argument("src") | ||
| @click.argument("dst", required=False) |
There was a problem hiding this comment.
Do you think it would be better to require dst and make src optional, defaulting to stdin in binary mode instead? This would mirror the read command.
| is_flag=True, | ||
| help=""" | ||
| Ignore nodes that fail to respond to the first RPC-service request instead of reporting an error | ||
| assuming that the register service is not supported. |
There was a problem hiding this comment.
| assuming that the register service is not supported. | |
| assuming that the file service is not supported. |
|
PyCyphal v1.23.0 should go live in about 40 min |
|
Sorry for stalling on this, I got different priorities at work ATM. I will get back to this PR when I find time |
This PR implements service client functions for
uavcan.file.*services.I grouped everything under
file-clientcommand group, but since there was no other example of command group, I'm not sure if I implemented it properly. I would also like to get feedback about the progress/error reporting as it was a bit confusing how it's supposed to work.Posting this as a draft, because of TODO: