Switch branches/tags
Nothing to show
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
executable file 27 lines (18 sloc) 673 Bytes
#!/usr/bin/env python
import re
import gtk
primary = gtk.clipboard_get(gtk.gdk.SELECTION_PRIMARY)
if not primary.wait_is_text_available() :
s = primary.wait_for_text()
from PyQt5.QtCore import QApplication
qc = QApplication.clipboard()
s = qc.text(c.Selection)
# Use qc.Clipboard if you want the clipboard selection
# If it's a LinkedIn URL, fix their stupid errors:
if'(www\.)*', s, flags=re.IGNORECASE):
s = s.replace("&", "&") + "&count=1000&paginationToken="
# eliminate newlines, and any spaces immediately following a newline:
print(re.sub(r'[\r\n]+ *', '', s))