Added 3rd-party dependency on pyperclip for clipboard copy/paste functionality#155
Merged
tleonhardt merged 4 commits intomasterfrom Jun 30, 2017
Merged
Added 3rd-party dependency on pyperclip for clipboard copy/paste functionality#155tleonhardt merged 4 commits intomasterfrom
tleonhardt merged 4 commits intomasterfrom
Conversation
- Added a 3rd-party dependency on the pyperclip module TODO: Rigorous test on all OSes, particularly Linux systems without xclip
…board If Pyperclip could not find a copy/paste mechanism for your system, then cmd2.can_clip gets set to False. If cmd2.can_clip is False, then the "send_to_paste_buffer" test gets skipped.
So it turns out that on Linux, it sys.platform is "linux2" in Python 2 and "linux" in Python 3, so if doing a comparsion, need to do a .startswith() instead of a ==
Codecov Report
@@ Coverage Diff @@
## master #155 +/- ##
==========================================
+ Coverage 84.25% 88.53% +4.27%
==========================================
Files 1 1
Lines 1207 1151 -56
==========================================
+ Hits 1017 1019 +2
+ Misses 190 132 -58
Continue to review full report at Codecov.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The custom code which was previously in cmd2 for copy and paste to/from clipboard/pastebuffer functionality and was different for each OS has been removed.
It has been replaced with much simpler code using the
pyperclipmodule.This does add an additional 3rd-party dependency to cmd2, but it is worth it, because
pyperclipworks in a lot more situations than the previous code did.This closes #151