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

Function init_wl_clipboard

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

Source from the content-addressed store, hash-verified

221
222
223def init_wl_clipboard():
224 PRIMARY_SELECTION = "-p"
225
226 def copy_wl(text, primary=False):
227 text = _stringifyText(text) # Converts non-str values to str.
228 args = ["wl-copy"]
229 if primary:
230 args.append(PRIMARY_SELECTION)
231 if not text:
232 args.append("--clear")
233 subprocess.check_call(args, close_fds=True)
234 else:
235 p = subprocess.Popen(args, stdin=subprocess.PIPE, close_fds=True)
236 p.communicate(input=text.encode(ENCODING))
237
238 def paste_wl(primary=False):
239 args = ["wl-paste", "-n"]
240 if primary:
241 args.append(PRIMARY_SELECTION)
242 p = subprocess.Popen(args, stdout=subprocess.PIPE, close_fds=True)
243 stdout, _stderr = p.communicate()
244 return stdout.decode(ENCODING)
245
246 return copy_wl, paste_wl
247
248
249def init_klipper_clipboard():

Callers 1

determine_clipboardFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected