Closed MarkRx closed 3 years ago
Fixes a bug where the clipboard does not properly handle 'None'
>>> import dragonfly.util.clipboard >>> clip = dragonfly.util.clipboard.Clipboard() >>> clip.has_text() False >>> clip.set_text('None') >>> clip.has_text() True >>> clip.get_text() 'None' >>> clip.set_text(None) >>> clip.has_text() False >>> clip.get_text() >>> clip.set_text(False) >>> clip.has_text() True >>> clip.get_text() 'False'
>>> import dragonfly.windows.clipboard >>> clip2 = dragonfly.windows.clipboard.Clipboard() >>> clip2.has_text() False >>> clip2.set_text('None') >>> clip2.has_text() True >>> clip2.get_text() 'None' >>> clip2.set_text(None) >>> clip2.has_text() False >>> clip2.get_text() >>> clip2.set_text(False) >>> clip2.has_text() True >>> clip2.get_text() 'False'
Thanks! This looks good to me. Sorry I took a while to respond. I will add relevant test cases to test_clipboard.py and merge soon.
test_clipboard.py
Fixes a bug where the clipboard does not properly handle 'None'