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

Method pastebin

bpython/repl.py:945–957  ·  view source on GitHub ↗

Upload to a pastebin and display the URL in the status bar.

(self, s=None)

Source from the content-addressed store, hash-verified

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."""
947
948 if s is None:
949 s = self.getstdout()
950
951 if self.config.pastebin_confirm and not self.interact.confirm(
952 _("Pastebin buffer? (y/N) ")
953 ):
954 self.interact.notify(_("Pastebin aborted."))
955 return None
956 else:
957 return self.do_pastebin(s)
958
959 def do_pastebin(self, s) -> str | None:
960 """Actually perform the upload."""

Callers

nothing calls this directly

Calls 5

getstdoutMethod · 0.95
do_pastebinMethod · 0.95
_Function · 0.90
confirmMethod · 0.45
notifyMethod · 0.45

Tested by

no test coverage detected