1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18 """system information collector and bug reporter"""
19
20 import urllib
21 import webbrowser
22
23 from flumotion.common.common import pathToModuleName
24 from flumotion.common.debug import getVersions
25 from flumotion.configure import configure
26
27 _BUG_COMPONENT = 'flumotion'
28 _BUG_KEYWORDS = 'generated'
29 _BUG_TEMPLATE = """
30 Please describe what you were doing when the crash happened.
31
32 ADD YOUR TEXT HERE
33
34 Collected information from your system:
35
36 * Flumotion version: '''%(version)s'''
37 * Flumotion SVN revision: [source:flumotion/%(branch)s#%(rev)s r%(rev)s]
38 %(extra)s
39 Python Traceback:
40 {{{
41 %(traceback)s
42 }}}
43 """
44 _TRAC_URL = 'https://code.flumotion.com/trac'
45
46
48 """I am a class that collects information about the system
49 and reports the information to the Flumotion bug report system.
50 """
51
57
66
77
86
87
88
89 - def submit(self, filenames, description, summary):
90 """Submits a bug report to trac by opening
91 a web browser
92 @param filenames: filenames visible in traceback
93 @type filenames: list of strings
94 @param description: description of the traceback
95 @type description: string
96 @param summary: summary of the bug report
97 @type summary: string
98 """
99 description = self._processTemplate(filenames, description)
100 params = dict(summary=summary,
101 description=description)
102 if self._keywords:
103 params['keywords'] = ','.join(self._keywords)
104 if self._component:
105 params['component'] = self._component
106
107 data = urllib.urlencode(params)
108 reportURL = "%s/newticket?%s" % (self._baseURL, data, )
109 webbrowser.open_new(reportURL)
110