5
#from apport import unicode_gettext as _
7
def make_title(report):
8
lines = report['StackTrace'].split('\n')
9
message = lines[0].strip()
10
stackframe = lines[1].strip()
11
return '%s in %s' % (message, stackframe)
14
from apport.packaging_impl import impl as packaging
15
if not packaging.enabled():
18
# read from the JVM process a sequence of key, value delimited by null
20
items = sys.stdin.read().split('\0')
28
log = open('/tmp/log', 'w')
35
report = apport.report.Report(type='Crash')
36
# assume our parent is the JVM process
37
report.pid = os.getppid()
40
report.add_proc_info()
41
# these aren't relevant because the crash was in bytecode
42
del report['ProcMaps']
43
del report['ProcStatus']
44
report.add_user_info()
46
# add in data which was fed to us from the JVM process
47
for key, value in d.items():
50
if 'MainClassUrl' in report:
52
url = report['MainClassUrl']
53
scheme, netloc, path, params, query, fragment = urlparse.urlparse(url)
58
report['ExecutablePath'] = path.split('!/', 1)
60
report['ExecutablePath'] = path
62
report['Title'] = make_title(report)
64
report.write(open(apport.fileutils.make_report_path(report), 'w'))
66
if __name__ == '__main__':