/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to bzrlib/crash.py

  • Committer: Martin Pool
  • Date: 2011-01-18 00:41:29 UTC
  • mto: This revision was merged to the branch mainline in revision 5630.
  • Revision ID: mbp@canonical.com-20110118004129-ujkx7azmh1uk7ftz
Put plugin warnings into both the apport and plain crash report

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright (C) 2009, 2010 Canonical Ltd
 
1
# Copyright (C) 2009, 2010, 2011 Canonical Ltd
2
2
#
3
3
# This program is free software; you can redistribute it and/or modify
4
4
# it under the terms of the GNU General Public License as published by
20
20
A crash is an exception propagated up almost to the top level of Bazaar.
21
21
 
22
22
If we have apport <https://launchpad.net/apport/>, we store a report of the
23
 
crash using apport into it's /var/crash spool directory, from where the user
 
23
crash using apport into its /var/crash spool directory, from where the user
24
24
can either manually send it to Launchpad.  In some cases (at least Ubuntu
25
25
development releases), Apport may pop up a window asking if they want
26
26
to send it.
173
173
    pr['Package'] = 'bzr'
174
174
 
175
175
    # tell apport to file directly against the bzr package using 
176
 
    # <https://bugs.edge.launchpad.net/bzr/+bug/391015>
 
176
    # <https://bugs.launchpad.net/bzr/+bug/391015>
177
177
    #
178
178
    # XXX: unfortunately apport may crash later if the crashdb definition
179
179
    # file isn't present
255
255
 
256
256
def _format_plugin_list():
257
257
    plugin_lines = []
 
258
    unreported_warnings = plugin.plugin_warnings.copy()
258
259
    for name, a_plugin in sorted(plugin.plugins().items()):
259
260
        plugin_lines.append("  %-20s %s [%s]" %
260
261
            (name, a_plugin.path(), a_plugin.__version__))
 
262
        if name in unreported_warnings:
 
263
            for line in unreported_warnings[name]:
 
264
                plugin_lines.append("  ** " + line)
 
265
            del unreported_warnings[name]
 
266
    for name in sorted(unreported_warnings.keys()):
 
267
        plugin_lines.append("  %s (failed to load)" % name)
 
268
        for line in unreported_warnings[name]:
 
269
            plugin_lines.append("  ** " + line)
261
270
    return '\n'.join(plugin_lines)
262
271
 
263
272