()
| 115 | |
| 116 | |
| 117 | def init_osx_pyobjc_clipboard(): |
| 118 | def copy_osx_pyobjc(text): |
| 119 | """Copy string argument to clipboard""" |
| 120 | text = _stringifyText(text) # Converts non-str values to str. |
| 121 | newStr = Foundation.NSString.stringWithString_(text).nsstring() |
| 122 | newData = newStr.dataUsingEncoding_(Foundation.NSUTF8StringEncoding) |
| 123 | board = AppKit.NSPasteboard.generalPasteboard() |
| 124 | board.declareTypes_owner_([AppKit.NSStringPboardType], None) |
| 125 | board.setData_forType_(newData, AppKit.NSStringPboardType) |
| 126 | |
| 127 | def paste_osx_pyobjc(): |
| 128 | """Returns contents of clipboard""" |
| 129 | board = AppKit.NSPasteboard.generalPasteboard() |
| 130 | content = board.stringForType_(AppKit.NSStringPboardType) |
| 131 | return content |
| 132 | |
| 133 | return copy_osx_pyobjc, paste_osx_pyobjc |
| 134 | |
| 135 | |
| 136 | def init_qt_clipboard(): |
no outgoing calls
no test coverage detected