Debugger/DebugUI.py

branch
jsonrpc
changeset 5136
b1dde2dc14bd
parent 5130
27fe451262bf
child 5140
01484c0afbc6
equal deleted inserted replaced
5135:04905a8681dc 5136:b1dde2dc14bd
977 self.__getThreadList() 977 self.__getThreadList()
978 self.__getClientVariables() 978 self.__getClientVariables()
979 979
980 self.debugActGrp.setEnabled(True) 980 self.debugActGrp.setEnabled(True)
981 981
982 def __clientExit(self, status): 982 def __clientExit(self, status, message):
983 """ 983 """
984 Private method to handle the debugged program terminating. 984 Private method to handle the debugged program terminating.
985 985
986 @param status exit code of the debugged program (int) 986 @param status exit code of the debugged program (int)
987 """ 987 """
988 self.viewmanager.exit() 988 self.viewmanager.exit()
989 989
990 self.__resetUI() 990 self.__resetUI()
991 991
992 if not Preferences.getDebugger("SuppressClientExit") or status != 0: 992 if not Preferences.getDebugger("SuppressClientExit") or status != 0:
993 if message:
994 info = self.tr("<p>Message: {0}</p>").format(
995 Utilities.html_uencode(message))
996 else:
997 info = ""
993 if self.ui.currentProg is None: 998 if self.ui.currentProg is None:
994 E5MessageBox.information( 999 E5MessageBox.information(
995 self.ui, Program, 1000 self.ui, Program,
996 self.tr('<p>The program has terminated with an exit' 1001 self.tr('<p>The program has terminated with an exit'
997 ' status of {0}.</p>').format(status)) 1002 ' status of {0}.</p>{1}').format(status, info))
998 else: 1003 else:
999 E5MessageBox.information( 1004 E5MessageBox.information(
1000 self.ui, Program, 1005 self.ui, Program,
1001 self.tr('<p><b>{0}</b> has terminated with an exit' 1006 self.tr('<p><b>{0}</b> has terminated with an exit'
1002 ' status of {1}.</p>') 1007 ' status of {1}.</p>{2}')
1003 .format(Utilities.normabspath(self.ui.currentProg), 1008 .format(Utilities.normabspath(self.ui.currentProg),
1004 status)) 1009 status, info))
1005 else: 1010 else:
1011 if message:
1012 info = self.tr("Message: {0}").format(
1013 Utilities.html_uencode(message))
1014 else:
1015 info = ""
1006 if self.ui.notificationsEnabled(): 1016 if self.ui.notificationsEnabled():
1007 if self.ui.currentProg is None: 1017 if self.ui.currentProg is None:
1008 msg = self.tr('The program has terminated with an exit' 1018 msg = self.tr('The program has terminated with an exit'
1009 ' status of {0}.').format(status) 1019 ' status of {0}.\n{1}').format(status, info)
1010 else: 1020 else:
1011 msg = self.tr('"{0}" has terminated with an exit' 1021 msg = self.tr('"{0}" has terminated with an exit'
1012 ' status of {1}.')\ 1022 ' status of {1}.\n{2}')\
1013 .format(os.path.basename(self.ui.currentProg), 1023 .format(os.path.basename(self.ui.currentProg),
1014 status) 1024 status, info)
1015 self.ui.showNotification( 1025 self.ui.showNotification(
1016 UI.PixmapCache.getPixmap("debug48.png"), 1026 UI.PixmapCache.getPixmap("debug48.png"),
1017 self.tr("Program terminated"), msg) 1027 self.tr("Program terminated"), msg)
1018 else: 1028 else:
1019 if self.ui.currentProg is None: 1029 if self.ui.currentProg is None:
1020 self.appendStdout.emit( 1030 self.appendStdout.emit(
1021 self.tr('The program has terminated with an exit' 1031 self.tr('The program has terminated with an exit'
1022 ' status of {0}.\n').format(status)) 1032 ' status of {0}.\n{1}\n').format(status, info))
1023 else: 1033 else:
1024 self.appendStdout.emit( 1034 self.appendStdout.emit(
1025 self.tr('"{0}" has terminated with an exit' 1035 self.tr('"{0}" has terminated with an exit'
1026 ' status of {1}.\n') 1036 ' status of {1}.\n{2}\n')
1027 .format(Utilities.normabspath(self.ui.currentProg), 1037 .format(Utilities.normabspath(self.ui.currentProg),
1028 status)) 1038 status, info))
1029 1039
1030 def __clientSyntaxError(self, message, filename, lineNo, characterNo): 1040 def __clientSyntaxError(self, message, filename, lineNo, characterNo):
1031 """ 1041 """
1032 Private method to handle a syntax error in the debugged program. 1042 Private method to handle a syntax error in the debugged program.
1033 1043

eric ide

mercurial