Mercurial > hg > config
view python/pbmoz.py @ 275:7ffc6b1821f8
http://stackoverflow.com/questions/6397323/how-to-avoid-the-message-of-server-start-while-opening-another-emacs-session sadly doesnt help
author | Jeff Hammel <jhammel@mozilla.com> |
---|---|
date | Wed, 10 Apr 2013 15:17:19 -0700 |
parents | c1390e43b437 |
children |
line wrap: on
line source
#!/usr/bin/env python import urllib, sys if len(sys.argv) == 2: url = "http://%s.pastebin.mozilla.org" % sys.argv[1] fmt = sys.argv[1] else: url = "http://pastebin.mozilla.org" fmt = "None" body = sys.stdin.read() params = [ ('parent_pid', ''), ('code2', body), ('poster', ''), ('expiry', 'd'), ('paste', 'Send'), ('format', fmt), ] data = urllib.urlencode(params) req = urllib.urlopen(url, data) print req.geturl()