Fixing the namespaces in 0launch broke 0compile...
[0compile.git] / bugs.py
blob5e34bb7d8aa663176e6ef9527f3a450011466bc7
1 # Copyright (C) 2006, Thomas Leonard
2 # See http://0install.net/0compile.html
4 import sys, os, __main__
5 from logging import info
7 from support import *
9 def do_report_bug(args):
10 """report-bug"""
11 buildenv = BuildEnv()
13 log_name = 'build/build-failure.log'
14 build_log = file(log_name)
15 log_text = build_log.read()
16 build_log.close()
18 import urllib
19 from urllib2 import urlopen
21 print "Sending contents of %s file to default bug tracker..." % log_name
23 stream = urlopen('http://sourceforge.net/tracker/index.php',
24 urllib.urlencode({
25 'group_id': '76468',
26 'atid': '905152',
27 'func': 'postadd',
28 'is_private': '0',
29 'summary': log_text.split('\n', 1)[0], # First line of log
30 'details': log_text}))
31 stream.read()
32 stream.close()
34 __main__.commands.append(do_report_bug)