3 import os, os.path, sys, urllib, subprocess, smtplib
6 print '''Usage: fixbug <bug number>'''
10 desc = sys.stdin.read()
15 report += ''' status fixreleased
22 if os.access('/usr/bin/gnome-gpg', os.X_OK):
23 sign_command = 'gnome-gpg'
25 gpg = subprocess.Popen([sign_command, '--clearsign'], stdin=subprocess.PIPE, stdout=subprocess.PIPE)
26 signed_report = gpg.communicate(report)[0]
27 assert gpg.returncode == 0
30 myemailaddr = os.getenv('DEBEMAIL')
32 to = '%i@bugs.launchpad.net' % bug
38 %s''' % (myemailaddr, to, signed_report)
40 s = smtplib.SMTP('fiordland.ubuntu.com')
41 s.sendmail(myemailaddr, to, mail)