Skip to content

Commit 814a87d

Browse files
committed
GTK save current pastebin url to clipboard
1 parent 3f7928b commit 814a87d

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

bpython/gtk_.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -621,7 +621,10 @@ def on_suggestion_selection_changed(self, selection, word):
621621

622622

623623
def do_paste(self, widget):
624-
self.pastebin()
624+
clipboard = gtk.clipboard_get()
625+
paste_url = self.pastebin()
626+
clipboard.set_text(paste_url)
627+
clipboard.store()
625628

626629
def do_write2file(self, widget):
627630
self.write2file()

bpython/repl.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -687,6 +687,7 @@ def pastebin(self, s=None):
687687
paste_url = paste_url_template.safe_substitute(paste_id=paste_id)
688688
self.prev_pastebin_url = paste_url
689689
self.interact.notify('Pastebin URL: %s' % (paste_url, ), 10)
690+
return paste_url
690691

691692
def push(self, s, insert_into_history=True):
692693
"""Push a line of code onto the buffer so it can process it all

0 commit comments

Comments
 (0)