diff -r 9986ec0e559a -r 10516539f238 Debugger/DebugUI.py --- a/Debugger/DebugUI.py Tue Oct 15 22:03:54 2013 +0200 +++ b/Debugger/DebugUI.py Fri Oct 18 23:00:41 2013 +0200 @@ -17,8 +17,8 @@ from UI.Info import Program -from .DebugClientCapabilities import HasDebugger, HasInterpreter, HasProfiler, \ - HasCoverage +from .DebugClientCapabilities import HasDebugger, HasInterpreter, \ + HasProfiler, HasCoverage import Preferences import Utilities import UI.PixmapCache @@ -36,13 +36,15 @@ @signal clientStack(stack) emitted at breaking after a reported exception @signal compileForms() emitted if changed project forms should be compiled - @signal compileResources() emitted if changed project resources should be compiled - @signal debuggingStarted(filename) emitted when a debugging session was started + @signal compileResources() emitted if changed project resources should be + compiled + @signal debuggingStarted(filename) emitted when a debugging session was + started @signal resetUI() emitted to reset the UI - @signal exceptionInterrupt() emitted after the execution was interrupted by an - exception and acknowledged by the user - @signal appendStdout(msg) emitted when the client program has terminated and the - display of the termination dialog is suppressed + @signal exceptionInterrupt() emitted after the execution was interrupted + by an exception and acknowledged by the user + @signal appendStdout(msg) emitted when the client program has terminated + and the display of the termination dialog is suppressed """ clientStack = pyqtSignal(list) resetUI = pyqtSignal() @@ -78,7 +80,8 @@ self.argvHistory = Preferences.toList( Preferences.Prefs.settings.value('DebugInfo/ArgumentsHistory')) self.wdHistory = Preferences.toList( - Preferences.Prefs.settings.value('DebugInfo/WorkingDirectoryHistory')) + Preferences.Prefs.settings.value( + 'DebugInfo/WorkingDirectoryHistory')) self.envHistory = Preferences.toList( Preferences.Prefs.settings.value('DebugInfo/EnvironmentHistory')) self.excList = Preferences.toList( @@ -86,7 +89,8 @@ self.excIgnoreList = Preferences.toList( Preferences.Prefs.settings.value('DebugInfo/IgnoredExceptions')) self.exceptions = Preferences.toBool( - Preferences.Prefs.settings.value('DebugInfo/ReportExceptions', True)) + Preferences.Prefs.settings.value( + 'DebugInfo/ReportExceptions', True)) self.autoClearShell = Preferences.toBool( Preferences.Prefs.settings.value('DebugInfo/AutoClearShell', True)) self.tracePython = Preferences.toBool( @@ -94,7 +98,8 @@ self.autoContinue = Preferences.toBool( Preferences.Prefs.settings.value('DebugInfo/AutoContinue', True)) self.forkAutomatically = Preferences.toBool( - Preferences.Prefs.settings.value('DebugInfo/ForkAutomatically', False)) + Preferences.Prefs.settings.value( + 'DebugInfo/ForkAutomatically', False)) self.forkIntoChild = Preferences.toBool( Preferences.Prefs.settings.value('DebugInfo/ForkIntoChild', False)) @@ -107,8 +112,10 @@ self.debugActions = [self.__continue, self.__step,\ self.__stepOver, self.__stepOut,\ self.__stepQuit, self.__runToCursor] - self.localsVarFilter, self.globalsVarFilter = Preferences.getVarFilters() - self.debugViewer.setVariablesFilter(self.globalsVarFilter, self.localsVarFilter) + self.localsVarFilter, self.globalsVarFilter = \ + Preferences.getVarFilters() + self.debugViewer.setVariablesFilter( + self.globalsVarFilter, self.localsVarFilter) # Connect the signals emitted by the debug-server debugServer.clientGone.connect(self.__clientGone) @@ -118,8 +125,10 @@ debugServer.clientException.connect(self.__clientException) debugServer.clientVariables.connect(self.__clientVariables) debugServer.clientVariable.connect(self.__clientVariable) - debugServer.clientBreakConditionError.connect(self.__clientBreakConditionError) - debugServer.clientWatchConditionError.connect(self.__clientWatchConditionError) + debugServer.clientBreakConditionError.connect( + self.__clientBreakConditionError) + debugServer.clientWatchConditionError.connect( + self.__clientWatchConditionError) debugServer.passiveDebugStarted.connect(self.__passiveDebugStarted) debugServer.clientThreadSet.connect(self.__clientThreadSet) @@ -162,12 +171,14 @@ self.runAct = E5Action(self.trUtf8('Run Script'), UI.PixmapCache.getIcon("runScript.png"), - self.trUtf8('&Run Script...'), Qt.Key_F2, 0, self, 'dbg_run_script') + self.trUtf8('&Run Script...'), + Qt.Key_F2, 0, self, 'dbg_run_script') self.runAct.setStatusTip(self.trUtf8('Run the current Script')) self.runAct.setWhatsThis(self.trUtf8( """<b>Run Script</b>""" - """<p>Set the command line arguments and run the script outside the""" - """ debugger. If the file has unsaved changes it may be saved first.</p>""" + """<p>Set the command line arguments and run the script outside""" + """ the debugger. If the file has unsaved changes it may be""" + """ saved first.</p>""" )) self.runAct.triggered[()].connect(self.__runScript) self.actions.append(self.runAct) @@ -181,44 +192,47 @@ """<b>Run Project</b>""" """<p>Set the command line arguments and run the current project""" """ outside the debugger.""" - """ If files of the current project have unsaved changes they may""" - """ be saved first.</p>""" + """ If files of the current project have unsaved changes they""" + """ may be saved first.</p>""" )) self.runProjectAct.triggered[()].connect(self.__runProject) self.actions.append(self.runProjectAct) self.coverageAct = E5Action(self.trUtf8('Coverage run of Script'), UI.PixmapCache.getIcon("coverageScript.png"), - self.trUtf8('Coverage run of Script...'), 0, 0, self, 'dbg_coverage_script') + self.trUtf8('Coverage run of Script...'), 0, 0, self, + 'dbg_coverage_script') self.coverageAct.setStatusTip( self.trUtf8('Perform a coverage run of the current Script')) self.coverageAct.setWhatsThis(self.trUtf8( """<b>Coverage run of Script</b>""" - """<p>Set the command line arguments and run the script under the control""" - """ of a coverage analysis tool. If the file has unsaved changes it may be""" - """ saved first.</p>""" + """<p>Set the command line arguments and run the script under""" + """ the control of a coverage analysis tool. If the file has""" + """ unsaved changes it may be saved first.</p>""" )) self.coverageAct.triggered[()].connect(self.__coverageScript) self.actions.append(self.coverageAct) - self.coverageProjectAct = E5Action(self.trUtf8('Coverage run of Project'), - UI.PixmapCache.getIcon("coverageProject.png"), - self.trUtf8('Coverage run of Project...'), 0, 0, self, 'dbg_coverage_project') + self.coverageProjectAct = E5Action( + self.trUtf8('Coverage run of Project'), + UI.PixmapCache.getIcon("coverageProject.png"), + self.trUtf8('Coverage run of Project...'), 0, 0, self, + 'dbg_coverage_project') self.coverageProjectAct.setStatusTip( self.trUtf8('Perform a coverage run of the current Project')) self.coverageProjectAct.setWhatsThis(self.trUtf8( """<b>Coverage run of Project</b>""" """<p>Set the command line arguments and run the current project""" """ under the control of a coverage analysis tool.""" - """ If files of the current project have unsaved changes they may""" - """ be saved first.</p>""" + """ If files of the current project have unsaved changes""" + """ they may be saved first.</p>""" )) self.coverageProjectAct.triggered[()].connect(self.__coverageProject) self.actions.append(self.coverageProjectAct) self.profileAct = E5Action(self.trUtf8('Profile Script'), - UI.PixmapCache.getIcon("profileScript.png"), - self.trUtf8('Profile Script...'), 0, 0, self, 'dbg_profile_script') + UI.PixmapCache.getIcon("profileScript.png"), + self.trUtf8('Profile Script...'), 0, 0, self, 'dbg_profile_script') self.profileAct.setStatusTip(self.trUtf8('Profile the current Script')) self.profileAct.setWhatsThis(self.trUtf8( """<b>Profile Script</b>""" @@ -229,63 +243,70 @@ self.actions.append(self.profileAct) self.profileProjectAct = E5Action(self.trUtf8('Profile Project'), - UI.PixmapCache.getIcon("profileProject.png"), - self.trUtf8('Profile Project...'), 0, 0, self, 'dbg_profile_project') - self.profileProjectAct.setStatusTip(self.trUtf8('Profile the current Project')) + UI.PixmapCache.getIcon("profileProject.png"), + self.trUtf8('Profile Project...'), 0, 0, self, + 'dbg_profile_project') + self.profileProjectAct.setStatusTip( + self.trUtf8('Profile the current Project')) self.profileProjectAct.setWhatsThis(self.trUtf8( """<b>Profile Project</b>""" - """<p>Set the command line arguments and profile the current project.""" - """ If files of the current project have unsaved changes they may""" - """ be saved first.</p>""" + """<p>Set the command line arguments and profile the current""" + """ project. If files of the current project have unsaved""" + """ changes they may be saved first.</p>""" )) self.profileProjectAct.triggered[()].connect(self.__profileProject) self.actions.append(self.profileProjectAct) self.debugAct = E5Action(self.trUtf8('Debug Script'), - UI.PixmapCache.getIcon("debugScript.png"), - self.trUtf8('&Debug Script...'), Qt.Key_F5, 0, self, 'dbg_debug_script') + UI.PixmapCache.getIcon("debugScript.png"), + self.trUtf8('&Debug Script...'), Qt.Key_F5, 0, self, + 'dbg_debug_script') self.debugAct.setStatusTip(self.trUtf8('Debug the current Script')) self.debugAct.setWhatsThis(self.trUtf8( """<b>Debug Script</b>""" - """<p>Set the command line arguments and set the current line to be the""" - """ first executable Python statement of the current editor window.""" - """ If the file has unsaved changes it may be saved first.</p>""" + """<p>Set the command line arguments and set the current line""" + """ to be the first executable Python statement of the current""" + """ editor window. If the file has unsaved changes it may be""" + """ saved first.</p>""" )) self.debugAct.triggered[()].connect(self.__debugScript) self.actions.append(self.debugAct) self.debugProjectAct = E5Action(self.trUtf8('Debug Project'), - UI.PixmapCache.getIcon("debugProject.png"), - self.trUtf8('Debug &Project...'), Qt.SHIFT + Qt.Key_F5, 0, self, - 'dbg_debug_project') - self.debugProjectAct.setStatusTip(self.trUtf8('Debug the current Project')) + UI.PixmapCache.getIcon("debugProject.png"), + self.trUtf8('Debug &Project...'), Qt.SHIFT + Qt.Key_F5, 0, self, + 'dbg_debug_project') + self.debugProjectAct.setStatusTip(self.trUtf8( + 'Debug the current Project')) self.debugProjectAct.setWhatsThis(self.trUtf8( """<b>Debug Project</b>""" - """<p>Set the command line arguments and set the current line to be the""" - """ first executable Python statement of the main script of the current""" - """ project. If files of the current project have unsaved changes they may""" - """ be saved first.</p>""" + """<p>Set the command line arguments and set the current line""" + """ to be the first executable Python statement of the main""" + """ script of the current project. If files of the current""" + """ project have unsaved changes they may be saved first.</p>""" )) self.debugProjectAct.triggered[()].connect(self.__debugProject) self.actions.append(self.debugProjectAct) self.restartAct = E5Action(self.trUtf8('Restart'), - UI.PixmapCache.getIcon("restart.png"), - self.trUtf8('Restart'), Qt.Key_F4, 0, self, 'dbg_restart_script') - self.restartAct.setStatusTip(self.trUtf8('Restart the last debugged script')) + UI.PixmapCache.getIcon("restart.png"), + self.trUtf8('Restart'), Qt.Key_F4, 0, self, 'dbg_restart_script') + self.restartAct.setStatusTip(self.trUtf8( + 'Restart the last debugged script')) self.restartAct.setWhatsThis(self.trUtf8( """<b>Restart</b>""" - """<p>Set the command line arguments and set the current line to be the""" - """ first executable Python statement of the script that was debugged last.""" - """ If there are unsaved changes, they may be saved first.</p>""" + """<p>Set the command line arguments and set the current line""" + """ to be the first executable Python statement of the script""" + """ that was debugged last. If there are unsaved changes, they""" + """ may be saved first.</p>""" )) self.restartAct.triggered[()].connect(self.__doRestart) self.actions.append(self.restartAct) self.stopAct = E5Action(self.trUtf8('Stop'), - UI.PixmapCache.getIcon("stopScript.png"), - self.trUtf8('Stop'), Qt.SHIFT + Qt.Key_F10, 0, - self, 'dbg_stop_script') + UI.PixmapCache.getIcon("stopScript.png"), + self.trUtf8('Stop'), Qt.SHIFT + Qt.Key_F10, 0, + self, 'dbg_stop_script') self.stopAct.setStatusTip(self.trUtf8("""Stop the running script.""")) self.stopAct.setWhatsThis(self.trUtf8( """<b>Stop</b>""" @@ -297,24 +318,26 @@ self.debugActGrp = createActionGroup(self) act = E5Action(self.trUtf8('Continue'), - UI.PixmapCache.getIcon("continue.png"), - self.trUtf8('&Continue'), Qt.Key_F6, 0, - self.debugActGrp, 'dbg_continue') + UI.PixmapCache.getIcon("continue.png"), + self.trUtf8('&Continue'), Qt.Key_F6, 0, + self.debugActGrp, 'dbg_continue') act.setStatusTip( self.trUtf8('Continue running the program from the current line')) act.setWhatsThis(self.trUtf8( """<b>Continue</b>""" - """<p>Continue running the program from the current line. The program will""" - """ stop when it terminates or when a breakpoint is reached.</p>""" + """<p>Continue running the program from the current line. The""" + """ program will stop when it terminates or when a breakpoint""" + """ is reached.</p>""" )) act.triggered[()].connect(self.__continue) self.actions.append(act) act = E5Action(self.trUtf8('Continue to Cursor'), - UI.PixmapCache.getIcon("continueToCursor.png"), - self.trUtf8('Continue &To Cursor'), Qt.SHIFT + Qt.Key_F6, 0, - self.debugActGrp, 'dbg_continue_to_cursor') - act.setStatusTip(self.trUtf8("""Continue running the program from the""" + UI.PixmapCache.getIcon("continueToCursor.png"), + self.trUtf8('Continue &To Cursor'), Qt.SHIFT + Qt.Key_F6, 0, + self.debugActGrp, 'dbg_continue_to_cursor') + act.setStatusTip(self.trUtf8( + """Continue running the program from the""" """ current line to the current cursor position""")) act.setWhatsThis(self.trUtf8( """<b>Continue To Cursor</b>""" @@ -325,56 +348,60 @@ self.actions.append(act) act = E5Action(self.trUtf8('Single Step'), - UI.PixmapCache.getIcon("step.png"), - self.trUtf8('Sin&gle Step'), Qt.Key_F7, 0, - self.debugActGrp, 'dbg_single_step') + UI.PixmapCache.getIcon("step.png"), + self.trUtf8('Sin&gle Step'), Qt.Key_F7, 0, + self.debugActGrp, 'dbg_single_step') act.setStatusTip(self.trUtf8('Execute a single Python statement')) act.setWhatsThis(self.trUtf8( """<b>Single Step</b>""" """<p>Execute a single Python statement. If the statement""" """ is an <tt>import</tt> statement, a class constructor, or a""" - """ method or function call then control is returned to the debugger at""" - """ the next statement.</p>""" + """ method or function call then control is returned to the""" + """ debugger at the next statement.</p>""" )) act.triggered[()].connect(self.__step) self.actions.append(act) act = E5Action(self.trUtf8('Step Over'), - UI.PixmapCache.getIcon("stepOver.png"), - self.trUtf8('Step &Over'), Qt.Key_F8, 0, - self.debugActGrp, 'dbg_step_over') - act.setStatusTip(self.trUtf8("""Execute a single Python statement staying""" + UI.PixmapCache.getIcon("stepOver.png"), + self.trUtf8('Step &Over'), Qt.Key_F8, 0, + self.debugActGrp, 'dbg_step_over') + act.setStatusTip(self.trUtf8( + """Execute a single Python statement staying""" """ in the current frame""")) act.setWhatsThis(self.trUtf8( """<b>Step Over</b>""" - """<p>Execute a single Python statement staying in the same frame. If""" - """ the statement is an <tt>import</tt> statement, a class constructor,""" - """ or a method or function call then control is returned to the debugger""" - """ after the statement has completed.</p>""" + """<p>Execute a single Python statement staying in the same""" + """ frame. If the statement is an <tt>import</tt> statement,""" + """ a class constructor, or a method or function call then""" + """ control is returned to the debugger after the statement""" + """ has completed.</p>""" )) act.triggered[()].connect(self.__stepOver) self.actions.append(act) act = E5Action(self.trUtf8('Step Out'), - UI.PixmapCache.getIcon("stepOut.png"), - self.trUtf8('Step Ou&t'), Qt.Key_F9, 0, - self.debugActGrp, 'dbg_step_out') - act.setStatusTip(self.trUtf8("""Execute Python statements until leaving""" + UI.PixmapCache.getIcon("stepOut.png"), + self.trUtf8('Step Ou&t'), Qt.Key_F9, 0, + self.debugActGrp, 'dbg_step_out') + act.setStatusTip(self.trUtf8( + """Execute Python statements until leaving""" """ the current frame""")) act.setWhatsThis(self.trUtf8( """<b>Step Out</b>""" - """<p>Execute Python statements until leaving the current frame. If""" - """ the statements are inside an <tt>import</tt> statement, a class""" - """ constructor, or a method or function call then control is returned""" - """ to the debugger after the current frame has been left.</p>""" + """<p>Execute Python statements until leaving the current""" + """ frame. If the statements are inside an <tt>import</tt>""" + """ statement, a class constructor, or a method or function""" + """ call then control is returned to the debugger after the""" + """ current frame has been left.</p>""" )) act.triggered[()].connect(self.__stepOut) self.actions.append(act) act = E5Action(self.trUtf8('Stop'), - UI.PixmapCache.getIcon("stepQuit.png"), - self.trUtf8('&Stop'), Qt.Key_F10, 0, - self.debugActGrp, 'dbg_stop') + UI.PixmapCache.getIcon("stepQuit.png"), + self.trUtf8('&Stop'), Qt.Key_F10, 0, + self.debugActGrp, 'dbg_stop') act.setStatusTip(self.trUtf8('Stop debugging')) act.setWhatsThis(self.trUtf8( """<b>Stop</b>""" @@ -386,8 +413,8 @@ self.debugActGrp2 = createActionGroup(self) act = E5Action(self.trUtf8('Evaluate'), - self.trUtf8('E&valuate...'), - 0, 0, self.debugActGrp2, 'dbg_evaluate') + self.trUtf8('E&valuate...'), + 0, 0, self.debugActGrp2, 'dbg_evaluate') act.setStatusTip(self.trUtf8('Evaluate in current context')) act.setWhatsThis(self.trUtf8( """<b>Evaluate</b>""" @@ -412,51 +439,59 @@ self.actions.append(act) self.dbgFilterAct = E5Action(self.trUtf8('Variables Type Filter'), - self.trUtf8('Varia&bles Type Filter...'), 0, 0, self, - 'dbg_variables_filter') - self.dbgFilterAct.setStatusTip(self.trUtf8('Configure variables type filter')) + self.trUtf8('Varia&bles Type Filter...'), 0, 0, self, + 'dbg_variables_filter') + self.dbgFilterAct.setStatusTip(self.trUtf8( + 'Configure variables type filter')) self.dbgFilterAct.setWhatsThis(self.trUtf8( """<b>Variables Type Filter</b>""" - """<p>Configure the variables type filter. Only variable types that are not""" - """ selected are displayed in the global or local variables window""" - """ during a debugging session.</p>""" + """<p>Configure the variables type filter. Only variable types""" + """ that are not selected are displayed in the global or local""" + """ variables window during a debugging session.</p>""" )) - self.dbgFilterAct.triggered[()].connect(self.__configureVariablesFilters) + self.dbgFilterAct.triggered[()].connect( + self.__configureVariablesFilters) self.actions.append(self.dbgFilterAct) self.excFilterAct = E5Action(self.trUtf8('Exceptions Filter'), - self.trUtf8('&Exceptions Filter...'), 0, 0, self, 'dbg_exceptions_filter') - self.excFilterAct.setStatusTip(self.trUtf8('Configure exceptions filter')) + self.trUtf8('&Exceptions Filter...'), 0, 0, self, + 'dbg_exceptions_filter') + self.excFilterAct.setStatusTip(self.trUtf8( + 'Configure exceptions filter')) self.excFilterAct.setWhatsThis(self.trUtf8( """<b>Exceptions Filter</b>""" - """<p>Configure the exceptions filter. Only exception types that are""" - """ listed are highlighted during a debugging session.</p>""" - """<p>Please note, that all unhandled exceptions are highlighted""" - """ indepent from the filter list.</p>""" + """<p>Configure the exceptions filter. Only exception types""" + """ that are listed are highlighted during a debugging""" + """ session.</p><p>Please note, that all unhandled exceptions""" + """ are highlighted indepent from the filter list.</p>""" )) - self.excFilterAct.triggered[()].connect(self.__configureExceptionsFilter) + self.excFilterAct.triggered[()].connect( + self.__configureExceptionsFilter) self.actions.append(self.excFilterAct) self.excIgnoreFilterAct = E5Action(self.trUtf8('Ignored Exceptions'), self.trUtf8('&Ignored Exceptions...'), 0, 0, self, 'dbg_ignored_exceptions') - self.excIgnoreFilterAct.setStatusTip(self.trUtf8('Configure ignored exceptions')) + self.excIgnoreFilterAct.setStatusTip(self.trUtf8( + 'Configure ignored exceptions')) self.excIgnoreFilterAct.setWhatsThis(self.trUtf8( """<b>Ignored Exceptions</b>""" - """<p>Configure the ignored exceptions. Only exception types that are""" - """ not listed are highlighted during a debugging session.</p>""" - """<p>Please note, that unhandled exceptions cannot be ignored.</p>""" + """<p>Configure the ignored exceptions. Only exception types""" + """ that are not listed are highlighted during a debugging""" + """ session.</p><p>Please note, that unhandled exceptions""" + """ cannot be ignored.</p>""" )) - self.excIgnoreFilterAct.triggered[()].connect(self.__configureIgnoredExceptions) + self.excIgnoreFilterAct.triggered[()].connect( + self.__configureIgnoredExceptions) self.actions.append(self.excIgnoreFilterAct) self.dbgSetBpActGrp = createActionGroup(self) self.dbgToggleBpAct = E5Action(self.trUtf8('Toggle Breakpoint'), - UI.PixmapCache.getIcon("breakpointToggle.png"), - self.trUtf8('Toggle Breakpoint'), - QKeySequence(self.trUtf8("Shift+F11", "Debug|Toggle Breakpoint")), 0, - self.dbgSetBpActGrp, 'dbg_toggle_breakpoint') + UI.PixmapCache.getIcon("breakpointToggle.png"), + self.trUtf8('Toggle Breakpoint'), + QKeySequence(self.trUtf8("Shift+F11", "Debug|Toggle Breakpoint")), + 0, self.dbgSetBpActGrp, 'dbg_toggle_breakpoint') self.dbgToggleBpAct.setStatusTip(self.trUtf8('Toggle Breakpoint')) self.dbgToggleBpAct.setWhatsThis(self.trUtf8( """<b>Toggle Breakpoint</b>""" @@ -467,10 +502,10 @@ self.actions.append(self.dbgToggleBpAct) self.dbgEditBpAct = E5Action(self.trUtf8('Edit Breakpoint'), - UI.PixmapCache.getIcon("cBreakpointToggle.png"), - self.trUtf8('Edit Breakpoint...'), - QKeySequence(self.trUtf8("Shift+F12", "Debug|Edit Breakpoint")), 0, - self.dbgSetBpActGrp, 'dbg_edit_breakpoint') + UI.PixmapCache.getIcon("cBreakpointToggle.png"), + self.trUtf8('Edit Breakpoint...'), + QKeySequence(self.trUtf8("Shift+F12", "Debug|Edit Breakpoint")), 0, + self.dbgSetBpActGrp, 'dbg_edit_breakpoint') self.dbgEditBpAct.setStatusTip(self.trUtf8('Edit Breakpoint')) self.dbgEditBpAct.setWhatsThis(self.trUtf8( """<b>Edit Breakpoint</b>""" @@ -481,10 +516,11 @@ self.actions.append(self.dbgEditBpAct) self.dbgNextBpAct = E5Action(self.trUtf8('Next Breakpoint'), - UI.PixmapCache.getIcon("breakpointNext.png"), - self.trUtf8('Next Breakpoint'), - QKeySequence(self.trUtf8("Ctrl+Shift+PgDown", "Debug|Next Breakpoint")), 0, - self.dbgSetBpActGrp, 'dbg_next_breakpoint') + UI.PixmapCache.getIcon("breakpointNext.png"), + self.trUtf8('Next Breakpoint'), + QKeySequence( + self.trUtf8("Ctrl+Shift+PgDown", "Debug|Next Breakpoint")), 0, + self.dbgSetBpActGrp, 'dbg_next_breakpoint') self.dbgNextBpAct.setStatusTip(self.trUtf8('Next Breakpoint')) self.dbgNextBpAct.setWhatsThis(self.trUtf8( """<b>Next Breakpoint</b>""" @@ -494,10 +530,11 @@ self.actions.append(self.dbgNextBpAct) self.dbgPrevBpAct = E5Action(self.trUtf8('Previous Breakpoint'), - UI.PixmapCache.getIcon("breakpointPrevious.png"), - self.trUtf8('Previous Breakpoint'), - QKeySequence(self.trUtf8("Ctrl+Shift+PgUp", "Debug|Previous Breakpoint")), - 0, self.dbgSetBpActGrp, 'dbg_previous_breakpoint') + UI.PixmapCache.getIcon("breakpointPrevious.png"), + self.trUtf8('Previous Breakpoint'), + QKeySequence( + self.trUtf8("Ctrl+Shift+PgUp", "Debug|Previous Breakpoint")), + 0, self.dbgSetBpActGrp, 'dbg_previous_breakpoint') self.dbgPrevBpAct.setStatusTip(self.trUtf8('Previous Breakpoint')) self.dbgPrevBpAct.setWhatsThis(self.trUtf8( """<b>Previous Breakpoint</b>""" @@ -507,9 +544,10 @@ self.actions.append(self.dbgPrevBpAct) act = E5Action(self.trUtf8('Clear Breakpoints'), - self.trUtf8('Clear Breakpoints'), - QKeySequence(self.trUtf8("Ctrl+Shift+C", "Debug|Clear Breakpoints")), 0, - self.dbgSetBpActGrp, 'dbg_clear_breakpoint') + self.trUtf8('Clear Breakpoints'), + QKeySequence( + self.trUtf8("Ctrl+Shift+C", "Debug|Clear Breakpoints")), 0, + self.dbgSetBpActGrp, 'dbg_clear_breakpoint') act.setStatusTip(self.trUtf8('Clear Breakpoints')) act.setWhatsThis(self.trUtf8( """<b>Clear Breakpoints</b>""" @@ -580,7 +618,8 @@ """ Public slot to initialize the debug toolbars. - @param toolbarManager reference to a toolbar manager object (E5ToolBarManager) + @param toolbarManager reference to a toolbar manager object + (E5ToolBarManager) @return the generated toolbars (list of QToolBar) """ starttb = QToolBar(self.trUtf8("Start"), self.ui) @@ -614,7 +653,8 @@ toolbarManager.addAction(self.profileAct, starttb.windowTitle()) toolbarManager.addAction(self.profileProjectAct, starttb.windowTitle()) toolbarManager.addAction(self.coverageAct, starttb.windowTitle()) - toolbarManager.addAction(self.coverageProjectAct, starttb.windowTitle()) + toolbarManager.addAction(self.coverageProjectAct, + starttb.windowTitle()) return [starttb, debugtb] @@ -709,8 +749,8 @@ """ Public slot to initialize the autoContinue flag. - @param autoContinue flag indicating, that the debugger should not stop at - the first executable line (boolean) + @param autoContinue flag indicating, that the debugger should not + stop at the first executable line (boolean) """ self.autoContinue = autoContinue @@ -857,8 +897,8 @@ Preferences.Prefs.settings.setValue('DebugInfo/ArgumentsHistory', self.argvHistory) - Preferences.Prefs.settings.setValue('DebugInfo/WorkingDirectoryHistory', - self.wdHistory) + Preferences.Prefs.settings.setValue( + 'DebugInfo/WorkingDirectoryHistory', self.wdHistory) Preferences.Prefs.settings.setValue('DebugInfo/EnvironmentHistory', self.envHistory) Preferences.Prefs.settings.setValue('DebugInfo/Exceptions', @@ -951,7 +991,8 @@ E5MessageBox.information(self.ui, Program, self.trUtf8('<p><b>{0}</b> has terminated with an exit' ' status of {1}.</p>') - .format(Utilities.normabspath(self.ui.currentProg), status)) + .format(Utilities.normabspath(self.ui.currentProg), + status)) else: if self.ui.notificationsEnabled(): if self.ui.currentProg is None: @@ -960,8 +1001,10 @@ else: msg = self.trUtf8('"{0}" has terminated with an exit' ' status of {1}.')\ - .format(os.path.basename(self.ui.currentProg), status) - self.ui.showNotification(UI.PixmapCache.getPixmap("debug48.png"), + .format(os.path.basename(self.ui.currentProg), + status) + self.ui.showNotification( + UI.PixmapCache.getPixmap("debug48.png"), self.trUtf8("Program terminated"), msg) else: if self.ui.currentProg is None: @@ -972,16 +1015,19 @@ self.appendStdout.emit( self.trUtf8('"{0}" has terminated with an exit' ' status of {1}.\n') - .format(Utilities.normabspath(self.ui.currentProg), status)) + .format(Utilities.normabspath(self.ui.currentProg), + status)) def __clientSyntaxError(self, message, filename, lineNo, characterNo): """ Private method to handle a syntax error in the debugged program. @param message message of the syntax error (string) - @param filename translated filename of the syntax error position (string) + @param filename translated filename of the syntax error position + (string) @param lineNo line number of the syntax error position (integer) - @param characterNo character number of the syntax error position (integer) + @param characterNo character number of the syntax error position + (integer) """ self.__resetUI() self.ui.raise_() @@ -989,21 +1035,26 @@ if message is None: E5MessageBox.critical(self.ui, Program, - self.trUtf8('The program being debugged contains an unspecified' - ' syntax error.')) + self.trUtf8( + 'The program being debugged contains an unspecified' + ' syntax error.')) return if not os.path.isabs(filename): - if os.path.exists(os.path.join(self.project.getProjectPath(), filename)): - filename = os.path.join(self.project.getProjectPath(), filename) + if os.path.exists(os.path.join(self.project.getProjectPath(), + filename)): + filename = os.path.join(self.project.getProjectPath(), + filename) else: - d = os.path.dirname(self.project.getMainScript(normalized=True)) + d = os.path.dirname( + self.project.getMainScript(normalized=True)) if os.path.exists(os.path.join(d, filename)): filename = os.path.join(d, filename) self.viewmanager.setFileLine(filename, lineNo, True, True) E5MessageBox.critical(self.ui, Program, self.trUtf8('<p>The file <b>{0}</b> contains the syntax error' - ' <b>{1}</b> at line <b>{2}</b>, character <b>{3}</b>.</p>') + ' <b>{1}</b> at line <b>{2}</b>, character <b>{3}</b>.' + '</p>') .format(filename, message, lineNo, characterNo)) def __clientException(self, exceptionType, exceptionMessage, stackTrace): @@ -1041,7 +1092,8 @@ except (UnicodeError, IOError): pass if res != E5MessageBox.No: - self.viewmanager.setFileLine(stackTrace[0][0], stackTrace[0][1], True) + self.viewmanager.setFileLine( + stackTrace[0][0], stackTrace[0][1], True) if res != E5MessageBox.No: if Preferences.getDebugger("BreakAlways"): res = E5MessageBox.Yes @@ -1057,21 +1109,26 @@ E5MessageBox.Yes | \ E5MessageBox.Ignore) res = E5MessageBox.critical(self.ui, Program, - self.trUtf8('<p>The debugged program raised the exception' - ' <b>{0}</b><br>"<b>{1}</b>"<br>File: <b>{2}</b>,' - ' Line: <b>{3}</b></p><p>Break here?</p>') - .format(exceptionType, - Utilities.html_encode(exceptionMessage), - stackTrace[0][0], - stackTrace[0][1]), + self.trUtf8( + '<p>The debugged program raised the exception' + ' <b>{0}</b><br>"<b>{1}</b>"<br>' + 'File: <b>{2}</b>, Line: <b>{3}</b></p>' + '<p>Break here?</p>') + .format( + exceptionType, + Utilities.html_encode(exceptionMessage), + stackTrace[0][0], + stackTrace[0][1]), buttons, E5MessageBox.No) else: res = E5MessageBox.critical(self.ui, Program, - self.trUtf8('<p>The debugged program raised the exception' - ' <b>{0}</b><br>"<b>{1}</b>"</p>') - .format(exceptionType, - Utilities.html_encode(exceptionMessage))) + self.trUtf8( + '<p>The debugged program raised the exception' + ' <b>{0}</b><br>"<b>{1}</b>"</p>') + .format( + exceptionType, + Utilities.html_encode(exceptionMessage))) if res == E5MessageBox.Yes: self.exceptionInterrupt.emit() stack = [] @@ -1102,7 +1159,8 @@ self.__resetUI() if unplanned: E5MessageBox.information(self.ui, Program, - self.trUtf8('The program being debugged has terminated unexpectedly.')) + self.trUtf8('The program being debugged has terminated' + ' unexpectedly.')) def __getThreadList(self): """ @@ -1132,7 +1190,8 @@ """ Private method to write the clients variables to the user interface. - @param scope scope of the variables (-1 = empty global, 1 = global, 0 = local) + @param scope scope of the variables (-1 = empty global, 1 = global, + 0 = local) @param variables the list of variables from the client """ if scope > 0: @@ -1152,10 +1211,11 @@ def __clientVariable(self, scope, variables): """ - Private method to write the contents of a clients classvariable to the user - interface. + Private method to write the contents of a clients classvariable to + the user interface. - @param scope scope of the variables (-1 = empty global, 1 = global, 0 = local) + @param scope scope of the variables (-1 = empty global, 1 = global, + 0 = local) @param variables the list of members of a classvariable from the client """ if scope == 1: @@ -1172,9 +1232,10 @@ """ E5MessageBox.critical(self.ui, self.trUtf8("Breakpoint Condition Error"), - self.trUtf8("""<p>The condition of the breakpoint <b>{0}, {1}</b>""" - """ contains a syntax error.</p>""")\ - .format(filename, lineno)) + self.trUtf8( + """<p>The condition of the breakpoint <b>{0}, {1}</b>""" + """ contains a syntax error.</p>""")\ + .format(filename, lineno)) model = self.debugServer.getBreakPointModel() index = model.getBreakPointIndex(filename, lineno) @@ -1192,7 +1253,8 @@ [], self.ui, modal=True) if dlg.exec_() == QDialog.Accepted: cond, temp, enabled, count = dlg.getData() - model.setBreakPointByIndex(index, fn, line, (cond, temp, enabled, count)) + model.setBreakPointByIndex(index, fn, line, + (cond, temp, enabled, count)) def __clientWatchConditionError(self, cond): """ @@ -1227,7 +1289,8 @@ # check for duplicates idx = self.__model.getWatchPointIndex(cond, special) - duplicate = idx.isValid() and idx.internalPointer() != index.internalPointer() + duplicate = idx.isValid() and \ + idx.internalPointer() != index.internalPointer() if duplicate: if not special: msg = self.trUtf8("""<p>A watch expression '<b>{0}</b>'""" @@ -1235,7 +1298,8 @@ .format(Utilities.html_encode(cond)) else: msg = self.trUtf8("""<p>A watch expression '<b>{0}</b>'""" - """ for the variable <b>{1}</b> already exists.</p>""")\ + """ for the variable <b>{1}</b> already""" + """ exists.</p>""")\ .format(special, Utilities.html_encode(cond)) E5MessageBox.warning(self, @@ -1375,8 +1439,8 @@ """ Private method to handle the coverage actions. - @param runProject flag indicating coverage of the current project (True) - or script (false) + @param runProject flag indicating coverage of the current project + (True) or script (false) """ from .StartDialog import StartDialog @@ -1389,10 +1453,12 @@ cap = self.trUtf8("Coverage of Project") else: cap = self.trUtf8("Coverage of Script") - dlg = StartDialog(cap, self.argvHistory, self.wdHistory, self.envHistory, - self.exceptions, self.ui, 2, autoClearShell=self.autoClearShell) + dlg = StartDialog(cap, self.argvHistory, self.wdHistory, + self.envHistory, self.exceptions, self.ui, 2, + autoClearShell=self.autoClearShell) if dlg.exec_() == QDialog.Accepted: - argv, wd, env, exceptions, clearShell, clearHistories, console = dlg.getData() + argv, wd, env, exceptions, clearShell, clearHistories, console = \ + dlg.getData() eraseCoverage = dlg.getCoverageData() if runProject: @@ -1409,7 +1475,8 @@ doNotStart = True # save the info for later use - self.project.setDbgInfo(argv, wd, env, exceptions, self.excList, + self.project.setDbgInfo( + argv, wd, env, exceptions, self.excList, self.excIgnoreList, clearShell) self.lastStartAction = 6 @@ -1485,8 +1552,8 @@ """ Private method to handle the profile actions. - @param runProject flag indicating profiling of the current project (True) - or script (False) + @param runProject flag indicating profiling of the current project + (True) or script (False) """ from .StartDialog import StartDialog @@ -1499,11 +1566,13 @@ cap = self.trUtf8("Profile of Project") else: cap = self.trUtf8("Profile of Script") - dlg = StartDialog(cap, self.argvHistory, self.wdHistory, self.envHistory, + dlg = StartDialog( + cap, self.argvHistory, self.wdHistory, self.envHistory, self.exceptions, self.ui, 3, autoClearShell=self.autoClearShell) if dlg.exec_() == QDialog.Accepted: - argv, wd, env, exceptions, clearShell, clearHistories, console = dlg.getData() + argv, wd, env, exceptions, clearShell, clearHistories, console = \ + dlg.getData() eraseTimings = dlg.getProfilingData() if runProject: @@ -1520,7 +1589,8 @@ doNotStart = True # save the info for later use - self.project.setDbgInfo(argv, wd, env, exceptions, self.excList, + self.project.setDbgInfo( + argv, wd, env, exceptions, self.excList, self.excIgnoreList, clearShell) self.lastStartAction = 8 @@ -1610,13 +1680,15 @@ cap = self.trUtf8("Run Project") else: cap = self.trUtf8("Run Script") - dlg = StartDialog(cap, self.argvHistory, self.wdHistory, self.envHistory, + dlg = StartDialog( + cap, self.argvHistory, self.wdHistory, self.envHistory, self.exceptions, self.ui, 1, autoClearShell=self.autoClearShell, autoFork=self.forkAutomatically, forkChild=self.forkIntoChild) if dlg.exec_() == QDialog.Accepted: - argv, wd, env, exceptions, clearShell, clearHistories, console = dlg.getData() + argv, wd, env, exceptions, clearShell, clearHistories, console = \ + dlg.getData() forkAutomatically, forkIntoChild = dlg.getRunData() if runProject: @@ -1633,7 +1705,8 @@ doNotStart = True # save the info for later use - self.project.setDbgInfo(argv, wd, env, exceptions, self.excList, + self.project.setDbgInfo( + argv, wd, env, exceptions, self.excList, self.excIgnoreList, clearShell) self.lastStartAction = 4 @@ -1710,8 +1783,8 @@ """ Private method to handle the debug actions. - @param debugProject flag indicating debugging the current project (True) - or script (False) + @param debugProject flag indicating debugging the current project + (True) or script (False) """ from .StartDialog import StartDialog @@ -1724,12 +1797,14 @@ cap = self.trUtf8("Debug Project") else: cap = self.trUtf8("Debug Script") - dlg = StartDialog(cap, self.argvHistory, self.wdHistory, self.envHistory, + dlg = StartDialog( + cap, self.argvHistory, self.wdHistory, self.envHistory, self.exceptions, self.ui, 0, tracePython=self.tracePython, autoClearShell=self.autoClearShell, autoContinue=self.autoContinue, autoFork=self.forkAutomatically, forkChild=self.forkIntoChild) if dlg.exec_() == QDialog.Accepted: - argv, wd, env, exceptions, clearShell, clearHistories, console = dlg.getData() + argv, wd, env, exceptions, clearShell, clearHistories, console = \ + dlg.getData() tracePython, autoContinue, forkAutomatically, forkIntoChild = \ dlg.getDebugData() @@ -1747,7 +1822,8 @@ doNotStart = True # save the info for later use - self.project.setDbgInfo(argv, wd, env, exceptions, self.excList, + self.project.setDbgInfo( + argv, wd, env, exceptions, self.excList, self.excIgnoreList, clearShell, tracePython=tracePython, autoContinue=self.autoContinue) @@ -1800,7 +1876,8 @@ self.viewmanager.unhighlight() if not doNotStart: - if debugProject and self.project.getProjectType() == "E4Plugin": + if debugProject and \ + self.project.getProjectType() == "E4Plugin": argv = '--plugin="{0}" {1}'.format(fn, argv) fn = os.path.join(getConfig('ericDir'), "eric5.py") tracePython = True # override flag because it must be true @@ -1814,7 +1891,8 @@ # Ask the client to open the new program. self.debugServer.remoteLoad(fn, argv, wd, env, - autoClearShell=self.autoClearShell, tracePython=tracePython, + autoClearShell=self.autoClearShell, + tracePython=tracePython, autoContinue=autoContinue, forProject=debugProject, runInConsole=console, autoFork=forkAutomatically, forkChild=forkIntoChild, clientType=self.clientType, @@ -1827,7 +1905,8 @@ def __doRestart(self): """ - Private slot to handle the restart action to restart the last debugged file. + Private slot to handle the restart action to restart the last + debugged file. """ self.__resetUI() doNotStart = False @@ -1872,11 +1951,16 @@ self.debugViewer.setCallTraceToProjectMode(forProject) # Ask the client to debug the new program. - self.debugServer.remoteLoad(fn, argv, wd, env, - autoClearShell=self.autoClearShell, tracePython=self.tracePython, - autoContinue=self.autoContinue, forProject=forProject, - runInConsole=self.runInConsole, autoFork=self.forkAutomatically, - forkChild=self.forkIntoChild, clientType=self.clientType, + self.debugServer.remoteLoad( + fn, argv, wd, env, + autoClearShell=self.autoClearShell, + tracePython=self.tracePython, + autoContinue=self.autoContinue, + forProject=forProject, + runInConsole=self.runInConsole, + autoFork=self.forkAutomatically, + forkChild=self.forkIntoChild, + clientType=self.clientType, enableCallTrace=enableCallTrace) # Signal that we have started a debugging session @@ -1884,23 +1968,33 @@ elif self.lastStartAction in [3, 4]: # Ask the client to run the new program. - self.debugServer.remoteRun(fn, argv, wd, env, - autoClearShell=self.autoClearShell, forProject=forProject, - runInConsole=self.runInConsole, autoFork=self.forkAutomatically, - forkChild=self.forkIntoChild, clientType=self.clientType) + self.debugServer.remoteRun( + fn, argv, wd, env, + autoClearShell=self.autoClearShell, + forProject=forProject, + runInConsole=self.runInConsole, + autoFork=self.forkAutomatically, + forkChild=self.forkIntoChild, + clientType=self.clientType) elif self.lastStartAction in [5, 6]: # Ask the client to coverage run the new program. - self.debugServer.remoteCoverage(fn, argv, wd, env, - autoClearShell=self.autoClearShell, erase=self.eraseCoverage, - forProject=forProject, runInConsole=self.runInConsole, + self.debugServer.remoteCoverage( + fn, argv, wd, env, + autoClearShell=self.autoClearShell, + erase=self.eraseCoverage, + forProject=forProject, + runInConsole=self.runInConsole, clientType=self.clientType) elif self.lastStartAction in [7, 8]: # Ask the client to profile run the new program. - self.debugServer.remoteProfile(fn, argv, wd, env, - autoClearShell=self.autoClearShell, erase=self.eraseTimings, - forProject=forProject, runInConsole=self.runInConsole, + self.debugServer.remoteProfile( + fn, argv, wd, env, + autoClearShell=self.autoClearShell, + erase=self.eraseTimings, + forProject=forProject, + runInConsole=self.runInConsole, clientType=self.clientType) self.stopAct.setEnabled(True)