-
-
Notifications
You must be signed in to change notification settings - Fork 13
Implement file client functions #119
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
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 <[email protected]> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please update the authorship remark. I didn't write this module.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, ok, I thought file headers are consistent for entire repository 🤔
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no
@@ -22,6 +22,6 @@ def _read_package_file(name: str) -> str: | |||
__copyright__ = f"Copyright (c) 2020 {__author__} <{__email__}>" | |||
__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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this line is too long
@@ -0,0 +1,443 @@ | |||
# Copyright (c) 2021 OpenCyphal | |||
# This software is distributed under the terms of the MIT License. | |||
# Author: Pavel Kirienko <[email protected]> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
# Author: Pavel Kirienko <[email protected]> |
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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-client
command 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: