Skip to content
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

pikvm_comm.py: add local image upload kwd #16

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

wiktormowinski
Copy link

No description provided.

pikvm_comm.py Outdated Show resolved Hide resolved


@keyword("Copy Image PIKVM")
def CopyImagePiKVM(
Copy link
Member

@macpijan macpijan Oct 23, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@wiktormowinski It seems like this is almost identical to UploadImagePiKVM with a single change of removing ?url= from the request.

Why not use another function to share the common code between these two?

Also, I would suggest to use better naming, so it's obvious that one kwd works on file, while the second one works on URL. Now you simply changed Upload to Copy. We still perform the upload, but simply from local path, not from the remote URL. It's been changed for the sake of being different, but it's name does not really tell much.

Better names could be something like: Upload From File / Upload From URL. Or even further, if these keywords are so similar, you can make it accept both URL and local path, and then adjust request accordingly. Either automatically based on the argument, or manually, by introducing second argument which switches between file and URL.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants