MCPcopy Index your code
hub / github.com/bpython/bpython / copy2clipboard

Method copy2clipboard

bpython/repl.py:930–943  ·  view source on GitHub ↗

Copy current content to clipboard.

(self)

Source from the content-addressed store, hash-verified

928 self.interact.notify(_("Saved to %s.") % (path,))
929
930 def copy2clipboard(self) -> None:
931 """Copy current content to clipboard."""
932
933 if not have_pyperclip:
934 self.interact.notify(_("No clipboard available."))
935 return
936
937 content = self.get_session_formatted_for_file()
938 try:
939 pyperclip.copy(content)
940 except pyperclip.PyperclipException:
941 self.interact.notify(_("Could not copy to clipboard."))
942 else:
943 self.interact.notify(_("Copied content to clipboard."))
944
945 def pastebin(self, s=None) -> str | None:
946 """Upload to a pastebin and display the URL in the status bar."""

Callers

nothing calls this directly

Calls 3

_Function · 0.90
notifyMethod · 0.45

Tested by

no test coverage detected