def _onReportTriggered(self, index): report_handlers = get_report_handlers() combo = self.reportComboBox name = combo.itemData(index) report_handler = report_handlers[name] report = report_handler(self) app = Application() txt = _REPORT.format(appName=app.applicationName(), appVersion=app.applicationVersion(), time=datetime.datetime.now().ctime(), text=self.getText(), detail=self.getDetailedText(), origin=self.getOriginText()) report.report(txt)
def _onReportTriggered(self, index): report_handlers = get_report_handlers() combo = self.reportComboBox name = combo.itemData(index) report_handler = report_handlers[name] report = report_handler(self) app = Application() txt = _REPORT.format( appName=app.applicationName(), appVersion=app.applicationVersion(), time=datetime.datetime.now().ctime(), text=self.getText(), detail=self.getDetailedText(), origin=self.getOriginText(), ) report.report(txt)
def report(self, message): app = Application() subject = "Error in " + app.applicationName() dialog = self.createDialog(subject=subject, message=message) if not dialog.exec_(): return mail_info = dialog.getMailInfo() try: self.sendMail(*mail_info) QtGui.QMessageBox.information(None, "Done!", "Email has been sent!") except: einfo = sys.exc_info()[:2] msg = "".join(traceback.format_exception_only(*einfo)) QtGui.QMessageBox.warning(None, "Failed to send email", "Failed to send email. Reason:\n\n" + msg)
def report(self, message): app = Application() subject = "Error in " + app.applicationName() dialog = self.createDialog(subject=subject, message=message) if not dialog.exec_(): return mail_info = dialog.getMailInfo() try: self.sendMail(*mail_info) QtGui.QMessageBox.information(None, "Done!", "Email has been sent!") except: einfo = sys.exc_info()[:2] msg = "".join(traceback.format_exception_only(*einfo)) QtGui.QMessageBox.warning( None, "Failed to send email", "Failed to send email. Reason:\n\n" + msg)