class ExceptHookDialog(QDialog): def __init__(self, exc_type, exc_obj, exc_tb, title=None): QDialog.__init__(self) self.ui = Ui_ExceptHookDialog() self.ui.setupUi(self) if title: self.setWindowTitle(self.windowTitle() + ": " + title) self.ui.detailsButton.setCheckable(True) self.setExtension(self.ui.tracebackBrowser) self.setOrientation(Qt.Vertical) msg = "%s: %s" % (exc_type.__name__, exc_obj) self.ui.exceptionLabel.setText(msg) html = cgitb.html((exc_type, exc_obj, exc_tb)) self.ui.tracebackBrowser.setText(html) self.resize(self.sizeHint()) @pyqtSignature("") def on_closeButton_clicked(self): self.close() @pyqtSignature("") def on_detailsButton_clicked(self): self.showExtension(self.ui.detailsButton.isChecked())
def __init__(self, exc_type, exc_obj, exc_tb, title=None): QDialog.__init__(self) self.ui = Ui_ExceptHookDialog() self.ui.setupUi(self) if title: self.setWindowTitle(self.windowTitle() + ": " + title) msg = "%s: %s" % (exc_type.__name__, exc_obj) self.ui.exceptionLabel.setText(msg) html = cgitb.text((exc_type, exc_obj, exc_tb)) self.ui.tracebackBrowser.setText(html) self.resize(650, 350) # give enough space to see the backtrace better
def __init__(self, exc_type, exc_obj, exc_tb, title=None): QDialog.__init__(self) self.ui = Ui_ExceptHookDialog() self.ui.setupUi(self) if title: self.setWindowTitle(self.windowTitle() + ": " + title) self.ui.detailsButton.setCheckable(True) msg = "%s: %s" % (exc_type.__name__, exc_obj) self.ui.exceptionLabel.setText(msg) html = cgitb.html((exc_type, exc_obj, exc_tb)) self.ui.tracebackBrowser.setText(html) self.resize(self.sizeHint())
class ExceptHookDialog(QDialog): def __init__(self, exc_type, exc_obj, exc_tb, title=None): QDialog.__init__(self) self.ui = Ui_ExceptHookDialog() self.ui.setupUi(self) if title: self.setWindowTitle(self.windowTitle() + ": " + title) msg = "%s: %s" % (exc_type.__name__, exc_obj) self.ui.exceptionLabel.setText(msg) html = cgitb.text((exc_type, exc_obj, exc_tb)) self.ui.tracebackBrowser.setText(html) self.resize(self.sizeHint()) @pyqtSlot() def on_closeButton_clicked(self): self.close()