Debugger/DebugUI.py

changeset 553
5af61623ae3c
parent 539
87f9bce38a44
child 564
b3d966393ba9
equal deleted inserted replaced
551:e1074b63ff08 553:5af61623ae3c
997 (len(self.excList) and exceptionType in self.excList)))\ 997 (len(self.excList) and exceptionType in self.excList)))\
998 or exceptionType.startswith('unhandled'): 998 or exceptionType.startswith('unhandled'):
999 if stackTrace: 999 if stackTrace:
1000 self.viewmanager.setFileLine(stackTrace[0][0], stackTrace[0][1], True) 1000 self.viewmanager.setFileLine(stackTrace[0][0], stackTrace[0][1], True)
1001 if Preferences.getDebugger("BreakAlways"): 1001 if Preferences.getDebugger("BreakAlways"):
1002 res = QMessageBox.Yes 1002 res = E5MessageBox.Yes
1003 else: 1003 else:
1004 if stackTrace: 1004 if stackTrace:
1005 if exceptionType.startswith('unhandled'): 1005 if exceptionType.startswith('unhandled'):
1006 buttons = QMessageBox.StandardButtons(\ 1006 buttons = E5MessageBox.StandardButtons(\
1007 QMessageBox.No | \ 1007 E5MessageBox.No | \
1008 QMessageBox.Yes) 1008 E5MessageBox.Yes)
1009 else: 1009 else:
1010 buttons = QMessageBox.StandardButtons(\ 1010 buttons = E5MessageBox.StandardButtons(\
1011 QMessageBox.No | \ 1011 E5MessageBox.No | \
1012 QMessageBox.Yes | \ 1012 E5MessageBox.Yes | \
1013 QMessageBox.Ignore) 1013 E5MessageBox.Ignore)
1014 res = E5MessageBox.critical(self.ui, Program, 1014 res = E5MessageBox.critical(self.ui, Program,
1015 self.trUtf8('<p>The debugged program raised the exception' 1015 self.trUtf8('<p>The debugged program raised the exception'
1016 ' <b>{0}</b><br>"<b>{1}</b>"<br>File: <b>{2}</b>,' 1016 ' <b>{0}</b><br>"<b>{1}</b>"<br>File: <b>{2}</b>,'
1017 ' Line: <b>{3}</b></p><p>Break here?</p>') 1017 ' Line: <b>{3}</b></p><p>Break here?</p>')
1018 .format(exceptionType, 1018 .format(exceptionType,
1019 Utilities.html_encode(exceptionMessage), 1019 Utilities.html_encode(exceptionMessage),
1020 stackTrace[0][0], 1020 stackTrace[0][0],
1021 stackTrace[0][1]), 1021 stackTrace[0][1]),
1022 buttons, 1022 buttons,
1023 QMessageBox.No) 1023 E5MessageBox.No)
1024 else: 1024 else:
1025 res = E5MessageBox.critical(self.ui, Program, 1025 res = E5MessageBox.critical(self.ui, Program,
1026 self.trUtf8('<p>The debugged program raised the exception' 1026 self.trUtf8('<p>The debugged program raised the exception'
1027 ' <b>{0}</b><br>"<b>{1}</b>"</p>') 1027 ' <b>{0}</b><br>"<b>{1}</b>"</p>')
1028 .format(exceptionType, 1028 .format(exceptionType,
1029 Utilities.html_encode(exceptionMessage))) 1029 Utilities.html_encode(exceptionMessage)))
1030 if res == QMessageBox.Yes: 1030 if res == E5MessageBox.Yes:
1031 self.exceptionInterrupt.emit() 1031 self.exceptionInterrupt.emit()
1032 stack = [] 1032 stack = []
1033 for fn, ln in stackTrace: 1033 for fn, ln in stackTrace:
1034 stack.append((fn, ln, '')) 1034 stack.append((fn, ln, ''))
1035 self.clientStack.emit(stack) 1035 self.clientStack.emit(stack)
1036 self.__getClientVariables() 1036 self.__getClientVariables()
1037 self.ui.setDebugProfile() 1037 self.ui.setDebugProfile()
1038 return 1038 return
1039 elif res == QMessageBox.Ignore: 1039 elif res == E5MessageBox.Ignore:
1040 if exceptionType not in self.excIgnoreList: 1040 if exceptionType not in self.excIgnoreList:
1041 self.excIgnoreList.append(exceptionType) 1041 self.excIgnoreList.append(exceptionType)
1042 1042
1043 if self.lastAction != -1: 1043 if self.lastAction != -1:
1044 if self.lastAction == 2: 1044 if self.lastAction == 2:

eric ide

mercurial