Module: deluge Branch: master Commit: 5ad3a1666c7c6f60aa0a4a6bc6fbf04f173724ac
Author: Andrew Resch <[email protected]> Date: Sun Dec 12 09:58:28 2010 -0800 Update the ErrorDialog --- deluge/ui/gtkui/dialogs.py | 17 +++++++++++++++-- 1 files changed, 15 insertions(+), 2 deletions(-) diff --git a/deluge/ui/gtkui/dialogs.py b/deluge/ui/gtkui/dialogs.py index cf1cf91..9409513 100644 --- a/deluge/ui/gtkui/dialogs.py +++ b/deluge/ui/gtkui/dialogs.py @@ -147,13 +147,16 @@ class ErrorDialog(BaseDialog): When run(), it will return a gtk.RESPONSE_CLOSE. """ - def __init__(self, header, text, parent=None, details=None): + def __init__(self, header, text, parent=None, details=None, traceback=False): """ :param header: see `:class:BaseDialog` :param text: see `:class:BaseDialog` :param parent: see `:class:BaseDialog` - :param details: str, extra information that will be displayed in a + :param details: extra information that will be displayed in a scrollable textview + :type details: string + :param traceback: show the traceback information in the details area + :type traceback: bool """ super(ErrorDialog, self).__init__( header, @@ -162,6 +165,16 @@ class ErrorDialog(BaseDialog): (gtk.STOCK_CLOSE, gtk.RESPONSE_CLOSE), parent) + if traceback: + import traceback + import sys + tb = sys.exc_info() + tb = traceback.format_exc(tb[2]) + if details: + details += "\n" + tb + else: + details = tb + if details: self.set_default_size(500, 400) textview = gtk.TextView() -- You received this message because you are subscribed to the Google Groups "deluge-commit" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/deluge-commit?hl=en.
