-
Notifications
You must be signed in to change notification settings - Fork 196
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
Support of multiple clipboard formats on Microsoft Windows #162
base: master
Are you sure you want to change the base?
Conversation
Now copy and paste have an optional parameter on the windows version that specifies which clipboard format is to be used. It does so while maintaining compatibility with the usual usage: copy(text) text=paste() The usage with formats is the following copy(text, clipboard_format) paste(clipboard_format) Also, multiple formats can be copied if using copy({CF_UNICODETEXT: "this is the unicode text", CF_TEXT: b"This is the ascii text", CF_BITMAP: bitmap_image}) paste_dict = paste([CF_TEXT, CF_UNICODETEXT]) # Pastes only these two paste_all = paste([]) # This pastes all available formats into a dictionary
Reformatting code as per PEP formatting recommendations Adding PyCharm project settings
Hi there.... |
@nunobrum Unfortunately, I don't think this package is actively being worked on. If you end up making a new package, I'd check it out for sure! |
@nickdallege Thanks for your answer. I'll put it on my TODO list to make a new package. It might take a while since I'm now quite busy with my daytime job. |
Thanks for working on this, I wish I had stumbled on this earlier (I implemented something similar myself before I saw this). I linked #126 which does something similar for xclip/Linux. |
First of all, congratulations on your python package. Well done!
I have updated your pyperclip module in order to enable the support of multiple clipboard formats.
I've kept backwards compatibility although it was not really obvious to do so because of the lazy load that is implemented.
I'm guessing that there is a very strong reason for it, so, I've kept it.
I've also couldn't just update the all assignment in the module to add more functions that would be used only on windows platform.
I've updated the usage on the README.md file to explain how the multiple clipboard formats are implemented.
I think the next step would be to see if multiple clipboard formats are available in other platforms and implement a common API that implements this a bit more elegantly as it is now.
Anyway, I'm submitting this pull request for you to look at it, and see if it is good enough for you to push it into the main code. If you think that the change has too much of a "hacking" look into it, (I can't disagree), I'll probably break compatibility and derive a completely new package.
Just let me know what are your thoughts on this.
Happy new Year,
Nuno
P.S. I did cleaned a bit the code to match the Python's PEP formatting recommendations.