MCPcopy
hub / github.com/asweigart/pyperclip / init_dev_clipboard_clipboard

Function init_dev_clipboard_clipboard

src/pyperclip/__init__.py:267–285  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

265
266
267def init_dev_clipboard_clipboard():
268 def copy_dev_clipboard(text):
269 text = _PYTHON_STR_TYPE(text) # Converts non-str values to str.
270 if text == '':
271 warnings.warn('Pyperclip cannot copy a blank string to the clipboard on Cygwin. This is effectively a no-op.')
272 if '\r' in text:
273 warnings.warn('Pyperclip cannot handle \\r characters on Cygwin.')
274
275 fo = open('/dev/clipboard', 'wt')
276 fo.write(text)
277 fo.close()
278
279 def paste_dev_clipboard():
280 fo = open('/dev/clipboard', 'rt')
281 content = fo.read()
282 fo.close()
283 return content
284
285 return copy_dev_clipboard, paste_dev_clipboard
286
287
288def init_no_clipboard():

Callers 2

TestCygwinClass · 0.90
determine_clipboardFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…