Merge lp:~smoser/ubuntu/lucid/apport/bug-486122 into lp:~ubuntu-core-dev/ubuntu/lucid/apport/ubuntu

Proposed by Scott Moser
Status: Merged
Merged at revision: 1734
Proposed branch: lp:~smoser/ubuntu/lucid/apport/bug-486122
Merge into: lp:~ubuntu-core-dev/ubuntu/lucid/apport/ubuntu
Diff against target: 72 lines (+20/-11)
1 file modified
bin/apport-cli (+20/-11)
To merge this branch: bzr merge lp:~smoser/ubuntu/lucid/apport/bug-486122
Reviewer Review Type Date Requested Status
Martin Pitt Approve
Review via email: mp+21669@code.launchpad.net

Description of the change

Fix for bug 486122.

To post a comment you must log in.
Revision history for this message
Martin Pitt (pitti) wrote :

I applied your patch to trunk (r1734) with two tiny stylistic corrections, thanks a lot!

Thus I couldn't technically merge your branch, since it's not mergeable to trunk.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'bin/apport-cli'
2--- bin/apport-cli 2009-12-23 10:55:52 +0000
3+++ bin/apport-cli 2010-03-18 19:22:25 +0000
4@@ -189,22 +189,18 @@
5 # Fallback
6 return 'cancel'
7
8- def ui_present_report_details(self, is_update):
9- if is_update:
10- dialog = CLIDialog (_('Send this data to the developers?'), None)
11- else:
12- dialog = CLIDialog (_('Send problem report to the developers?'),
13- _('After the problem report has been sent, please fill out the form in the\n'
14- 'automatically opened web browser.'))
15-
16+ def ui_get_details(self):
17 # report contents
18 details = ''
19+ max_show = 1024 * 1024
20 for key in self.report:
21 details += key + ':'
22 # string value
23+ keylen = len(self.report[key])
24 if not hasattr(self.report[key], 'gzipvalue') and \
25 hasattr(self.report[key], 'isspace') and \
26- not self.report._is_binary(self.report[key]):
27+ not self.report._is_binary(self.report[key]) and \
28+ keylen < max_show:
29 lines = self.report[key].splitlines()
30 if len(lines) <= 1:
31 details += ' ' + self.report[key] + '\n'
32@@ -212,9 +208,22 @@
33 details += '\n'
34 for line in lines:
35 details += ' ' + line + '\n'
36+ elif keylen >= max_show:
37+ details += ' ' + (_('(%s bytes)') % keylen ) + '\n'
38 else:
39 details += ' ' + _('(binary data)') + '\n'
40
41+ return details
42+
43+
44+ def ui_present_report_details(self, is_update):
45+ if is_update:
46+ dialog = CLIDialog (_('Send this data to the developers?'), None)
47+ else:
48+ dialog = CLIDialog (_('Send problem report to the developers?'),
49+ _('After the problem report has been sent, please fill out the form in the\n'
50+ 'automatically opened web browser.'))
51+
52 # complete/reduced reports
53 if self.report.has_key('CoreDump') and self.report.has_useful_stacktrace():
54 complete = dialog.addbutton(_('&Send complete report (recommended; %s)') %
55@@ -242,7 +251,7 @@
56 try:
57 subprocess.Popen(["/usr/bin/sensible-pager"],
58 stdin=subprocess.PIPE,
59- close_fds=True).communicate(details)
60+ close_fds=True).communicate(self.ui_get_details())
61 except IOError, e:
62 # ignore broken pipe (premature quit)
63 if e.errno == errno.EPIPE:
64@@ -396,7 +405,7 @@
65 _('You can launch a browser now, or copy this URL into a browser on another computer.'))
66
67 answer = self.ui_question_choice(text, [_('Launch a browser now')], False)
68- if answer == [0]:
69+ if answer == [0]:
70 apport.ui.UserInterface.open_url(self, url)
71
72 if __name__ == '__main__':

Subscribers

People subscribed via source and target branches

to all changes: