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

Function init_dev_clipboard_clipboard

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

Source from the content-addressed store, hash-verified

285
286
287def init_dev_clipboard_clipboard():
288 def copy_dev_clipboard(text):
289 text = _stringifyText(text) # Converts non-str values to str.
290 if text == "":
291 warnings.warn(
292 "Pyperclip cannot copy a blank string to the clipboard on Cygwin. "
293 "This is effectively a no-op.",
294 stacklevel=find_stack_level(),
295 )
296 if "\r" in text:
297 warnings.warn(
298 "Pyperclip cannot handle \\r characters on Cygwin.",
299 stacklevel=find_stack_level(),
300 )
301
302 with open("/dev/clipboard", "w", encoding="utf-8") as fd:
303 fd.write(text)
304
305 def paste_dev_clipboard() -> str:
306 with open("/dev/clipboard", encoding="utf-8") as fd:
307 content = fd.read()
308 return content
309
310 return copy_dev_clipboard, paste_dev_clipboard
311
312
313def init_no_clipboard():

Callers 1

determine_clipboardFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected