Debugger/DebugUI.py

changeset 6904
3f35037a08d4
parent 6645
ad476851d7e0
equal deleted inserted replaced
6903:0d4e1033731b 6904:3f35037a08d4
1011 self.__getThreadList() 1011 self.__getThreadList()
1012 self.__getClientVariables() 1012 self.__getClientVariables()
1013 1013
1014 self.debugActGrp.setEnabled(True) 1014 self.debugActGrp.setEnabled(True)
1015 1015
1016 def __clientExit(self, status, message): 1016 def __clientExit(self, status, message, quiet):
1017 """ 1017 """
1018 Private method to handle the debugged program terminating. 1018 Private method to handle the debugged program terminating.
1019 1019
1020 @param status exit code of the debugged program 1020 @param status exit code of the debugged program
1021 @type int 1021 @type int
1022 @param message exit message of the debugged program 1022 @param message exit message of the debugged program
1023 @type str 1023 @type str
1024 @param quiet flag indicating to suppress exit info display
1025 @type bool
1024 """ 1026 """
1025 self.viewmanager.exit() 1027 self.viewmanager.exit()
1026 1028
1027 self.__resetUI() 1029 self.__resetUI()
1028 1030
1029 if not Preferences.getDebugger("SuppressClientExit") or status != 0: 1031 if not quiet:
1030 if message: 1032 if not Preferences.getDebugger("SuppressClientExit") or \
1031 info = self.tr("<p>Message: {0}</p>").format( 1033 status != 0:
1032 Utilities.html_uencode(message)) 1034 if message:
1033 else: 1035 info = self.tr("<p>Message: {0}</p>").format(
1034 info = "" 1036 Utilities.html_uencode(message))
1035 if self.ui.currentProg is None: 1037 else:
1036 E5MessageBox.information( 1038 info = ""
1037 self.ui, Program,
1038 self.tr('<p>The program has terminated with an exit'
1039 ' status of {0}.</p>{1}').format(status, info))
1040 else:
1041 E5MessageBox.information(
1042 self.ui, Program,
1043 self.tr('<p><b>{0}</b> has terminated with an exit'
1044 ' status of {1}.</p>{2}')
1045 .format(Utilities.normabspath(self.ui.currentProg),
1046 status, info))
1047 else:
1048 if message:
1049 info = self.tr("Message: {0}").format(
1050 Utilities.html_uencode(message))
1051 else:
1052 info = ""
1053 if self.ui.notificationsEnabled():
1054 if self.ui.currentProg is None: 1039 if self.ui.currentProg is None:
1055 msg = self.tr('The program has terminated with an exit' 1040 E5MessageBox.information(
1056 ' status of {0}.\n{1}').format(status, info) 1041 self.ui, Program,
1042 self.tr('<p>The program has terminated with an exit'
1043 ' status of {0}.</p>{1}').format(status, info))
1057 else: 1044 else:
1058 msg = self.tr('"{0}" has terminated with an exit' 1045 E5MessageBox.information(
1059 ' status of {1}.\n{2}')\ 1046 self.ui, Program,
1060 .format(os.path.basename(self.ui.currentProg), 1047 self.tr('<p><b>{0}</b> has terminated with an exit'
1061 status, info) 1048 ' status of {1}.</p>{2}')
1062 self.ui.showNotification(
1063 UI.PixmapCache.getPixmap("debug48.png"),
1064 self.tr("Program terminated"), msg)
1065 else:
1066 if self.ui.currentProg is None:
1067 self.appendStdout.emit(
1068 self.tr('The program has terminated with an exit'
1069 ' status of {0}.\n{1}\n').format(status, info))
1070 else:
1071 self.appendStdout.emit(
1072 self.tr('"{0}" has terminated with an exit'
1073 ' status of {1}.\n{2}\n')
1074 .format(Utilities.normabspath(self.ui.currentProg), 1049 .format(Utilities.normabspath(self.ui.currentProg),
1075 status, info)) 1050 status, info))
1051 else:
1052 if message:
1053 info = self.tr("Message: {0}").format(
1054 Utilities.html_uencode(message))
1055 else:
1056 info = ""
1057 if self.ui.notificationsEnabled():
1058 if self.ui.currentProg is None:
1059 msg = self.tr(
1060 'The program has terminated with an exit status of'
1061 ' {0}.\n{1}').format(status, info)
1062 else:
1063 msg = self.tr(
1064 '"{0}" has terminated with an exit status of'
1065 ' {1}.\n{2}').format(
1066 os.path.basename(self.ui.currentProg), status,
1067 info)
1068 self.ui.showNotification(
1069 UI.PixmapCache.getPixmap("debug48.png"),
1070 self.tr("Program terminated"), msg)
1071 else:
1072 if self.ui.currentProg is None:
1073 self.appendStdout.emit(self.tr(
1074 'The program has terminated with an exit status'
1075 ' of {0}.\n{1}\n').format(status, info))
1076 else:
1077 self.appendStdout.emit(self.tr(
1078 '"{0}" has terminated with an exit status of'
1079 ' {1}.\n{2}\n').format(
1080 Utilities.normabspath(self.ui.currentProg), status,
1081 info))
1076 1082
1077 def __clientSyntaxError(self, message, filename, lineNo, characterNo): 1083 def __clientSyntaxError(self, message, filename, lineNo, characterNo):
1078 """ 1084 """
1079 Private method to handle a syntax error in the debugged program. 1085 Private method to handle a syntax error in the debugged program.
1080 1086

eric ide

mercurial