MCPcopy
hub / github.com/pandas-dev/pandas / init_osx_pyobjc_clipboard

Function init_osx_pyobjc_clipboard

pandas/io/clipboard/__init__.py:117–133  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

115
116
117def 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
136def init_qt_clipboard():

Callers 1

determine_clipboardFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected