src/eric7/Debugger/DebugUI.py

branch
eric7
changeset 9221
bf71ee032bb4
parent 9209
b99e7fd55fd3
child 9285
d697b03e3bcc
equal deleted inserted replaced
9220:e9e7eca7efee 9221:bf71ee032bb4
20 20
21 from UI.Info import Program 21 from UI.Info import Program
22 from UI.NotificationWidget import NotificationTypes 22 from UI.NotificationWidget import NotificationTypes
23 23
24 from .DebugClientCapabilities import ( 24 from .DebugClientCapabilities import (
25 HasDebugger, HasInterpreter, HasProfiler, HasCoverage 25 HasDebugger,
26 HasInterpreter,
27 HasProfiler,
28 HasCoverage,
26 ) 29 )
27 30
28 from Globals import recentNameBreakpointConditions 31 from Globals import recentNameBreakpointConditions
29 32
30 import Preferences 33 import Preferences
36 39
37 40
38 class DebugUI(QObject): 41 class DebugUI(QObject):
39 """ 42 """
40 Class implementing the debugger part of the UI. 43 Class implementing the debugger part of the UI.
41 44
42 @signal clientStack(stack, debuggerId) emitted at breaking after a reported 45 @signal clientStack(stack, debuggerId) emitted at breaking after a reported
43 exception 46 exception
44 @signal compileForms() emitted if changed project forms should be compiled 47 @signal compileForms() emitted if changed project forms should be compiled
45 @signal compileResources() emitted if changed project resources should be 48 @signal compileResources() emitted if changed project resources should be
46 compiled 49 compiled
52 @signal exceptionInterrupt() emitted after the execution was interrupted 55 @signal exceptionInterrupt() emitted after the execution was interrupted
53 by an exception and acknowledged by the user 56 by an exception and acknowledged by the user
54 @signal appendStdout(msg) emitted when the client program has terminated 57 @signal appendStdout(msg) emitted when the client program has terminated
55 and the display of the termination dialog is suppressed 58 and the display of the termination dialog is suppressed
56 """ 59 """
60
57 clientStack = pyqtSignal(list, str) 61 clientStack = pyqtSignal(list, str)
58 resetUI = pyqtSignal(bool) 62 resetUI = pyqtSignal(bool)
59 exceptionInterrupt = pyqtSignal() 63 exceptionInterrupt = pyqtSignal()
60 compileForms = pyqtSignal() 64 compileForms = pyqtSignal()
61 compileResources = pyqtSignal() 65 compileResources = pyqtSignal()
62 executeMake = pyqtSignal() 66 executeMake = pyqtSignal()
63 debuggingStarted = pyqtSignal(str) 67 debuggingStarted = pyqtSignal(str)
64 appendStdout = pyqtSignal(str) 68 appendStdout = pyqtSignal(str)
65 69
66 def __init__(self, ui, vm, debugServer, debugViewer, project): 70 def __init__(self, ui, vm, debugServer, debugViewer, project):
67 """ 71 """
68 Constructor 72 Constructor
69 73
70 @param ui reference to the main UI 74 @param ui reference to the main UI
71 @param vm reference to the viewmanager 75 @param vm reference to the viewmanager
72 @param debugServer reference to the debug server 76 @param debugServer reference to the debug server
73 @param debugViewer reference to the debug viewer widget 77 @param debugViewer reference to the debug viewer widget
74 @param project reference to the project object 78 @param project reference to the project object
75 """ 79 """
76 super().__init__(ui) 80 super().__init__(ui)
77 81
78 self.ui = ui 82 self.ui = ui
79 self.viewmanager = vm 83 self.viewmanager = vm
80 self.debugServer = debugServer 84 self.debugServer = debugServer
81 self.debugViewer = debugViewer 85 self.debugViewer = debugViewer
82 self.project = project 86 self.project = project
83 87
84 # Clear some variables 88 # Clear some variables
85 self.projectOpen = False 89 self.projectOpen = False
86 self.editorOpen = False 90 self.editorOpen = False
87 91
88 # read the saved debug info values 92 # read the saved debug info values
89 self.lastUsedVenvName = Preferences.getSettings().value( 93 self.lastUsedVenvName = Preferences.getSettings().value(
90 'DebugInfo/VirtualEnvironment', '') 94 "DebugInfo/VirtualEnvironment", ""
95 )
91 self.scriptsHistory = Preferences.toList( 96 self.scriptsHistory = Preferences.toList(
92 Preferences.getSettings().value('DebugInfo/ScriptsHistory')) 97 Preferences.getSettings().value("DebugInfo/ScriptsHistory")
98 )
93 self.argvHistory = Preferences.toList( 99 self.argvHistory = Preferences.toList(
94 Preferences.getSettings().value('DebugInfo/ArgumentsHistory')) 100 Preferences.getSettings().value("DebugInfo/ArgumentsHistory")
101 )
95 self.wdHistory = Preferences.toList( 102 self.wdHistory = Preferences.toList(
96 Preferences.getSettings().value( 103 Preferences.getSettings().value("DebugInfo/WorkingDirectoryHistory")
97 'DebugInfo/WorkingDirectoryHistory')) 104 )
98 self.envHistory = Preferences.toList( 105 self.envHistory = Preferences.toList(
99 Preferences.getSettings().value('DebugInfo/EnvironmentHistory')) 106 Preferences.getSettings().value("DebugInfo/EnvironmentHistory")
107 )
100 self.excList = Preferences.toList( 108 self.excList = Preferences.toList(
101 Preferences.getSettings().value('DebugInfo/Exceptions')) 109 Preferences.getSettings().value("DebugInfo/Exceptions")
110 )
102 self.excIgnoreList = Preferences.toList( 111 self.excIgnoreList = Preferences.toList(
103 Preferences.getSettings().value('DebugInfo/IgnoredExceptions')) 112 Preferences.getSettings().value("DebugInfo/IgnoredExceptions")
113 )
104 self.exceptions = Preferences.toBool( 114 self.exceptions = Preferences.toBool(
105 Preferences.getSettings().value( 115 Preferences.getSettings().value("DebugInfo/ReportExceptions", True)
106 'DebugInfo/ReportExceptions', True)) 116 )
107 self.autoClearShell = Preferences.toBool( 117 self.autoClearShell = Preferences.toBool(
108 Preferences.getSettings().value('DebugInfo/AutoClearShell', True)) 118 Preferences.getSettings().value("DebugInfo/AutoClearShell", True)
119 )
109 self.tracePython = Preferences.toBool( 120 self.tracePython = Preferences.toBool(
110 Preferences.getSettings().value('DebugInfo/TracePython', False)) 121 Preferences.getSettings().value("DebugInfo/TracePython", False)
122 )
111 self.autoContinue = Preferences.toBool( 123 self.autoContinue = Preferences.toBool(
112 Preferences.getSettings().value('DebugInfo/AutoContinue', True)) 124 Preferences.getSettings().value("DebugInfo/AutoContinue", True)
125 )
113 self.enableMultiprocess = Preferences.toBool( 126 self.enableMultiprocess = Preferences.toBool(
114 Preferences.getSettings().value( 127 Preferences.getSettings().value("DebugInfo/EnableMultiprocess", False)
115 'DebugInfo/EnableMultiprocess', False)) 128 )
116 self.multiprocessNoDebugHistory = Preferences.toList( 129 self.multiprocessNoDebugHistory = Preferences.toList(
117 Preferences.getSettings().value( 130 Preferences.getSettings().value("DebugInfo/MultiprocessNoDebugHistory")
118 'DebugInfo/MultiprocessNoDebugHistory')) 131 )
119 self.overrideGlobalConfig = { 132 self.overrideGlobalConfig = {
120 "enable": Preferences.toBool(Preferences.getSettings().value( 133 "enable": Preferences.toBool(
121 'DebugInfo/OverrideGlobal', False)), 134 Preferences.getSettings().value("DebugInfo/OverrideGlobal", False)
122 "redirect": Preferences.toBool(Preferences.getSettings().value( 135 ),
123 'DebugInfo/RedirectStdinStdout', True)), 136 "redirect": Preferences.toBool(
137 Preferences.getSettings().value("DebugInfo/RedirectStdinStdout", True)
138 ),
124 } 139 }
125 140
126 self.lastDebuggedFile = None 141 self.lastDebuggedFile = None
127 self.lastStartAction = 0 # 0=None, 1=Script, 2=Project 142 self.lastStartAction = 0 # 0=None, 1=Script, 2=Project
128 self.clientType = "" 143 self.clientType = ""
129 self.lastAction = -1 144 self.lastAction = -1
130 self.debugActions = [ 145 self.debugActions = [
131 self.__continue, self.__step, self.__stepOver, self.__stepOut, 146 self.__continue,
132 self.__stepQuit, self.__runToCursor, self.__runUntil, 147 self.__step,
133 self.__moveInstructionPointer 148 self.__stepOver,
149 self.__stepOut,
150 self.__stepQuit,
151 self.__runToCursor,
152 self.__runUntil,
153 self.__moveInstructionPointer,
134 ] 154 ]
135 self.__localsVarFilterList, self.__globalsVarFilterList = ( 155 (
136 Preferences.getVarFilters()) 156 self.__localsVarFilterList,
157 self.__globalsVarFilterList,
158 ) = Preferences.getVarFilters()
137 self.debugViewer.setVariablesFilter( 159 self.debugViewer.setVariablesFilter(
138 self.__globalsVarFilterList, self.__localsVarFilterList) 160 self.__globalsVarFilterList, self.__localsVarFilterList
139 161 )
162
140 self.__clientDebuggerIds = set() 163 self.__clientDebuggerIds = set()
141 164
142 # Connect the signals emitted by the debug-server 165 # Connect the signals emitted by the debug-server
143 debugServer.clientGone.connect(self.__clientGone) 166 debugServer.clientGone.connect(self.__clientGone)
144 debugServer.clientLine.connect(self.__clientLine) 167 debugServer.clientLine.connect(self.__clientLine)
145 debugServer.clientDisconnected.connect(self.__clientDisconnected) 168 debugServer.clientDisconnected.connect(self.__clientDisconnected)
146 debugServer.clientExit.connect(self.__clientExit) 169 debugServer.clientExit.connect(self.__clientExit)
148 debugServer.clientSyntaxError.connect(self.__clientSyntaxError) 171 debugServer.clientSyntaxError.connect(self.__clientSyntaxError)
149 debugServer.clientException.connect(self.__clientException) 172 debugServer.clientException.connect(self.__clientException)
150 debugServer.clientSignal.connect(self.__clientSignal) 173 debugServer.clientSignal.connect(self.__clientSignal)
151 debugServer.clientVariables.connect(self.__clientVariables) 174 debugServer.clientVariables.connect(self.__clientVariables)
152 debugServer.clientVariable.connect(self.__clientVariable) 175 debugServer.clientVariable.connect(self.__clientVariable)
153 debugServer.clientBreakConditionError.connect( 176 debugServer.clientBreakConditionError.connect(self.__clientBreakConditionError)
154 self.__clientBreakConditionError) 177 debugServer.clientWatchConditionError.connect(self.__clientWatchConditionError)
155 debugServer.clientWatchConditionError.connect(
156 self.__clientWatchConditionError)
157 debugServer.passiveDebugStarted.connect(self.__passiveDebugStarted) 178 debugServer.passiveDebugStarted.connect(self.__passiveDebugStarted)
158 debugServer.clientThreadSet.connect(self.__clientThreadSet) 179 debugServer.clientThreadSet.connect(self.__clientThreadSet)
159 debugServer.clientDebuggerId.connect(self.__clientDebuggerId) 180 debugServer.clientDebuggerId.connect(self.__clientDebuggerId)
160 181
161 # Connect the signals emitted by the viewmanager 182 # Connect the signals emitted by the viewmanager
162 vm.editorOpened.connect(self.__editorOpened) 183 vm.editorOpened.connect(self.__editorOpened)
163 vm.lastEditorClosed.connect(self.__lastEditorClosed) 184 vm.lastEditorClosed.connect(self.__lastEditorClosed)
164 vm.checkActions.connect(self.__checkActions) 185 vm.checkActions.connect(self.__checkActions)
165 vm.cursorChanged.connect(self.__cursorChanged) 186 vm.cursorChanged.connect(self.__cursorChanged)
166 vm.breakpointToggled.connect(self.__cursorChanged) 187 vm.breakpointToggled.connect(self.__cursorChanged)
167 188
168 # Connect the signals emitted by the project 189 # Connect the signals emitted by the project
169 project.projectOpened.connect(self.__projectOpened) 190 project.projectOpened.connect(self.__projectOpened)
170 project.newProject.connect(self.__projectOpened) 191 project.newProject.connect(self.__projectOpened)
171 project.projectClosed.connect(self.__projectClosed) 192 project.projectClosed.connect(self.__projectClosed)
172 193
173 # Set a flag for the passive debug mode 194 # Set a flag for the passive debug mode
174 self.passive = Preferences.getDebugger("PassiveDbgEnabled") 195 self.passive = Preferences.getDebugger("PassiveDbgEnabled")
175 196
176 def showNotification(self, notification, 197 def showNotification(
177 kind=NotificationTypes.INFORMATION, timeout=None): 198 self, notification, kind=NotificationTypes.INFORMATION, timeout=None
199 ):
178 """ 200 """
179 Public method to show some notification message. 201 Public method to show some notification message.
180 202
181 @param notification message to be shown 203 @param notification message to be shown
182 @type str 204 @type str
183 @param kind kind of notification to be shown 205 @param kind kind of notification to be shown
184 @type NotificationTypes 206 @type NotificationTypes
185 @param timeout timeout for the notification (None = use configured 207 @param timeout timeout for the notification (None = use configured
186 default, 0 = indefinitely) 208 default, 0 = indefinitely)
187 @type int 209 @type int
188 """ 210 """
189 self.ui.showNotification( 211 self.ui.showNotification(
190 UI.PixmapCache.getPixmap("debug48"), 212 UI.PixmapCache.getPixmap("debug48"),
191 self.tr("Notification"), notification, kind=kind, timeout=timeout) 213 self.tr("Notification"),
192 214 notification,
215 kind=kind,
216 timeout=timeout,
217 )
218
193 def variablesFilter(self, scope): 219 def variablesFilter(self, scope):
194 """ 220 """
195 Public method to get the variables filter for a scope. 221 Public method to get the variables filter for a scope.
196 222
197 @param scope flag indicating global (True) or local (False) scope 223 @param scope flag indicating global (True) or local (False) scope
198 @return filters list 224 @return filters list
199 @rtype list of str 225 @rtype list of str
200 """ 226 """
201 if scope: 227 if scope:
202 return self.__globalsVarFilterList[:] 228 return self.__globalsVarFilterList[:]
203 else: 229 else:
204 return self.__localsVarFilterList[:] 230 return self.__localsVarFilterList[:]
205 231
206 def initActions(self): 232 def initActions(self):
207 """ 233 """
208 Public method defining the user interface actions. 234 Public method defining the user interface actions.
209 """ 235 """
210 self.actions = [] 236 self.actions = []
211 237
212 self.runAct = EricAction( 238 self.runAct = EricAction(
213 self.tr('Run Script'), 239 self.tr("Run Script"),
214 UI.PixmapCache.getIcon("runScript"), 240 UI.PixmapCache.getIcon("runScript"),
215 self.tr('&Run Script...'), 241 self.tr("&Run Script..."),
216 Qt.Key.Key_F2, 0, self, 'dbg_run_script') 242 Qt.Key.Key_F2,
217 self.runAct.setStatusTip(self.tr('Run the current Script')) 243 0,
218 self.runAct.setWhatsThis(self.tr( 244 self,
219 """<b>Run Script</b>""" 245 "dbg_run_script",
220 """<p>Set the command line arguments and run the script outside""" 246 )
221 """ the debugger. If the file has unsaved changes it may be""" 247 self.runAct.setStatusTip(self.tr("Run the current Script"))
222 """ saved first.</p>""" 248 self.runAct.setWhatsThis(
223 )) 249 self.tr(
250 """<b>Run Script</b>"""
251 """<p>Set the command line arguments and run the script outside"""
252 """ the debugger. If the file has unsaved changes it may be"""
253 """ saved first.</p>"""
254 )
255 )
224 self.runAct.triggered.connect(self.__runScript) 256 self.runAct.triggered.connect(self.__runScript)
225 self.actions.append(self.runAct) 257 self.actions.append(self.runAct)
226 258
227 self.runProjectAct = EricAction( 259 self.runProjectAct = EricAction(
228 self.tr('Run Project'), 260 self.tr("Run Project"),
229 UI.PixmapCache.getIcon("runProject"), 261 UI.PixmapCache.getIcon("runProject"),
230 self.tr('Run &Project...'), 262 self.tr("Run &Project..."),
231 QKeyCombination(Qt.Modifier.SHIFT, Qt.Key.Key_F2), 263 QKeyCombination(Qt.Modifier.SHIFT, Qt.Key.Key_F2),
232 0, self, 'dbg_run_project') 264 0,
233 self.runProjectAct.setStatusTip(self.tr('Run the current Project')) 265 self,
234 self.runProjectAct.setWhatsThis(self.tr( 266 "dbg_run_project",
235 """<b>Run Project</b>""" 267 )
236 """<p>Set the command line arguments and run the current project""" 268 self.runProjectAct.setStatusTip(self.tr("Run the current Project"))
237 """ outside the debugger.""" 269 self.runProjectAct.setWhatsThis(
238 """ If files of the current project have unsaved changes they""" 270 self.tr(
239 """ may be saved first.</p>""" 271 """<b>Run Project</b>"""
240 )) 272 """<p>Set the command line arguments and run the current project"""
273 """ outside the debugger."""
274 """ If files of the current project have unsaved changes they"""
275 """ may be saved first.</p>"""
276 )
277 )
241 self.runProjectAct.triggered.connect(self.__runProject) 278 self.runProjectAct.triggered.connect(self.__runProject)
242 self.actions.append(self.runProjectAct) 279 self.actions.append(self.runProjectAct)
243 280
244 self.coverageAct = EricAction( 281 self.coverageAct = EricAction(
245 self.tr('Coverage run of Script'), 282 self.tr("Coverage run of Script"),
246 UI.PixmapCache.getIcon("coverageScript"), 283 UI.PixmapCache.getIcon("coverageScript"),
247 self.tr('Coverage run of Script...'), 0, 0, self, 284 self.tr("Coverage run of Script..."),
248 'dbg_coverage_script') 285 0,
286 0,
287 self,
288 "dbg_coverage_script",
289 )
249 self.coverageAct.setStatusTip( 290 self.coverageAct.setStatusTip(
250 self.tr('Perform a coverage run of the current Script')) 291 self.tr("Perform a coverage run of the current Script")
251 self.coverageAct.setWhatsThis(self.tr( 292 )
252 """<b>Coverage run of Script</b>""" 293 self.coverageAct.setWhatsThis(
253 """<p>Set the command line arguments and run the script under""" 294 self.tr(
254 """ the control of a coverage analysis tool. If the file has""" 295 """<b>Coverage run of Script</b>"""
255 """ unsaved changes it may be saved first.</p>""" 296 """<p>Set the command line arguments and run the script under"""
256 )) 297 """ the control of a coverage analysis tool. If the file has"""
298 """ unsaved changes it may be saved first.</p>"""
299 )
300 )
257 self.coverageAct.triggered.connect(self.__coverageScript) 301 self.coverageAct.triggered.connect(self.__coverageScript)
258 self.actions.append(self.coverageAct) 302 self.actions.append(self.coverageAct)
259 303
260 self.coverageProjectAct = EricAction( 304 self.coverageProjectAct = EricAction(
261 self.tr('Coverage run of Project'), 305 self.tr("Coverage run of Project"),
262 UI.PixmapCache.getIcon("coverageProject"), 306 UI.PixmapCache.getIcon("coverageProject"),
263 self.tr('Coverage run of Project...'), 0, 0, self, 307 self.tr("Coverage run of Project..."),
264 'dbg_coverage_project') 308 0,
309 0,
310 self,
311 "dbg_coverage_project",
312 )
265 self.coverageProjectAct.setStatusTip( 313 self.coverageProjectAct.setStatusTip(
266 self.tr('Perform a coverage run of the current Project')) 314 self.tr("Perform a coverage run of the current Project")
267 self.coverageProjectAct.setWhatsThis(self.tr( 315 )
268 """<b>Coverage run of Project</b>""" 316 self.coverageProjectAct.setWhatsThis(
269 """<p>Set the command line arguments and run the current project""" 317 self.tr(
270 """ under the control of a coverage analysis tool.""" 318 """<b>Coverage run of Project</b>"""
271 """ If files of the current project have unsaved changes""" 319 """<p>Set the command line arguments and run the current project"""
272 """ they may be saved first.</p>""" 320 """ under the control of a coverage analysis tool."""
273 )) 321 """ If files of the current project have unsaved changes"""
322 """ they may be saved first.</p>"""
323 )
324 )
274 self.coverageProjectAct.triggered.connect(self.__coverageProject) 325 self.coverageProjectAct.triggered.connect(self.__coverageProject)
275 self.actions.append(self.coverageProjectAct) 326 self.actions.append(self.coverageProjectAct)
276 327
277 self.profileAct = EricAction( 328 self.profileAct = EricAction(
278 self.tr('Profile Script'), 329 self.tr("Profile Script"),
279 UI.PixmapCache.getIcon("profileScript"), 330 UI.PixmapCache.getIcon("profileScript"),
280 self.tr('Profile Script...'), 0, 0, self, 'dbg_profile_script') 331 self.tr("Profile Script..."),
281 self.profileAct.setStatusTip(self.tr('Profile the current Script')) 332 0,
282 self.profileAct.setWhatsThis(self.tr( 333 0,
283 """<b>Profile Script</b>""" 334 self,
284 """<p>Set the command line arguments and profile the script.""" 335 "dbg_profile_script",
285 """ If the file has unsaved changes it may be saved first.</p>""" 336 )
286 )) 337 self.profileAct.setStatusTip(self.tr("Profile the current Script"))
338 self.profileAct.setWhatsThis(
339 self.tr(
340 """<b>Profile Script</b>"""
341 """<p>Set the command line arguments and profile the script."""
342 """ If the file has unsaved changes it may be saved first.</p>"""
343 )
344 )
287 self.profileAct.triggered.connect(self.__profileScript) 345 self.profileAct.triggered.connect(self.__profileScript)
288 self.actions.append(self.profileAct) 346 self.actions.append(self.profileAct)
289 347
290 self.profileProjectAct = EricAction( 348 self.profileProjectAct = EricAction(
291 self.tr('Profile Project'), 349 self.tr("Profile Project"),
292 UI.PixmapCache.getIcon("profileProject"), 350 UI.PixmapCache.getIcon("profileProject"),
293 self.tr('Profile Project...'), 0, 0, self, 351 self.tr("Profile Project..."),
294 'dbg_profile_project') 352 0,
295 self.profileProjectAct.setStatusTip( 353 0,
296 self.tr('Profile the current Project')) 354 self,
297 self.profileProjectAct.setWhatsThis(self.tr( 355 "dbg_profile_project",
298 """<b>Profile Project</b>""" 356 )
299 """<p>Set the command line arguments and profile the current""" 357 self.profileProjectAct.setStatusTip(self.tr("Profile the current Project"))
300 """ project. If files of the current project have unsaved""" 358 self.profileProjectAct.setWhatsThis(
301 """ changes they may be saved first.</p>""" 359 self.tr(
302 )) 360 """<b>Profile Project</b>"""
361 """<p>Set the command line arguments and profile the current"""
362 """ project. If files of the current project have unsaved"""
363 """ changes they may be saved first.</p>"""
364 )
365 )
303 self.profileProjectAct.triggered.connect(self.__profileProject) 366 self.profileProjectAct.triggered.connect(self.__profileProject)
304 self.actions.append(self.profileProjectAct) 367 self.actions.append(self.profileProjectAct)
305 368
306 self.debugAct = EricAction( 369 self.debugAct = EricAction(
307 self.tr('Debug Script'), 370 self.tr("Debug Script"),
308 UI.PixmapCache.getIcon("debugScript"), 371 UI.PixmapCache.getIcon("debugScript"),
309 self.tr('&Debug Script...'), Qt.Key.Key_F5, 0, self, 372 self.tr("&Debug Script..."),
310 'dbg_debug_script') 373 Qt.Key.Key_F5,
311 self.debugAct.setStatusTip(self.tr('Debug the current Script')) 374 0,
312 self.debugAct.setWhatsThis(self.tr( 375 self,
313 """<b>Debug Script</b>""" 376 "dbg_debug_script",
314 """<p>Set the command line arguments and set the current line""" 377 )
315 """ to be the first executable Python statement of the current""" 378 self.debugAct.setStatusTip(self.tr("Debug the current Script"))
316 """ editor window. If the file has unsaved changes it may be""" 379 self.debugAct.setWhatsThis(
317 """ saved first.</p>""" 380 self.tr(
318 )) 381 """<b>Debug Script</b>"""
382 """<p>Set the command line arguments and set the current line"""
383 """ to be the first executable Python statement of the current"""
384 """ editor window. If the file has unsaved changes it may be"""
385 """ saved first.</p>"""
386 )
387 )
319 self.debugAct.triggered.connect(self.__debugScript) 388 self.debugAct.triggered.connect(self.__debugScript)
320 self.actions.append(self.debugAct) 389 self.actions.append(self.debugAct)
321 390
322 self.debugProjectAct = EricAction( 391 self.debugProjectAct = EricAction(
323 self.tr('Debug Project'), 392 self.tr("Debug Project"),
324 UI.PixmapCache.getIcon("debugProject"), 393 UI.PixmapCache.getIcon("debugProject"),
325 self.tr('Debug &Project...'), 394 self.tr("Debug &Project..."),
326 QKeyCombination(Qt.Modifier.SHIFT, Qt.Key.Key_F5), 395 QKeyCombination(Qt.Modifier.SHIFT, Qt.Key.Key_F5),
327 0, self, 'dbg_debug_project') 396 0,
328 self.debugProjectAct.setStatusTip(self.tr( 397 self,
329 'Debug the current Project')) 398 "dbg_debug_project",
330 self.debugProjectAct.setWhatsThis(self.tr( 399 )
331 """<b>Debug Project</b>""" 400 self.debugProjectAct.setStatusTip(self.tr("Debug the current Project"))
332 """<p>Set the command line arguments and set the current line""" 401 self.debugProjectAct.setWhatsThis(
333 """ to be the first executable Python statement of the main""" 402 self.tr(
334 """ script of the current project. If files of the current""" 403 """<b>Debug Project</b>"""
335 """ project have unsaved changes they may be saved first.</p>""" 404 """<p>Set the command line arguments and set the current line"""
336 )) 405 """ to be the first executable Python statement of the main"""
406 """ script of the current project. If files of the current"""
407 """ project have unsaved changes they may be saved first.</p>"""
408 )
409 )
337 self.debugProjectAct.triggered.connect(self.__debugProject) 410 self.debugProjectAct.triggered.connect(self.__debugProject)
338 self.actions.append(self.debugProjectAct) 411 self.actions.append(self.debugProjectAct)
339 412
340 self.restartAct = EricAction( 413 self.restartAct = EricAction(
341 self.tr('Restart'), 414 self.tr("Restart"),
342 UI.PixmapCache.getIcon("debugRestart"), 415 UI.PixmapCache.getIcon("debugRestart"),
343 self.tr('Restart'), Qt.Key.Key_F4, 0, self, 'dbg_restart_script') 416 self.tr("Restart"),
344 self.restartAct.setStatusTip(self.tr( 417 Qt.Key.Key_F4,
345 'Restart the last debugged script')) 418 0,
346 self.restartAct.setWhatsThis(self.tr( 419 self,
347 """<b>Restart</b>""" 420 "dbg_restart_script",
348 """<p>Set the command line arguments and set the current line""" 421 )
349 """ to be the first executable Python statement of the script""" 422 self.restartAct.setStatusTip(self.tr("Restart the last debugged script"))
350 """ that was debugged last. If there are unsaved changes, they""" 423 self.restartAct.setWhatsThis(
351 """ may be saved first.</p>""" 424 self.tr(
352 )) 425 """<b>Restart</b>"""
426 """<p>Set the command line arguments and set the current line"""
427 """ to be the first executable Python statement of the script"""
428 """ that was debugged last. If there are unsaved changes, they"""
429 """ may be saved first.</p>"""
430 )
431 )
353 self.restartAct.triggered.connect(self.__doRestart) 432 self.restartAct.triggered.connect(self.__doRestart)
354 self.actions.append(self.restartAct) 433 self.actions.append(self.restartAct)
355 434
356 self.stopAct = EricAction( 435 self.stopAct = EricAction(
357 self.tr('Stop'), 436 self.tr("Stop"),
358 UI.PixmapCache.getIcon("stopScript"), 437 UI.PixmapCache.getIcon("stopScript"),
359 self.tr('Stop'), 438 self.tr("Stop"),
360 QKeyCombination(Qt.Modifier.SHIFT, Qt.Key.Key_F10), 439 QKeyCombination(Qt.Modifier.SHIFT, Qt.Key.Key_F10),
361 0, 440 0,
362 self, 'dbg_stop_script') 441 self,
442 "dbg_stop_script",
443 )
363 self.stopAct.setStatusTip(self.tr("""Stop the running script.""")) 444 self.stopAct.setStatusTip(self.tr("""Stop the running script."""))
364 self.stopAct.setWhatsThis(self.tr( 445 self.stopAct.setWhatsThis(
365 """<b>Stop</b>""" 446 self.tr(
366 """<p>This stops the script running in the debugger backend.</p>""" 447 """<b>Stop</b>"""
367 )) 448 """<p>This stops the script running in the debugger backend.</p>"""
449 )
450 )
368 self.stopAct.triggered.connect(self.__stopScript) 451 self.stopAct.triggered.connect(self.__stopScript)
369 self.actions.append(self.stopAct) 452 self.actions.append(self.stopAct)
370 453
371 self.debugActGrp = createActionGroup(self) 454 self.debugActGrp = createActionGroup(self)
372 455
373 act = EricAction( 456 act = EricAction(
374 self.tr('Continue'), 457 self.tr("Continue"),
375 UI.PixmapCache.getIcon("continue"), 458 UI.PixmapCache.getIcon("continue"),
376 self.tr('&Continue'), Qt.Key.Key_F6, 0, 459 self.tr("&Continue"),
377 self.debugActGrp, 'dbg_continue') 460 Qt.Key.Key_F6,
378 act.setStatusTip( 461 0,
379 self.tr('Continue running the program from the current line')) 462 self.debugActGrp,
380 act.setWhatsThis(self.tr( 463 "dbg_continue",
381 """<b>Continue</b>""" 464 )
382 """<p>Continue running the program from the current line. The""" 465 act.setStatusTip(self.tr("Continue running the program from the current line"))
383 """ program will stop when it terminates or when a breakpoint""" 466 act.setWhatsThis(
384 """ is reached.</p>""" 467 self.tr(
385 )) 468 """<b>Continue</b>"""
469 """<p>Continue running the program from the current line. The"""
470 """ program will stop when it terminates or when a breakpoint"""
471 """ is reached.</p>"""
472 )
473 )
386 act.triggered.connect(self.__continue) 474 act.triggered.connect(self.__continue)
387 self.actions.append(act) 475 self.actions.append(act)
388 476
389 act = EricAction( 477 act = EricAction(
390 self.tr('Continue to Cursor'), 478 self.tr("Continue to Cursor"),
391 UI.PixmapCache.getIcon("continueToCursor"), 479 UI.PixmapCache.getIcon("continueToCursor"),
392 self.tr('Continue &To Cursor'), 480 self.tr("Continue &To Cursor"),
393 QKeyCombination(Qt.Modifier.SHIFT, Qt.Key.Key_F6), 481 QKeyCombination(Qt.Modifier.SHIFT, Qt.Key.Key_F6),
394 0, self.debugActGrp, 'dbg_continue_to_cursor') 482 0,
395 act.setStatusTip(self.tr( 483 self.debugActGrp,
396 """Continue running the program from the""" 484 "dbg_continue_to_cursor",
397 """ current line to the current cursor position""")) 485 )
398 act.setWhatsThis(self.tr( 486 act.setStatusTip(
399 """<b>Continue To Cursor</b>""" 487 self.tr(
400 """<p>Continue running the program from the current line to the""" 488 """Continue running the program from the"""
401 """ current cursor position.</p>""" 489 """ current line to the current cursor position"""
402 )) 490 )
491 )
492 act.setWhatsThis(
493 self.tr(
494 """<b>Continue To Cursor</b>"""
495 """<p>Continue running the program from the current line to the"""
496 """ current cursor position.</p>"""
497 )
498 )
403 act.triggered.connect(self.__runToCursor) 499 act.triggered.connect(self.__runToCursor)
404 self.actions.append(act) 500 self.actions.append(act)
405 501
406 act = EricAction( 502 act = EricAction(
407 self.tr('Continue Until'), 503 self.tr("Continue Until"),
408 UI.PixmapCache.getIcon("continueUntil"), 504 UI.PixmapCache.getIcon("continueUntil"),
409 self.tr('Continue &Until'), 505 self.tr("Continue &Until"),
410 QKeyCombination(Qt.Modifier.CTRL, Qt.Key.Key_F6), 506 QKeyCombination(Qt.Modifier.CTRL, Qt.Key.Key_F6),
411 0, 507 0,
412 self.debugActGrp, 'dbg_continue_until') 508 self.debugActGrp,
413 act.setStatusTip(self.tr( 509 "dbg_continue_until",
414 """Continue running the program from the current line to the""" 510 )
415 """ current cursor position or until leaving the current frame""")) 511 act.setStatusTip(
416 act.setWhatsThis(self.tr( 512 self.tr(
417 """<b>Continue Until</b>""" 513 """Continue running the program from the current line to the"""
418 """<p>Continue running the program from the current line to the""" 514 """ current cursor position or until leaving the current frame"""
419 """ cursor position greater than the current line or until""" 515 )
420 """ leaving the current frame.</p>""" 516 )
421 )) 517 act.setWhatsThis(
518 self.tr(
519 """<b>Continue Until</b>"""
520 """<p>Continue running the program from the current line to the"""
521 """ cursor position greater than the current line or until"""
522 """ leaving the current frame.</p>"""
523 )
524 )
422 act.triggered.connect(self.__runUntil) 525 act.triggered.connect(self.__runUntil)
423 self.actions.append(act) 526 self.actions.append(act)
424 527
425 act = EricAction( 528 act = EricAction(
426 self.tr('Move Instruction Pointer to Cursor'), 529 self.tr("Move Instruction Pointer to Cursor"),
427 UI.PixmapCache.getIcon("moveInstructionPointer"), 530 UI.PixmapCache.getIcon("moveInstructionPointer"),
428 self.tr('&Jump To Cursor'), Qt.Key.Key_F12, 0, 531 self.tr("&Jump To Cursor"),
429 self.debugActGrp, 'dbg_jump_to_cursor') 532 Qt.Key.Key_F12,
430 act.setStatusTip(self.tr( 533 0,
431 """Skip the code from the""" 534 self.debugActGrp,
432 """ current line to the current cursor position""")) 535 "dbg_jump_to_cursor",
433 act.setWhatsThis(self.tr( 536 )
434 """<b>Move Instruction Pointer to Cursor</b>""" 537 act.setStatusTip(
435 """<p>Move the Python internal instruction pointer to the""" 538 self.tr(
436 """ current cursor position without executing the code in""" 539 """Skip the code from the"""
437 """ between.</p>""" 540 """ current line to the current cursor position"""
438 """<p>It's not possible to jump out of a function or jump""" 541 )
439 """ in a code block, e.g. a loop. In these cases, a error""" 542 )
440 """ message is printed to the log window.</p>""" 543 act.setWhatsThis(
441 )) 544 self.tr(
545 """<b>Move Instruction Pointer to Cursor</b>"""
546 """<p>Move the Python internal instruction pointer to the"""
547 """ current cursor position without executing the code in"""
548 """ between.</p>"""
549 """<p>It's not possible to jump out of a function or jump"""
550 """ in a code block, e.g. a loop. In these cases, a error"""
551 """ message is printed to the log window.</p>"""
552 )
553 )
442 act.triggered.connect(self.__moveInstructionPointer) 554 act.triggered.connect(self.__moveInstructionPointer)
443 self.actions.append(act) 555 self.actions.append(act)
444 556
445 act = EricAction( 557 act = EricAction(
446 self.tr('Single Step'), 558 self.tr("Single Step"),
447 UI.PixmapCache.getIcon("step"), 559 UI.PixmapCache.getIcon("step"),
448 self.tr('Sin&gle Step'), Qt.Key.Key_F7, 0, 560 self.tr("Sin&gle Step"),
449 self.debugActGrp, 'dbg_single_step') 561 Qt.Key.Key_F7,
450 act.setStatusTip(self.tr('Execute a single Python statement')) 562 0,
451 act.setWhatsThis(self.tr( 563 self.debugActGrp,
452 """<b>Single Step</b>""" 564 "dbg_single_step",
453 """<p>Execute a single Python statement. If the statement""" 565 )
454 """ is an <tt>import</tt> statement, a class constructor, or a""" 566 act.setStatusTip(self.tr("Execute a single Python statement"))
455 """ method or function call then control is returned to the""" 567 act.setWhatsThis(
456 """ debugger at the next statement.</p>""" 568 self.tr(
457 )) 569 """<b>Single Step</b>"""
570 """<p>Execute a single Python statement. If the statement"""
571 """ is an <tt>import</tt> statement, a class constructor, or a"""
572 """ method or function call then control is returned to the"""
573 """ debugger at the next statement.</p>"""
574 )
575 )
458 act.triggered.connect(self.__step) 576 act.triggered.connect(self.__step)
459 self.actions.append(act) 577 self.actions.append(act)
460 578
461 act = EricAction( 579 act = EricAction(
462 self.tr('Step Over'), 580 self.tr("Step Over"),
463 UI.PixmapCache.getIcon("stepOver"), 581 UI.PixmapCache.getIcon("stepOver"),
464 self.tr('Step &Over'), Qt.Key.Key_F8, 0, 582 self.tr("Step &Over"),
465 self.debugActGrp, 'dbg_step_over') 583 Qt.Key.Key_F8,
466 act.setStatusTip(self.tr( 584 0,
467 """Execute a single Python statement staying""" 585 self.debugActGrp,
468 """ in the current frame""")) 586 "dbg_step_over",
469 act.setWhatsThis(self.tr( 587 )
470 """<b>Step Over</b>""" 588 act.setStatusTip(
471 """<p>Execute a single Python statement staying in the same""" 589 self.tr(
472 """ frame. If the statement is an <tt>import</tt> statement,""" 590 """Execute a single Python statement staying"""
473 """ a class constructor, or a method or function call then""" 591 """ in the current frame"""
474 """ control is returned to the debugger after the statement""" 592 )
475 """ has completed.</p>""" 593 )
476 )) 594 act.setWhatsThis(
595 self.tr(
596 """<b>Step Over</b>"""
597 """<p>Execute a single Python statement staying in the same"""
598 """ frame. If the statement is an <tt>import</tt> statement,"""
599 """ a class constructor, or a method or function call then"""
600 """ control is returned to the debugger after the statement"""
601 """ has completed.</p>"""
602 )
603 )
477 act.triggered.connect(self.__stepOver) 604 act.triggered.connect(self.__stepOver)
478 self.actions.append(act) 605 self.actions.append(act)
479 606
480 act = EricAction( 607 act = EricAction(
481 self.tr('Step Out'), 608 self.tr("Step Out"),
482 UI.PixmapCache.getIcon("stepOut"), 609 UI.PixmapCache.getIcon("stepOut"),
483 self.tr('Step Ou&t'), Qt.Key.Key_F9, 0, 610 self.tr("Step Ou&t"),
484 self.debugActGrp, 'dbg_step_out') 611 Qt.Key.Key_F9,
485 act.setStatusTip(self.tr( 612 0,
486 """Execute Python statements until leaving""" 613 self.debugActGrp,
487 """ the current frame""")) 614 "dbg_step_out",
488 act.setWhatsThis(self.tr( 615 )
489 """<b>Step Out</b>""" 616 act.setStatusTip(
490 """<p>Execute Python statements until leaving the current""" 617 self.tr(
491 """ frame. If the statements are inside an <tt>import</tt>""" 618 """Execute Python statements until leaving""" """ the current frame"""
492 """ statement, a class constructor, or a method or function""" 619 )
493 """ call then control is returned to the debugger after the""" 620 )
494 """ current frame has been left.</p>""" 621 act.setWhatsThis(
495 )) 622 self.tr(
623 """<b>Step Out</b>"""
624 """<p>Execute Python statements until leaving the current"""
625 """ frame. If the statements are inside an <tt>import</tt>"""
626 """ statement, a class constructor, or a method or function"""
627 """ call then control is returned to the debugger after the"""
628 """ current frame has been left.</p>"""
629 )
630 )
496 act.triggered.connect(self.__stepOut) 631 act.triggered.connect(self.__stepOut)
497 self.actions.append(act) 632 self.actions.append(act)
498 633
499 act = EricAction( 634 act = EricAction(
500 self.tr('Stop'), 635 self.tr("Stop"),
501 UI.PixmapCache.getIcon("stepQuit"), 636 UI.PixmapCache.getIcon("stepQuit"),
502 self.tr('&Stop'), Qt.Key.Key_F10, 0, 637 self.tr("&Stop"),
503 self.debugActGrp, 'dbg_stop') 638 Qt.Key.Key_F10,
504 act.setStatusTip(self.tr('Stop debugging')) 639 0,
505 act.setWhatsThis(self.tr( 640 self.debugActGrp,
506 """<b>Stop</b>""" 641 "dbg_stop",
507 """<p>Stop the running debugging session.</p>""" 642 )
508 )) 643 act.setStatusTip(self.tr("Stop debugging"))
644 act.setWhatsThis(
645 self.tr("""<b>Stop</b>""" """<p>Stop the running debugging session.</p>""")
646 )
509 act.triggered.connect(self.__stepQuit) 647 act.triggered.connect(self.__stepQuit)
510 self.actions.append(act) 648 self.actions.append(act)
511 649
512 self.dbgFilterAct = EricAction( 650 self.dbgFilterAct = EricAction(
513 self.tr('Variables Type Filter'), 651 self.tr("Variables Type Filter"),
514 self.tr('Varia&bles Type Filter...'), 0, 0, self, 652 self.tr("Varia&bles Type Filter..."),
515 'dbg_variables_filter') 653 0,
516 self.dbgFilterAct.setStatusTip(self.tr( 654 0,
517 'Configure variables type filter')) 655 self,
518 self.dbgFilterAct.setWhatsThis(self.tr( 656 "dbg_variables_filter",
519 """<b>Variables Type Filter</b>""" 657 )
520 """<p>Configure the variables type filter. Only variable types""" 658 self.dbgFilterAct.setStatusTip(self.tr("Configure variables type filter"))
521 """ that are not selected are displayed in the global or local""" 659 self.dbgFilterAct.setWhatsThis(
522 """ variables window during a debugging session.</p>""" 660 self.tr(
523 )) 661 """<b>Variables Type Filter</b>"""
524 self.dbgFilterAct.triggered.connect( 662 """<p>Configure the variables type filter. Only variable types"""
525 self.__configureVariablesFilters) 663 """ that are not selected are displayed in the global or local"""
664 """ variables window during a debugging session.</p>"""
665 )
666 )
667 self.dbgFilterAct.triggered.connect(self.__configureVariablesFilters)
526 self.actions.append(self.dbgFilterAct) 668 self.actions.append(self.dbgFilterAct)
527 669
528 self.excFilterAct = EricAction( 670 self.excFilterAct = EricAction(
529 self.tr('Exceptions Filter'), 671 self.tr("Exceptions Filter"),
530 self.tr('&Exceptions Filter...'), 0, 0, self, 672 self.tr("&Exceptions Filter..."),
531 'dbg_exceptions_filter') 673 0,
532 self.excFilterAct.setStatusTip(self.tr( 674 0,
533 'Configure exceptions filter')) 675 self,
534 self.excFilterAct.setWhatsThis(self.tr( 676 "dbg_exceptions_filter",
535 """<b>Exceptions Filter</b>""" 677 )
536 """<p>Configure the exceptions filter. Only exception types""" 678 self.excFilterAct.setStatusTip(self.tr("Configure exceptions filter"))
537 """ that are listed are highlighted during a debugging""" 679 self.excFilterAct.setWhatsThis(
538 """ session.</p><p>Please note, that all unhandled exceptions""" 680 self.tr(
539 """ are highlighted indepent from the filter list.</p>""" 681 """<b>Exceptions Filter</b>"""
540 )) 682 """<p>Configure the exceptions filter. Only exception types"""
541 self.excFilterAct.triggered.connect( 683 """ that are listed are highlighted during a debugging"""
542 self.__configureExceptionsFilter) 684 """ session.</p><p>Please note, that all unhandled exceptions"""
685 """ are highlighted indepent from the filter list.</p>"""
686 )
687 )
688 self.excFilterAct.triggered.connect(self.__configureExceptionsFilter)
543 self.actions.append(self.excFilterAct) 689 self.actions.append(self.excFilterAct)
544 690
545 self.excIgnoreFilterAct = EricAction( 691 self.excIgnoreFilterAct = EricAction(
546 self.tr('Ignored Exceptions'), 692 self.tr("Ignored Exceptions"),
547 self.tr('&Ignored Exceptions...'), 0, 0, 693 self.tr("&Ignored Exceptions..."),
548 self, 'dbg_ignored_exceptions') 694 0,
549 self.excIgnoreFilterAct.setStatusTip(self.tr( 695 0,
550 'Configure ignored exceptions')) 696 self,
551 self.excIgnoreFilterAct.setWhatsThis(self.tr( 697 "dbg_ignored_exceptions",
552 """<b>Ignored Exceptions</b>""" 698 )
553 """<p>Configure the ignored exceptions. Only exception types""" 699 self.excIgnoreFilterAct.setStatusTip(self.tr("Configure ignored exceptions"))
554 """ that are not listed are highlighted during a debugging""" 700 self.excIgnoreFilterAct.setWhatsThis(
555 """ session.</p><p>Please note, that unhandled exceptions""" 701 self.tr(
556 """ cannot be ignored.</p>""" 702 """<b>Ignored Exceptions</b>"""
557 )) 703 """<p>Configure the ignored exceptions. Only exception types"""
558 self.excIgnoreFilterAct.triggered.connect( 704 """ that are not listed are highlighted during a debugging"""
559 self.__configureIgnoredExceptions) 705 """ session.</p><p>Please note, that unhandled exceptions"""
706 """ cannot be ignored.</p>"""
707 )
708 )
709 self.excIgnoreFilterAct.triggered.connect(self.__configureIgnoredExceptions)
560 self.actions.append(self.excIgnoreFilterAct) 710 self.actions.append(self.excIgnoreFilterAct)
561 711
562 self.dbgSetBpActGrp = createActionGroup(self) 712 self.dbgSetBpActGrp = createActionGroup(self)
563 713
564 self.dbgToggleBpAct = EricAction( 714 self.dbgToggleBpAct = EricAction(
565 self.tr('Toggle Breakpoint'), 715 self.tr("Toggle Breakpoint"),
566 UI.PixmapCache.getIcon("breakpointToggle"), 716 UI.PixmapCache.getIcon("breakpointToggle"),
567 self.tr('Toggle Breakpoint'), 717 self.tr("Toggle Breakpoint"),
568 QKeySequence(self.tr("Shift+F11", "Debug|Toggle Breakpoint")), 718 QKeySequence(self.tr("Shift+F11", "Debug|Toggle Breakpoint")),
569 0, self.dbgSetBpActGrp, 'dbg_toggle_breakpoint') 719 0,
570 self.dbgToggleBpAct.setStatusTip(self.tr('Toggle Breakpoint')) 720 self.dbgSetBpActGrp,
571 self.dbgToggleBpAct.setWhatsThis(self.tr( 721 "dbg_toggle_breakpoint",
572 """<b>Toggle Breakpoint</b>""" 722 )
573 """<p>Toggles a breakpoint at the current line of the""" 723 self.dbgToggleBpAct.setStatusTip(self.tr("Toggle Breakpoint"))
574 """ current editor.</p>""" 724 self.dbgToggleBpAct.setWhatsThis(
575 )) 725 self.tr(
726 """<b>Toggle Breakpoint</b>"""
727 """<p>Toggles a breakpoint at the current line of the"""
728 """ current editor.</p>"""
729 )
730 )
576 self.dbgToggleBpAct.triggered.connect(self.__toggleBreakpoint) 731 self.dbgToggleBpAct.triggered.connect(self.__toggleBreakpoint)
577 self.actions.append(self.dbgToggleBpAct) 732 self.actions.append(self.dbgToggleBpAct)
578 733
579 self.dbgEditBpAct = EricAction( 734 self.dbgEditBpAct = EricAction(
580 self.tr('Edit Breakpoint'), 735 self.tr("Edit Breakpoint"),
581 UI.PixmapCache.getIcon("cBreakpointToggle"), 736 UI.PixmapCache.getIcon("cBreakpointToggle"),
582 self.tr('Edit Breakpoint...'), 737 self.tr("Edit Breakpoint..."),
583 QKeySequence(self.tr("Shift+F12", "Debug|Edit Breakpoint")), 0, 738 QKeySequence(self.tr("Shift+F12", "Debug|Edit Breakpoint")),
584 self.dbgSetBpActGrp, 'dbg_edit_breakpoint') 739 0,
585 self.dbgEditBpAct.setStatusTip(self.tr('Edit Breakpoint')) 740 self.dbgSetBpActGrp,
586 self.dbgEditBpAct.setWhatsThis(self.tr( 741 "dbg_edit_breakpoint",
587 """<b>Edit Breakpoint</b>""" 742 )
588 """<p>Opens a dialog to edit the breakpoints properties.""" 743 self.dbgEditBpAct.setStatusTip(self.tr("Edit Breakpoint"))
589 """ It works at the current line of the current editor.</p>""" 744 self.dbgEditBpAct.setWhatsThis(
590 )) 745 self.tr(
746 """<b>Edit Breakpoint</b>"""
747 """<p>Opens a dialog to edit the breakpoints properties."""
748 """ It works at the current line of the current editor.</p>"""
749 )
750 )
591 self.dbgEditBpAct.triggered.connect(self.__editBreakpoint) 751 self.dbgEditBpAct.triggered.connect(self.__editBreakpoint)
592 self.actions.append(self.dbgEditBpAct) 752 self.actions.append(self.dbgEditBpAct)
593 753
594 self.dbgNextBpAct = EricAction( 754 self.dbgNextBpAct = EricAction(
595 self.tr('Next Breakpoint'), 755 self.tr("Next Breakpoint"),
596 UI.PixmapCache.getIcon("breakpointNext"), 756 UI.PixmapCache.getIcon("breakpointNext"),
597 self.tr('Next Breakpoint'), 757 self.tr("Next Breakpoint"),
598 QKeySequence( 758 QKeySequence(self.tr("Ctrl+Shift+PgDown", "Debug|Next Breakpoint")),
599 self.tr("Ctrl+Shift+PgDown", "Debug|Next Breakpoint")), 0, 759 0,
600 self.dbgSetBpActGrp, 'dbg_next_breakpoint') 760 self.dbgSetBpActGrp,
601 self.dbgNextBpAct.setStatusTip(self.tr('Next Breakpoint')) 761 "dbg_next_breakpoint",
602 self.dbgNextBpAct.setWhatsThis(self.tr( 762 )
603 """<b>Next Breakpoint</b>""" 763 self.dbgNextBpAct.setStatusTip(self.tr("Next Breakpoint"))
604 """<p>Go to next breakpoint of the current editor.</p>""" 764 self.dbgNextBpAct.setWhatsThis(
605 )) 765 self.tr(
766 """<b>Next Breakpoint</b>"""
767 """<p>Go to next breakpoint of the current editor.</p>"""
768 )
769 )
606 self.dbgNextBpAct.triggered.connect(self.__nextBreakpoint) 770 self.dbgNextBpAct.triggered.connect(self.__nextBreakpoint)
607 self.actions.append(self.dbgNextBpAct) 771 self.actions.append(self.dbgNextBpAct)
608 772
609 self.dbgPrevBpAct = EricAction( 773 self.dbgPrevBpAct = EricAction(
610 self.tr('Previous Breakpoint'), 774 self.tr("Previous Breakpoint"),
611 UI.PixmapCache.getIcon("breakpointPrevious"), 775 UI.PixmapCache.getIcon("breakpointPrevious"),
612 self.tr('Previous Breakpoint'), 776 self.tr("Previous Breakpoint"),
613 QKeySequence( 777 QKeySequence(self.tr("Ctrl+Shift+PgUp", "Debug|Previous Breakpoint")),
614 self.tr("Ctrl+Shift+PgUp", "Debug|Previous Breakpoint")), 778 0,
615 0, self.dbgSetBpActGrp, 'dbg_previous_breakpoint') 779 self.dbgSetBpActGrp,
616 self.dbgPrevBpAct.setStatusTip(self.tr('Previous Breakpoint')) 780 "dbg_previous_breakpoint",
617 self.dbgPrevBpAct.setWhatsThis(self.tr( 781 )
618 """<b>Previous Breakpoint</b>""" 782 self.dbgPrevBpAct.setStatusTip(self.tr("Previous Breakpoint"))
619 """<p>Go to previous breakpoint of the current editor.</p>""" 783 self.dbgPrevBpAct.setWhatsThis(
620 )) 784 self.tr(
785 """<b>Previous Breakpoint</b>"""
786 """<p>Go to previous breakpoint of the current editor.</p>"""
787 )
788 )
621 self.dbgPrevBpAct.triggered.connect(self.__previousBreakpoint) 789 self.dbgPrevBpAct.triggered.connect(self.__previousBreakpoint)
622 self.actions.append(self.dbgPrevBpAct) 790 self.actions.append(self.dbgPrevBpAct)
623 791
624 act = EricAction( 792 act = EricAction(
625 self.tr('Clear Breakpoints'), 793 self.tr("Clear Breakpoints"),
626 self.tr('Clear Breakpoints'), 794 self.tr("Clear Breakpoints"),
627 0, 0, 795 0,
628 self.dbgSetBpActGrp, 'dbg_clear_breakpoint') 796 0,
629 act.setStatusTip(self.tr('Clear Breakpoints')) 797 self.dbgSetBpActGrp,
630 act.setWhatsThis(self.tr( 798 "dbg_clear_breakpoint",
631 """<b>Clear Breakpoints</b>""" 799 )
632 """<p>Clear breakpoints of all editors.</p>""" 800 act.setStatusTip(self.tr("Clear Breakpoints"))
633 )) 801 act.setWhatsThis(
802 self.tr(
803 """<b>Clear Breakpoints</b>"""
804 """<p>Clear breakpoints of all editors.</p>"""
805 )
806 )
634 act.triggered.connect(self.__clearBreakpoints) 807 act.triggered.connect(self.__clearBreakpoints)
635 self.actions.append(act) 808 self.actions.append(act)
636 809
637 self.debugActGrp.setEnabled(False) 810 self.debugActGrp.setEnabled(False)
638 self.dbgSetBpActGrp.setEnabled(False) 811 self.dbgSetBpActGrp.setEnabled(False)
640 self.profileProjectAct.setEnabled(False) 813 self.profileProjectAct.setEnabled(False)
641 self.coverageProjectAct.setEnabled(False) 814 self.coverageProjectAct.setEnabled(False)
642 self.debugProjectAct.setEnabled(False) 815 self.debugProjectAct.setEnabled(False)
643 self.restartAct.setEnabled(False) 816 self.restartAct.setEnabled(False)
644 self.stopAct.setEnabled(False) 817 self.stopAct.setEnabled(False)
645 818
646 def initMenus(self): 819 def initMenus(self):
647 """ 820 """
648 Public slot to initialize the project menu. 821 Public slot to initialize the project menu.
649 822
650 @return the generated menu 823 @return the generated menu
651 """ 824 """
652 dmenu = QMenu(self.tr('&Debug'), self.parent()) 825 dmenu = QMenu(self.tr("&Debug"), self.parent())
653 dmenu.setTearOffEnabled(True) 826 dmenu.setTearOffEnabled(True)
654 smenu = QMenu(self.tr('Sta&rt'), self.parent()) 827 smenu = QMenu(self.tr("Sta&rt"), self.parent())
655 smenu.setTearOffEnabled(True) 828 smenu.setTearOffEnabled(True)
656 self.breakpointsMenu = QMenu(self.tr('&Breakpoints'), dmenu) 829 self.breakpointsMenu = QMenu(self.tr("&Breakpoints"), dmenu)
657 830
658 smenu.addAction(self.restartAct) 831 smenu.addAction(self.restartAct)
659 smenu.addAction(self.stopAct) 832 smenu.addAction(self.stopAct)
660 smenu.addSeparator() 833 smenu.addSeparator()
661 smenu.addAction(self.runAct) 834 smenu.addAction(self.runAct)
662 smenu.addAction(self.runProjectAct) 835 smenu.addAction(self.runProjectAct)
667 smenu.addAction(self.profileAct) 840 smenu.addAction(self.profileAct)
668 smenu.addAction(self.profileProjectAct) 841 smenu.addAction(self.profileProjectAct)
669 smenu.addSeparator() 842 smenu.addSeparator()
670 smenu.addAction(self.coverageAct) 843 smenu.addAction(self.coverageAct)
671 smenu.addAction(self.coverageProjectAct) 844 smenu.addAction(self.coverageProjectAct)
672 845
673 dmenu.addActions(self.debugActGrp.actions()) 846 dmenu.addActions(self.debugActGrp.actions())
674 dmenu.addSeparator() 847 dmenu.addSeparator()
675 dmenu.addActions(self.dbgSetBpActGrp.actions()) 848 dmenu.addActions(self.dbgSetBpActGrp.actions())
676 self.menuBreakpointsAct = dmenu.addMenu(self.breakpointsMenu) 849 self.menuBreakpointsAct = dmenu.addMenu(self.breakpointsMenu)
677 dmenu.addSeparator() 850 dmenu.addSeparator()
678 dmenu.addAction(self.dbgFilterAct) 851 dmenu.addAction(self.dbgFilterAct)
679 dmenu.addAction(self.excFilterAct) 852 dmenu.addAction(self.excFilterAct)
680 dmenu.addAction(self.excIgnoreFilterAct) 853 dmenu.addAction(self.excIgnoreFilterAct)
681 854
682 self.breakpointsMenu.aboutToShow.connect(self.__showBreakpointsMenu) 855 self.breakpointsMenu.aboutToShow.connect(self.__showBreakpointsMenu)
683 self.breakpointsMenu.triggered.connect(self.__breakpointSelected) 856 self.breakpointsMenu.triggered.connect(self.__breakpointSelected)
684 dmenu.aboutToShow.connect(self.__showDebugMenu) 857 dmenu.aboutToShow.connect(self.__showDebugMenu)
685 858
686 return smenu, dmenu 859 return smenu, dmenu
687 860
688 def initToolbars(self, toolbarManager): 861 def initToolbars(self, toolbarManager):
689 """ 862 """
690 Public slot to initialize the debug toolbars. 863 Public slot to initialize the debug toolbars.
691 864
692 @param toolbarManager reference to a toolbar manager object 865 @param toolbarManager reference to a toolbar manager object
693 (EricToolBarManager) 866 (EricToolBarManager)
694 @return the generated toolbars (list of QToolBar) 867 @return the generated toolbars (list of QToolBar)
695 """ 868 """
696 starttb = QToolBar(self.tr("Start"), self.ui) 869 starttb = QToolBar(self.tr("Start"), self.ui)
697 starttb.setIconSize(UI.Config.ToolBarIconSize) 870 starttb.setIconSize(UI.Config.ToolBarIconSize)
698 starttb.setObjectName("StartToolbar") 871 starttb.setObjectName("StartToolbar")
699 starttb.setToolTip(self.tr('Start')) 872 starttb.setToolTip(self.tr("Start"))
700 873
701 starttb.addAction(self.restartAct) 874 starttb.addAction(self.restartAct)
702 starttb.addAction(self.stopAct) 875 starttb.addAction(self.stopAct)
703 starttb.addSeparator() 876 starttb.addSeparator()
704 starttb.addAction(self.runAct) 877 starttb.addAction(self.runAct)
705 starttb.addAction(self.runProjectAct) 878 starttb.addAction(self.runProjectAct)
706 starttb.addSeparator() 879 starttb.addSeparator()
707 starttb.addAction(self.debugAct) 880 starttb.addAction(self.debugAct)
708 starttb.addAction(self.debugProjectAct) 881 starttb.addAction(self.debugProjectAct)
709 882
710 debugtb = QToolBar(self.tr("Debug"), self.ui) 883 debugtb = QToolBar(self.tr("Debug"), self.ui)
711 debugtb.setIconSize(UI.Config.ToolBarIconSize) 884 debugtb.setIconSize(UI.Config.ToolBarIconSize)
712 debugtb.setObjectName("DebugToolbar") 885 debugtb.setObjectName("DebugToolbar")
713 debugtb.setToolTip(self.tr('Debug')) 886 debugtb.setToolTip(self.tr("Debug"))
714 887
715 debugtb.addActions(self.debugActGrp.actions()) 888 debugtb.addActions(self.debugActGrp.actions())
716 debugtb.addSeparator() 889 debugtb.addSeparator()
717 debugtb.addAction(self.dbgToggleBpAct) 890 debugtb.addAction(self.dbgToggleBpAct)
718 debugtb.addAction(self.dbgEditBpAct) 891 debugtb.addAction(self.dbgEditBpAct)
719 debugtb.addAction(self.dbgNextBpAct) 892 debugtb.addAction(self.dbgNextBpAct)
720 debugtb.addAction(self.dbgPrevBpAct) 893 debugtb.addAction(self.dbgPrevBpAct)
721 894
722 toolbarManager.addToolBar(starttb, starttb.windowTitle()) 895 toolbarManager.addToolBar(starttb, starttb.windowTitle())
723 toolbarManager.addToolBar(debugtb, debugtb.windowTitle()) 896 toolbarManager.addToolBar(debugtb, debugtb.windowTitle())
724 toolbarManager.addAction(self.profileAct, starttb.windowTitle()) 897 toolbarManager.addAction(self.profileAct, starttb.windowTitle())
725 toolbarManager.addAction(self.profileProjectAct, starttb.windowTitle()) 898 toolbarManager.addAction(self.profileProjectAct, starttb.windowTitle())
726 toolbarManager.addAction(self.coverageAct, starttb.windowTitle()) 899 toolbarManager.addAction(self.coverageAct, starttb.windowTitle())
727 toolbarManager.addAction(self.coverageProjectAct, 900 toolbarManager.addAction(self.coverageProjectAct, starttb.windowTitle())
728 starttb.windowTitle()) 901
729
730 return [starttb, debugtb] 902 return [starttb, debugtb]
731 903
732 def setScriptsHistory(self, scriptName, clearHistories=False, 904 def setScriptsHistory(self, scriptName, clearHistories=False, history=None):
733 history=None):
734 """ 905 """
735 Public slot to initialize the scripts history. 906 Public slot to initialize the scripts history.
736 907
737 @param scriptName script name 908 @param scriptName script name
738 @type str 909 @type str
739 @param clearHistories flag indicating, that the list should 910 @param clearHistories flag indicating, that the list should
740 be cleared (defaults to False) 911 be cleared (defaults to False)
741 @type bool (optional) 912 @type bool (optional)
752 self.scriptsHistory.insert(0, scriptName) 923 self.scriptsHistory.insert(0, scriptName)
753 924
754 def setArgvHistory(self, argsStr, clearHistories=False, history=None): 925 def setArgvHistory(self, argsStr, clearHistories=False, history=None):
755 """ 926 """
756 Public slot to initialize the argv history. 927 Public slot to initialize the argv history.
757 928
758 @param argsStr the commandline arguments (string) 929 @param argsStr the commandline arguments (string)
759 @param clearHistories flag indicating, that the list should 930 @param clearHistories flag indicating, that the list should
760 be cleared (boolean) 931 be cleared (boolean)
761 @param history list of history entries to be set (list of strings) 932 @param history list of history entries to be set (list of strings)
762 """ 933 """
770 self.argvHistory.insert(0, argsStr) 941 self.argvHistory.insert(0, argsStr)
771 942
772 def setWdHistory(self, wdStr, clearHistories=False, history=None): 943 def setWdHistory(self, wdStr, clearHistories=False, history=None):
773 """ 944 """
774 Public slot to initialize the wd history. 945 Public slot to initialize the wd history.
775 946
776 @param wdStr the working directory (string) 947 @param wdStr the working directory (string)
777 @param clearHistories flag indicating, that the list should 948 @param clearHistories flag indicating, that the list should
778 be cleared (boolean) 949 be cleared (boolean)
779 @param history list of history entries to be set (list of strings) 950 @param history list of history entries to be set (list of strings)
780 """ 951 """
784 self.wdHistory = history[:] 955 self.wdHistory = history[:]
785 else: 956 else:
786 if wdStr in self.wdHistory: 957 if wdStr in self.wdHistory:
787 self.wdHistory.remove(wdStr) 958 self.wdHistory.remove(wdStr)
788 self.wdHistory.insert(0, wdStr) 959 self.wdHistory.insert(0, wdStr)
789 960
790 def setEnvHistory(self, envStr, clearHistories=False, history=None): 961 def setEnvHistory(self, envStr, clearHistories=False, history=None):
791 """ 962 """
792 Public slot to initialize the env history. 963 Public slot to initialize the env history.
793 964
794 @param envStr the environment settings (string) 965 @param envStr the environment settings (string)
795 @param clearHistories flag indicating, that the list should 966 @param clearHistories flag indicating, that the list should
796 be cleared (boolean) 967 be cleared (boolean)
797 @param history list of history entries to be set (list of strings) 968 @param history list of history entries to be set (list of strings)
798 """ 969 """
802 self.envHistory = history[:] 973 self.envHistory = history[:]
803 else: 974 else:
804 if envStr in self.envHistory: 975 if envStr in self.envHistory:
805 self.envHistory.remove(envStr) 976 self.envHistory.remove(envStr)
806 self.envHistory.insert(0, envStr) 977 self.envHistory.insert(0, envStr)
807 978
808 def setExceptionReporting(self, exceptions): 979 def setExceptionReporting(self, exceptions):
809 """ 980 """
810 Public slot to initialize the exception reporting flag. 981 Public slot to initialize the exception reporting flag.
811 982
812 @param exceptions flag indicating exception reporting status (boolean) 983 @param exceptions flag indicating exception reporting status (boolean)
813 """ 984 """
814 self.exceptions = exceptions 985 self.exceptions = exceptions
815 986
816 def setExcList(self, excList): 987 def setExcList(self, excList):
817 """ 988 """
818 Public slot to initialize the exceptions type list. 989 Public slot to initialize the exceptions type list.
819 990
820 @param excList list of exception types (list of strings) 991 @param excList list of exception types (list of strings)
821 """ 992 """
822 self.excList = excList[:] # keep a copy 993 self.excList = excList[:] # keep a copy
823 994
824 def setExcIgnoreList(self, excIgnoreList): 995 def setExcIgnoreList(self, excIgnoreList):
825 """ 996 """
826 Public slot to initialize the ignored exceptions type list. 997 Public slot to initialize the ignored exceptions type list.
827 998
828 @param excIgnoreList list of ignored exception types (list of strings) 999 @param excIgnoreList list of ignored exception types (list of strings)
829 """ 1000 """
830 self.excIgnoreList = excIgnoreList[:] # keep a copy 1001 self.excIgnoreList = excIgnoreList[:] # keep a copy
831 1002
832 def setAutoClearShell(self, autoClearShell): 1003 def setAutoClearShell(self, autoClearShell):
833 """ 1004 """
834 Public slot to initialize the autoClearShell flag. 1005 Public slot to initialize the autoClearShell flag.
835 1006
836 @param autoClearShell flag indicating, that the interpreter window 1007 @param autoClearShell flag indicating, that the interpreter window
837 should be cleared (boolean) 1008 should be cleared (boolean)
838 """ 1009 """
839 self.autoClearShell = autoClearShell 1010 self.autoClearShell = autoClearShell
840 1011
841 def setTracePython(self, tracePython): 1012 def setTracePython(self, tracePython):
842 """ 1013 """
843 Public slot to initialize the trace Python flag. 1014 Public slot to initialize the trace Python flag.
844 1015
845 @param tracePython flag indicating if the Python library should be 1016 @param tracePython flag indicating if the Python library should be
846 traced as well (boolean) 1017 traced as well (boolean)
847 """ 1018 """
848 self.tracePython = tracePython 1019 self.tracePython = tracePython
849 1020
850 def setAutoContinue(self, autoContinue): 1021 def setAutoContinue(self, autoContinue):
851 """ 1022 """
852 Public slot to initialize the autoContinue flag. 1023 Public slot to initialize the autoContinue flag.
853 1024
854 @param autoContinue flag indicating, that the debugger should not 1025 @param autoContinue flag indicating, that the debugger should not
855 stop at the first executable line (boolean) 1026 stop at the first executable line (boolean)
856 """ 1027 """
857 self.autoContinue = autoContinue 1028 self.autoContinue = autoContinue
858 1029
859 def __editorOpened(self, fn): 1030 def __editorOpened(self, fn):
860 """ 1031 """
861 Private slot to handle the editorOpened signal. 1032 Private slot to handle the editorOpened signal.
862 1033
863 @param fn filename of the opened editor 1034 @param fn filename of the opened editor
864 """ 1035 """
865 self.editorOpen = True 1036 self.editorOpen = True
866 1037
867 editor = self.viewmanager.getOpenEditor(fn) if fn else None 1038 editor = self.viewmanager.getOpenEditor(fn) if fn else None
868 self.__checkActions(editor) 1039 self.__checkActions(editor)
869 1040
870 def __lastEditorClosed(self): 1041 def __lastEditorClosed(self):
871 """ 1042 """
872 Private slot to handle the closeProgram signal. 1043 Private slot to handle the closeProgram signal.
873 """ 1044 """
874 self.editorOpen = False 1045 self.editorOpen = False
878 if not self.projectOpen: 1049 if not self.projectOpen:
879 self.restartAct.setEnabled(False) 1050 self.restartAct.setEnabled(False)
880 self.lastDebuggedFile = None 1051 self.lastDebuggedFile = None
881 self.lastStartAction = 0 1052 self.lastStartAction = 0
882 self.clientType = "" 1053 self.clientType = ""
883 1054
884 def __checkActions(self, editor): 1055 def __checkActions(self, editor):
885 """ 1056 """
886 Private slot to check some actions for their enable/disable status. 1057 Private slot to check some actions for their enable/disable status.
887 1058
888 @param editor editor window 1059 @param editor editor window
889 """ 1060 """
890 fn = editor.getFileName() if editor else None 1061 fn = editor.getFileName() if editor else None
891 1062
892 cap = 0 1063 cap = 0
893 if fn: 1064 if fn:
894 for language in self.debugServer.getSupportedLanguages(): 1065 for language in self.debugServer.getSupportedLanguages():
895 exts = self.debugServer.getExtensions(language) 1066 exts = self.debugServer.getExtensions(language)
896 if fn.endswith(exts): 1067 if fn.endswith(exts):
897 cap = self.debugServer.getClientCapabilities(language) 1068 cap = self.debugServer.getClientCapabilities(language)
898 break 1069 break
899 else: 1070 else:
900 if editor.isPy3File(): 1071 if editor.isPy3File():
901 cap = self.debugServer.getClientCapabilities('Python3') 1072 cap = self.debugServer.getClientCapabilities("Python3")
902 elif editor.isRubyFile(): 1073 elif editor.isRubyFile():
903 cap = self.debugServer.getClientCapabilities('Ruby') 1074 cap = self.debugServer.getClientCapabilities("Ruby")
904 1075
905 self.dbgSetBpActGrp.setEnabled(cap & HasDebugger) 1076 self.dbgSetBpActGrp.setEnabled(cap & HasDebugger)
906 if editor.curLineHasBreakpoint(): 1077 if editor.curLineHasBreakpoint():
907 self.dbgEditBpAct.setEnabled(True) 1078 self.dbgEditBpAct.setEnabled(True)
908 else: 1079 else:
909 self.dbgEditBpAct.setEnabled(False) 1080 self.dbgEditBpAct.setEnabled(False)
913 else: 1084 else:
914 self.dbgNextBpAct.setEnabled(False) 1085 self.dbgNextBpAct.setEnabled(False)
915 self.dbgPrevBpAct.setEnabled(False) 1086 self.dbgPrevBpAct.setEnabled(False)
916 else: 1087 else:
917 self.dbgSetBpActGrp.setEnabled(False) 1088 self.dbgSetBpActGrp.setEnabled(False)
918 1089
919 def __cursorChanged(self, editor): 1090 def __cursorChanged(self, editor):
920 """ 1091 """
921 Private slot handling the cursorChanged signal of the viewmanager. 1092 Private slot handling the cursorChanged signal of the viewmanager.
922 1093
923 @param editor editor window 1094 @param editor editor window
924 """ 1095 """
925 if editor is None: 1096 if editor is None:
926 return 1097 return
927 1098
928 if editor.isPyFile() or editor.isRubyFile(): 1099 if editor.isPyFile() or editor.isRubyFile():
929 if editor.curLineHasBreakpoint(): 1100 if editor.curLineHasBreakpoint():
930 self.dbgEditBpAct.setEnabled(True) 1101 self.dbgEditBpAct.setEnabled(True)
931 else: 1102 else:
932 self.dbgEditBpAct.setEnabled(False) 1103 self.dbgEditBpAct.setEnabled(False)
934 self.dbgNextBpAct.setEnabled(True) 1105 self.dbgNextBpAct.setEnabled(True)
935 self.dbgPrevBpAct.setEnabled(True) 1106 self.dbgPrevBpAct.setEnabled(True)
936 else: 1107 else:
937 self.dbgNextBpAct.setEnabled(False) 1108 self.dbgNextBpAct.setEnabled(False)
938 self.dbgPrevBpAct.setEnabled(False) 1109 self.dbgPrevBpAct.setEnabled(False)
939 1110
940 def __projectOpened(self): 1111 def __projectOpened(self):
941 """ 1112 """
942 Private slot to handle the projectOpened signal. 1113 Private slot to handle the projectOpened signal.
943 """ 1114 """
944 self.projectOpen = True 1115 self.projectOpen = True
945 cap = self.debugServer.getClientCapabilities( 1116 cap = self.debugServer.getClientCapabilities(self.project.getProjectLanguage())
946 self.project.getProjectLanguage())
947 if not self.passive: 1117 if not self.passive:
948 self.debugProjectAct.setEnabled(cap & HasDebugger) 1118 self.debugProjectAct.setEnabled(cap & HasDebugger)
949 self.runProjectAct.setEnabled(cap & HasInterpreter) 1119 self.runProjectAct.setEnabled(cap & HasInterpreter)
950 self.profileProjectAct.setEnabled(cap & HasProfiler) 1120 self.profileProjectAct.setEnabled(cap & HasProfiler)
951 self.coverageProjectAct.setEnabled(cap & HasCoverage) 1121 self.coverageProjectAct.setEnabled(cap & HasCoverage)
952 1122
953 def __projectClosed(self): 1123 def __projectClosed(self):
954 """ 1124 """
955 Private slot to handle the projectClosed signal. 1125 Private slot to handle the projectClosed signal.
956 """ 1126 """
957 self.projectOpen = False 1127 self.projectOpen = False
958 self.runProjectAct.setEnabled(False) 1128 self.runProjectAct.setEnabled(False)
959 self.profileProjectAct.setEnabled(False) 1129 self.profileProjectAct.setEnabled(False)
960 self.coverageProjectAct.setEnabled(False) 1130 self.coverageProjectAct.setEnabled(False)
961 self.debugProjectAct.setEnabled(False) 1131 self.debugProjectAct.setEnabled(False)
962 1132
963 if not self.editorOpen: 1133 if not self.editorOpen:
964 self.restartAct.setEnabled(False) 1134 self.restartAct.setEnabled(False)
965 self.lastDebuggedFile = None 1135 self.lastDebuggedFile = None
966 self.lastStartAction = 0 1136 self.lastStartAction = 0
967 self.clientType = "" 1137 self.clientType = ""
968 1138
969 def clearHistories(self): 1139 def clearHistories(self):
970 """ 1140 """
971 Public method to clear the various debug histories. 1141 Public method to clear the various debug histories.
972 """ 1142 """
973 self.scriptsHistory = [] 1143 self.scriptsHistory = []
974 self.argvHistory = [] 1144 self.argvHistory = []
975 self.wdHistory = [] 1145 self.wdHistory = []
976 self.envHistory = [] 1146 self.envHistory = []
977 self.multiprocessNoDebugHistory = [] 1147 self.multiprocessNoDebugHistory = []
978 1148
979 Preferences.getSettings().setValue( 1149 Preferences.getSettings().setValue(
980 'DebugInfo/ScriptsHistory', self.scriptsHistory) 1150 "DebugInfo/ScriptsHistory", self.scriptsHistory
1151 )
981 Preferences.getSettings().setValue( 1152 Preferences.getSettings().setValue(
982 'DebugInfo/ArgumentsHistory', self.argvHistory) 1153 "DebugInfo/ArgumentsHistory", self.argvHistory
1154 )
983 Preferences.getSettings().setValue( 1155 Preferences.getSettings().setValue(
984 'DebugInfo/WorkingDirectoryHistory', self.wdHistory) 1156 "DebugInfo/WorkingDirectoryHistory", self.wdHistory
1157 )
985 Preferences.getSettings().setValue( 1158 Preferences.getSettings().setValue(
986 'DebugInfo/EnvironmentHistory', self.envHistory) 1159 "DebugInfo/EnvironmentHistory", self.envHistory
1160 )
987 Preferences.getSettings().setValue( 1161 Preferences.getSettings().setValue(
988 'DebugInfo/MultiprocessNoDebugHistory', 1162 "DebugInfo/MultiprocessNoDebugHistory", self.multiprocessNoDebugHistory
989 self.multiprocessNoDebugHistory) 1163 )
990 1164
991 self.debugViewer.breakpointViewer.clearHistories() 1165 self.debugViewer.breakpointViewer.clearHistories()
992 1166
993 def shutdown(self): 1167 def shutdown(self):
994 """ 1168 """
995 Public method to perform shutdown actions. 1169 Public method to perform shutdown actions.
996 """ 1170 """
997 # Just save the 10 most recent entries 1171 # Just save the 10 most recent entries
998 del self.scriptsHistory[10:] 1172 del self.scriptsHistory[10:]
999 del self.argvHistory[10:] 1173 del self.argvHistory[10:]
1000 del self.wdHistory[10:] 1174 del self.wdHistory[10:]
1001 del self.envHistory[10:] 1175 del self.envHistory[10:]
1002 1176
1003 Preferences.getSettings().setValue( 1177 Preferences.getSettings().setValue(
1004 'DebugInfo/VirtualEnvironment', self.lastUsedVenvName) 1178 "DebugInfo/VirtualEnvironment", self.lastUsedVenvName
1179 )
1005 Preferences.getSettings().setValue( 1180 Preferences.getSettings().setValue(
1006 'DebugInfo/ScriptsHistory', self.scriptsHistory) 1181 "DebugInfo/ScriptsHistory", self.scriptsHistory
1182 )
1007 Preferences.getSettings().setValue( 1183 Preferences.getSettings().setValue(
1008 'DebugInfo/ArgumentsHistory', self.argvHistory) 1184 "DebugInfo/ArgumentsHistory", self.argvHistory
1185 )
1009 Preferences.getSettings().setValue( 1186 Preferences.getSettings().setValue(
1010 'DebugInfo/WorkingDirectoryHistory', self.wdHistory) 1187 "DebugInfo/WorkingDirectoryHistory", self.wdHistory
1188 )
1011 Preferences.getSettings().setValue( 1189 Preferences.getSettings().setValue(
1012 'DebugInfo/EnvironmentHistory', self.envHistory) 1190 "DebugInfo/EnvironmentHistory", self.envHistory
1191 )
1192 Preferences.getSettings().setValue("DebugInfo/Exceptions", self.excList)
1013 Preferences.getSettings().setValue( 1193 Preferences.getSettings().setValue(
1014 'DebugInfo/Exceptions', self.excList) 1194 "DebugInfo/IgnoredExceptions", self.excIgnoreList
1195 )
1015 Preferences.getSettings().setValue( 1196 Preferences.getSettings().setValue(
1016 'DebugInfo/IgnoredExceptions', self.excIgnoreList) 1197 "DebugInfo/ReportExceptions", self.exceptions
1198 )
1017 Preferences.getSettings().setValue( 1199 Preferences.getSettings().setValue(
1018 'DebugInfo/ReportExceptions', self.exceptions) 1200 "DebugInfo/AutoClearShell", self.autoClearShell
1201 )
1202 Preferences.getSettings().setValue("DebugInfo/TracePython", self.tracePython)
1203 Preferences.getSettings().setValue("DebugInfo/AutoContinue", self.autoContinue)
1019 Preferences.getSettings().setValue( 1204 Preferences.getSettings().setValue(
1020 'DebugInfo/AutoClearShell', self.autoClearShell) 1205 "DebugInfo/EnableMultiprocess", self.enableMultiprocess
1206 )
1021 Preferences.getSettings().setValue( 1207 Preferences.getSettings().setValue(
1022 'DebugInfo/TracePython', self.tracePython) 1208 "DebugInfo/MultiprocessNoDebugHistory", self.multiprocessNoDebugHistory
1209 )
1023 Preferences.getSettings().setValue( 1210 Preferences.getSettings().setValue(
1024 'DebugInfo/AutoContinue', self.autoContinue) 1211 "DebugInfo/OverrideGlobal", self.overrideGlobalConfig["enable"]
1212 )
1025 Preferences.getSettings().setValue( 1213 Preferences.getSettings().setValue(
1026 'DebugInfo/EnableMultiprocess', self.enableMultiprocess) 1214 "DebugInfo/RedirectStdinStdout", self.overrideGlobalConfig["redirect"]
1027 Preferences.getSettings().setValue( 1215 )
1028 'DebugInfo/MultiprocessNoDebugHistory', 1216
1029 self.multiprocessNoDebugHistory)
1030 Preferences.getSettings().setValue(
1031 'DebugInfo/OverrideGlobal',
1032 self.overrideGlobalConfig["enable"])
1033 Preferences.getSettings().setValue(
1034 'DebugInfo/RedirectStdinStdout',
1035 self.overrideGlobalConfig["redirect"])
1036
1037 def shutdownServer(self): 1217 def shutdownServer(self):
1038 """ 1218 """
1039 Public method to shut down the debug server. 1219 Public method to shut down the debug server.
1040 1220
1041 This is needed to cleanly close the sockets on Win OS. 1221 This is needed to cleanly close the sockets on Win OS.
1042 1222
1043 @return always true 1223 @return always true
1044 """ 1224 """
1045 self.debugServer.shutdownServer() 1225 self.debugServer.shutdownServer()
1046 return True 1226 return True
1047 1227
1048 def __resetUI(self, fullReset=True): 1228 def __resetUI(self, fullReset=True):
1049 """ 1229 """
1050 Private slot to reset the user interface. 1230 Private slot to reset the user interface.
1051 1231
1052 @param fullReset flag indicating a full reset is required 1232 @param fullReset flag indicating a full reset is required
1053 @type bool 1233 @type bool
1054 """ 1234 """
1055 self.lastAction = -1 1235 self.lastAction = -1
1056 self.debugActGrp.setEnabled(False) 1236 self.debugActGrp.setEnabled(False)
1057 self.__clientDebuggerIds.clear() 1237 self.__clientDebuggerIds.clear()
1058 1238
1059 if not self.passive: 1239 if not self.passive:
1060 if self.editorOpen: 1240 if self.editorOpen:
1061 editor = self.viewmanager.activeWindow() 1241 editor = self.viewmanager.activeWindow()
1062 else: 1242 else:
1063 editor = None 1243 editor = None
1064 self.__checkActions(editor) 1244 self.__checkActions(editor)
1065 1245
1066 self.debugProjectAct.setEnabled(self.projectOpen) 1246 self.debugProjectAct.setEnabled(self.projectOpen)
1067 self.runProjectAct.setEnabled(self.projectOpen) 1247 self.runProjectAct.setEnabled(self.projectOpen)
1068 self.profileProjectAct.setEnabled(self.projectOpen) 1248 self.profileProjectAct.setEnabled(self.projectOpen)
1069 self.coverageProjectAct.setEnabled(self.projectOpen) 1249 self.coverageProjectAct.setEnabled(self.projectOpen)
1070 if ( 1250 if self.lastDebuggedFile is not None and (
1071 self.lastDebuggedFile is not None and 1251 self.editorOpen or self.projectOpen
1072 (self.editorOpen or self.projectOpen)
1073 ): 1252 ):
1074 self.restartAct.setEnabled(True) 1253 self.restartAct.setEnabled(True)
1075 else: 1254 else:
1076 self.restartAct.setEnabled(False) 1255 self.restartAct.setEnabled(False)
1077 self.stopAct.setEnabled(False) 1256 self.stopAct.setEnabled(False)
1078 1257
1079 self.resetUI.emit(fullReset) 1258 self.resetUI.emit(fullReset)
1080 1259
1081 def __clientDebuggerId(self, debuggerId): 1260 def __clientDebuggerId(self, debuggerId):
1082 """ 1261 """
1083 Private slot to track the list of connected debuggers. 1262 Private slot to track the list of connected debuggers.
1084 1263
1085 @param debuggerId ID of the debugger backend 1264 @param debuggerId ID of the debugger backend
1086 @type str 1265 @type str
1087 """ 1266 """
1088 self.__clientDebuggerIds.add(debuggerId) 1267 self.__clientDebuggerIds.add(debuggerId)
1089 1268
1090 def __clientLine(self, fn, line, debuggerId, threadName, forStack): 1269 def __clientLine(self, fn, line, debuggerId, threadName, forStack):
1091 """ 1270 """
1092 Private method to handle a change to the current line. 1271 Private method to handle a change to the current line.
1093 1272
1094 @param fn filename 1273 @param fn filename
1095 @type str 1274 @type str
1096 @param line linenumber 1275 @param line linenumber
1097 @type int 1276 @type int
1098 @param debuggerId ID of the debugger backend 1277 @param debuggerId ID of the debugger backend
1110 if not forStack: 1289 if not forStack:
1111 self.__getThreadList(debuggerId) 1290 self.__getThreadList(debuggerId)
1112 self.__getClientVariables(debuggerId) 1291 self.__getClientVariables(debuggerId)
1113 1292
1114 self.debugActGrp.setEnabled(True) 1293 self.debugActGrp.setEnabled(True)
1115 1294
1116 @pyqtSlot(str) 1295 @pyqtSlot(str)
1117 def __clientDisconnected(self, debuggerId): 1296 def __clientDisconnected(self, debuggerId):
1118 """ 1297 """
1119 Private slot to handle a debug client disconnecting its control 1298 Private slot to handle a debug client disconnecting its control
1120 socket. 1299 socket.
1121 1300
1122 @param debuggerId ID of the debugger backend 1301 @param debuggerId ID of the debugger backend
1123 @type str 1302 @type str
1124 """ 1303 """
1125 self.__clientDebuggerIds.discard(debuggerId) 1304 self.__clientDebuggerIds.discard(debuggerId)
1126 1305
1127 if len(self.__clientDebuggerIds) == 0: 1306 if len(self.__clientDebuggerIds) == 0:
1128 self.viewmanager.exit() 1307 self.viewmanager.exit()
1129 self.__resetUI(fullReset=False) 1308 self.__resetUI(fullReset=False)
1130 1309
1131 @pyqtSlot(str, int, str, bool, str) 1310 @pyqtSlot(str, int, str, bool, str)
1132 def __clientExit(self, program, status, message, quiet, debuggerId): 1311 def __clientExit(self, program, status, message, quiet, debuggerId):
1133 """ 1312 """
1134 Private slot to handle the debugged program terminating. 1313 Private slot to handle the debugged program terminating.
1135 1314
1136 @param program name of the exited program 1315 @param program name of the exited program
1137 @type str 1316 @type str
1138 @param status exit code of the debugged program 1317 @param status exit code of the debugged program
1139 @type int 1318 @type int
1140 @param message exit message of the debugged program 1319 @param message exit message of the debugged program
1143 @type bool 1322 @type bool
1144 @param debuggerId ID of the debugger backend 1323 @param debuggerId ID of the debugger backend
1145 @type str 1324 @type str
1146 """ 1325 """
1147 self.__clientDisconnected(debuggerId) 1326 self.__clientDisconnected(debuggerId)
1148 1327
1149 if not quiet: 1328 if not quiet:
1150 if not program: 1329 if not program:
1151 program = self.ui.currentProg 1330 program = self.ui.currentProg
1152 1331
1153 if message: 1332 if message:
1154 info = self.tr("Message: {0}").format( 1333 info = self.tr("Message: {0}").format(Utilities.html_uencode(message))
1155 Utilities.html_uencode(message))
1156 else: 1334 else:
1157 info = "" 1335 info = ""
1158 if program is None: 1336 if program is None:
1159 msg = self.tr( 1337 msg = self.tr(
1160 '<p>The program has terminated with an exit status of' 1338 "<p>The program has terminated with an exit status of"
1161 ' {0}.</p><p>{1}</p>').format(status, info) 1339 " {0}.</p><p>{1}</p>"
1340 ).format(status, info)
1162 else: 1341 else:
1163 msg = self.tr( 1342 msg = self.tr(
1164 '<p><b>{0}</b> has terminated with an exit status of' 1343 "<p><b>{0}</b> has terminated with an exit status of"
1165 ' {1}.</p><p>{2}</p>').format( 1344 " {1}.</p><p>{2}</p>"
1166 os.path.basename(program), status, info) 1345 ).format(os.path.basename(program), status, info)
1167 if status != 0: 1346 if status != 0:
1168 timeout = 0 1347 timeout = 0
1169 kind = NotificationTypes.WARNING 1348 kind = NotificationTypes.WARNING
1170 else: 1349 else:
1171 timeout = None 1350 timeout = None
1172 kind = NotificationTypes.INFORMATION 1351 kind = NotificationTypes.INFORMATION
1173 self.ui.showNotification( 1352 self.ui.showNotification(
1174 UI.PixmapCache.getPixmap("debug48"), 1353 UI.PixmapCache.getPixmap("debug48"),
1175 self.tr("Program terminated"), msg, kind=kind, 1354 self.tr("Program terminated"),
1176 timeout=timeout) 1355 msg,
1177 1356 kind=kind,
1357 timeout=timeout,
1358 )
1359
1178 def __lastClientExited(self): 1360 def __lastClientExited(self):
1179 """ 1361 """
1180 Private slot handling the exit of the last client. 1362 Private slot handling the exit of the last client.
1181 """ 1363 """
1182 self.viewmanager.exit() 1364 self.viewmanager.exit()
1183 self.__resetUI() 1365 self.__resetUI()
1184 1366
1185 def __clientSyntaxError(self, message, filename, lineNo, characterNo): 1367 def __clientSyntaxError(self, message, filename, lineNo, characterNo):
1186 """ 1368 """
1187 Private method to handle a syntax error in the debugged program. 1369 Private method to handle a syntax error in the debugged program.
1188 1370
1189 @param message message of the syntax error (string) 1371 @param message message of the syntax error (string)
1190 @param filename translated filename of the syntax error position 1372 @param filename translated filename of the syntax error position
1191 (string) 1373 (string)
1192 @param lineNo line number of the syntax error position (integer) 1374 @param lineNo line number of the syntax error position (integer)
1193 @param characterNo character number of the syntax error position 1375 @param characterNo character number of the syntax error position
1194 (integer) 1376 (integer)
1195 """ 1377 """
1196 self.__resetUI() 1378 self.__resetUI()
1197 self.ui.raise_() 1379 self.ui.raise_()
1198 self.ui.activateWindow() 1380 self.ui.activateWindow()
1199 1381
1200 if message is None: 1382 if message is None:
1201 EricMessageBox.critical( 1383 EricMessageBox.critical(
1202 self.ui, Program, 1384 self.ui,
1385 Program,
1203 self.tr( 1386 self.tr(
1204 'The program being debugged contains an unspecified' 1387 "The program being debugged contains an unspecified"
1205 ' syntax error.')) 1388 " syntax error."
1389 ),
1390 )
1206 return 1391 return
1207 1392
1208 if not os.path.isabs(filename): 1393 if not os.path.isabs(filename):
1209 if os.path.exists(os.path.join(self.project.getProjectPath(), 1394 if os.path.exists(os.path.join(self.project.getProjectPath(), filename)):
1210 filename)): 1395 filename = os.path.join(self.project.getProjectPath(), filename)
1211 filename = os.path.join(self.project.getProjectPath(),
1212 filename)
1213 else: 1396 else:
1214 ms = self.project.getMainScript(normalized=True) 1397 ms = self.project.getMainScript(normalized=True)
1215 if ms is not None: 1398 if ms is not None:
1216 d = os.path.dirname(ms) 1399 d = os.path.dirname(ms)
1217 if os.path.exists(os.path.join(d, filename)): 1400 if os.path.exists(os.path.join(d, filename)):
1218 filename = os.path.join(d, filename) 1401 filename = os.path.join(d, filename)
1219 self.viewmanager.setFileLine(filename, lineNo, True, True) 1402 self.viewmanager.setFileLine(filename, lineNo, True, True)
1220 EricMessageBox.critical( 1403 EricMessageBox.critical(
1221 self.ui, Program, 1404 self.ui,
1222 self.tr('<p>The file <b>{0}</b> contains the syntax error' 1405 Program,
1223 ' <b>{1}</b> at line <b>{2}</b>, character <b>{3}</b>.' 1406 self.tr(
1224 '</p>') 1407 "<p>The file <b>{0}</b> contains the syntax error"
1225 .format(filename, message, lineNo, characterNo)) 1408 " <b>{1}</b> at line <b>{2}</b>, character <b>{3}</b>."
1226 1409 "</p>"
1227 def __clientException(self, exceptionType, exceptionMessage, stackTrace, 1410 ).format(filename, message, lineNo, characterNo),
1228 debuggerId): 1411 )
1412
1413 def __clientException(
1414 self, exceptionType, exceptionMessage, stackTrace, debuggerId
1415 ):
1229 """ 1416 """
1230 Private method to handle an exception of the debugged program. 1417 Private method to handle an exception of the debugged program.
1231 1418
1232 @param exceptionType type of exception raised 1419 @param exceptionType type of exception raised
1233 @type str 1420 @type str
1234 @param exceptionMessage message given by the exception 1421 @param exceptionMessage message given by the exception
1235 @type (str 1422 @type (str
1236 @param stackTrace list of stack entries 1423 @param stackTrace list of stack entries
1240 """ 1427 """
1241 self.ui.raise_() 1428 self.ui.raise_()
1242 QApplication.processEvents() 1429 QApplication.processEvents()
1243 if not exceptionType: 1430 if not exceptionType:
1244 EricMessageBox.critical( 1431 EricMessageBox.critical(
1245 self.ui, Program, 1432 self.ui,
1246 self.tr('An unhandled exception occured.' 1433 Program,
1247 ' See the shell window for details.')) 1434 self.tr(
1435 "An unhandled exception occured."
1436 " See the shell window for details."
1437 ),
1438 )
1248 return 1439 return
1249 1440
1250 if ( 1441 if (
1251 (self.exceptions and 1442 self.exceptions
1252 exceptionType not in self.excIgnoreList and 1443 and exceptionType not in self.excIgnoreList
1253 (not len(self.excList) or 1444 and (
1254 (len(self.excList) and exceptionType in self.excList) 1445 not len(self.excList)
1255 ) 1446 or (len(self.excList) and exceptionType in self.excList)
1256 ) or exceptionType.startswith('unhandled') 1447 )
1257 ): 1448 ) or exceptionType.startswith("unhandled"):
1258 res = None 1449 res = None
1259 if stackTrace: 1450 if stackTrace:
1260 with contextlib.suppress(UnicodeError, OSError): 1451 with contextlib.suppress(UnicodeError, OSError):
1261 file, line = stackTrace[0][:2] 1452 file, line = stackTrace[0][:2]
1262 source, encoding = Utilities.readEncodedFile(file) 1453 source, encoding = Utilities.readEncodedFile(file)
1263 source = source.splitlines(True) 1454 source = source.splitlines(True)
1264 if len(source) >= line: 1455 if len(source) >= line:
1265 lineFlags = Utilities.extractLineFlags( 1456 lineFlags = Utilities.extractLineFlags(source[line - 1].strip())
1266 source[line - 1].strip())
1267 with contextlib.suppress(IndexError): 1457 with contextlib.suppress(IndexError):
1268 lineFlags += Utilities.extractLineFlags( 1458 lineFlags += Utilities.extractLineFlags(
1269 source[line].strip(), flagsLine=True) 1459 source[line].strip(), flagsLine=True
1460 )
1270 if "__IGNORE_EXCEPTION__" in lineFlags: 1461 if "__IGNORE_EXCEPTION__" in lineFlags:
1271 res = EricMessageBox.No 1462 res = EricMessageBox.No
1272 if res != EricMessageBox.No: 1463 if res != EricMessageBox.No:
1273 self.viewmanager.setFileLine( 1464 self.viewmanager.setFileLine(
1274 stackTrace[0][0], stackTrace[0][1], True) 1465 stackTrace[0][0], stackTrace[0][1], True
1466 )
1275 if res != EricMessageBox.No: 1467 if res != EricMessageBox.No:
1276 self.ui.activateWindow() 1468 self.ui.activateWindow()
1277 if Preferences.getDebugger("BreakAlways"): 1469 if Preferences.getDebugger("BreakAlways"):
1278 res = EricMessageBox.Yes 1470 res = EricMessageBox.Yes
1279 else: 1471 else:
1280 if stackTrace: 1472 if stackTrace:
1281 if exceptionType.startswith('unhandled'): 1473 if exceptionType.startswith("unhandled"):
1282 buttons = EricMessageBox.No | EricMessageBox.Yes 1474 buttons = EricMessageBox.No | EricMessageBox.Yes
1283 else: 1475 else:
1284 buttons = (EricMessageBox.No | 1476 buttons = (
1285 EricMessageBox.Yes | 1477 EricMessageBox.No
1286 EricMessageBox.Ignore) 1478 | EricMessageBox.Yes
1479 | EricMessageBox.Ignore
1480 )
1287 res = EricMessageBox.critical( 1481 res = EricMessageBox.critical(
1288 self.ui, Program, 1482 self.ui,
1483 Program,
1289 self.tr( 1484 self.tr(
1290 '<p>The debugged program raised the exception' 1485 "<p>The debugged program raised the exception"
1291 ' <b>{0}</b><br>"<b>{1}</b>"<br>' 1486 ' <b>{0}</b><br>"<b>{1}</b>"<br>'
1292 'File: <b>{2}</b>, Line: <b>{3}</b></p>' 1487 "File: <b>{2}</b>, Line: <b>{3}</b></p>"
1293 '<p>Break here?</p>') 1488 "<p>Break here?</p>"
1294 .format( 1489 ).format(
1295 exceptionType, 1490 exceptionType,
1296 Utilities.html_encode(exceptionMessage), 1491 Utilities.html_encode(exceptionMessage),
1297 stackTrace[0][0], 1492 stackTrace[0][0],
1298 stackTrace[0][1]), 1493 stackTrace[0][1],
1494 ),
1299 buttons, 1495 buttons,
1300 EricMessageBox.No) 1496 EricMessageBox.No,
1497 )
1301 else: 1498 else:
1302 res = EricMessageBox.critical( 1499 res = EricMessageBox.critical(
1303 self.ui, Program, 1500 self.ui,
1501 Program,
1304 self.tr( 1502 self.tr(
1305 '<p>The debugged program raised the exception' 1503 "<p>The debugged program raised the exception"
1306 ' <b>{0}</b><br>"<b>{1}</b>"</p>') 1504 ' <b>{0}</b><br>"<b>{1}</b>"</p>'
1307 .format( 1505 ).format(
1308 exceptionType, 1506 exceptionType, Utilities.html_encode(exceptionMessage)
1309 Utilities.html_encode(exceptionMessage))) 1507 ),
1508 )
1310 if res == EricMessageBox.Yes: 1509 if res == EricMessageBox.Yes:
1311 self.debugServer.setDebugging(True) 1510 self.debugServer.setDebugging(True)
1312 self.exceptionInterrupt.emit() 1511 self.exceptionInterrupt.emit()
1313 stack = [] 1512 stack = []
1314 for fn, ln, func, args in stackTrace: 1513 for fn, ln, func, args in stackTrace:
1318 self.__getClientDisassembly(debuggerId) 1517 self.__getClientDisassembly(debuggerId)
1319 self.ui.setDebugProfile() 1518 self.ui.setDebugProfile()
1320 self.debugActGrp.setEnabled(True) 1519 self.debugActGrp.setEnabled(True)
1321 return 1520 return
1322 elif ( 1521 elif (
1323 res == EricMessageBox.Ignore and 1522 res == EricMessageBox.Ignore and exceptionType not in self.excIgnoreList
1324 exceptionType not in self.excIgnoreList
1325 ): 1523 ):
1326 self.excIgnoreList.append(exceptionType) 1524 self.excIgnoreList.append(exceptionType)
1327 1525
1328 if self.lastAction != -1: 1526 if self.lastAction != -1:
1329 if self.lastAction == 2: 1527 if self.lastAction == 2:
1330 self.__specialContinue(debuggerId) 1528 self.__specialContinue(debuggerId)
1331 else: 1529 else:
1332 self.debugActions[self.lastAction](debuggerId) 1530 self.debugActions[self.lastAction](debuggerId)
1333 else: 1531 else:
1334 self.__continue(debuggerId) 1532 self.__continue(debuggerId)
1335 1533
1336 def __clientSignal(self, message, filename, lineNo, funcName, funcArgs, 1534 def __clientSignal(self, message, filename, lineNo, funcName, funcArgs, debuggerId):
1337 debuggerId):
1338 """ 1535 """
1339 Private method to handle a signal generated on the client side. 1536 Private method to handle a signal generated on the client side.
1340 1537
1341 @param message message of the syntax error 1538 @param message message of the syntax error
1342 @type str 1539 @type str
1343 @param filename translated filename of the syntax error position 1540 @param filename translated filename of the syntax error position
1344 @type str 1541 @type str
1345 @param lineNo line number of the syntax error position 1542 @param lineNo line number of the syntax error position
1354 self.ui.raise_() 1551 self.ui.raise_()
1355 self.ui.activateWindow() 1552 self.ui.activateWindow()
1356 QApplication.processEvents() 1553 QApplication.processEvents()
1357 self.viewmanager.setFileLine(filename, lineNo, True) 1554 self.viewmanager.setFileLine(filename, lineNo, True)
1358 EricMessageBox.critical( 1555 EricMessageBox.critical(
1359 self.ui, Program, 1556 self.ui,
1360 self.tr("""<p>The program generate the signal "{0}".<br/>""" 1557 Program,
1361 """File: <b>{1}</b>, Line: <b>{2}</b></p>""").format( 1558 self.tr(
1362 message, filename, lineNo)) 1559 """<p>The program generate the signal "{0}".<br/>"""
1363 1560 """File: <b>{1}</b>, Line: <b>{2}</b></p>"""
1561 ).format(message, filename, lineNo),
1562 )
1563
1364 def __clientGone(self, unplanned): 1564 def __clientGone(self, unplanned):
1365 """ 1565 """
1366 Private method to handle the disconnection of the debugger client. 1566 Private method to handle the disconnection of the debugger client.
1367 1567
1368 @param unplanned True if the client died, False otherwise 1568 @param unplanned True if the client died, False otherwise
1369 """ 1569 """
1370 self.__resetUI() 1570 self.__resetUI()
1371 if unplanned: 1571 if unplanned:
1372 EricMessageBox.information( 1572 EricMessageBox.information(
1373 self.ui, Program, 1573 self.ui,
1374 self.tr('The program being debugged has terminated' 1574 Program,
1375 ' unexpectedly.')) 1575 self.tr("The program being debugged has terminated" " unexpectedly."),
1376 1576 )
1577
1377 def __getThreadList(self, debuggerId): 1578 def __getThreadList(self, debuggerId):
1378 """ 1579 """
1379 Private method to get the list of threads from the client. 1580 Private method to get the list of threads from the client.
1380 1581
1381 @param debuggerId ID of the debugger backend 1582 @param debuggerId ID of the debugger backend
1382 @type str 1583 @type str
1383 """ 1584 """
1384 self.debugServer.remoteThreadList(debuggerId) 1585 self.debugServer.remoteThreadList(debuggerId)
1385 1586
1386 def __clientThreadSet(self, debuggerId): 1587 def __clientThreadSet(self, debuggerId):
1387 """ 1588 """
1388 Private method to handle a change of the client's current thread. 1589 Private method to handle a change of the client's current thread.
1389 1590
1390 @param debuggerId ID of the debugger backend 1591 @param debuggerId ID of the debugger backend
1391 @type str 1592 @type str
1392 """ 1593 """
1393 if self.debugServer.isDebugging(): 1594 if self.debugServer.isDebugging():
1394 self.debugServer.remoteClientVariables( 1595 self.debugServer.remoteClientVariables(
1395 debuggerId, 0, self.__localsVarFilterList) 1596 debuggerId, 0, self.__localsVarFilterList
1396 1597 )
1598
1397 def __getClientVariables(self, debuggerId): 1599 def __getClientVariables(self, debuggerId):
1398 """ 1600 """
1399 Private method to request the global and local variables. 1601 Private method to request the global and local variables.
1400 1602
1401 In the first step, the global variables are requested from the client. 1603 In the first step, the global variables are requested from the client.
1402 Once these have been received, the local variables are requested. 1604 Once these have been received, the local variables are requested.
1403 This happens in the method '__clientVariables'. 1605 This happens in the method '__clientVariables'.
1404 1606
1405 @param debuggerId ID of the debugger backend 1607 @param debuggerId ID of the debugger backend
1406 @type str 1608 @type str
1407 """ 1609 """
1408 # get globals first 1610 # get globals first
1409 self.debugServer.remoteClientVariables( 1611 self.debugServer.remoteClientVariables(
1410 debuggerId, 1, self.__globalsVarFilterList) 1612 debuggerId, 1, self.__globalsVarFilterList
1613 )
1411 # the local variables are requested once we have received the globals 1614 # the local variables are requested once we have received the globals
1412 1615
1413 def __clientVariables(self, scope, variables, debuggerId): 1616 def __clientVariables(self, scope, variables, debuggerId):
1414 """ 1617 """
1415 Private method to write the clients variables to the user interface. 1618 Private method to write the clients variables to the user interface.
1416 1619
1417 @param scope scope of the variables 1620 @param scope scope of the variables
1418 (-2 = no frame found, -1 = empty locals, 1 = global, 0 = local) 1621 (-2 = no frame found, -1 = empty locals, 1 = global, 0 = local)
1419 @type int 1622 @type int
1420 @param variables the list of variables from the client 1623 @param variables the list of variables from the client
1421 @type list 1624 @type list
1427 if scope > 0: 1630 if scope > 0:
1428 self.debugViewer.showVariables(variables, True) 1631 self.debugViewer.showVariables(variables, True)
1429 if scope == 1: 1632 if scope == 1:
1430 # now get the local variables 1633 # now get the local variables
1431 self.debugServer.remoteClientVariables( 1634 self.debugServer.remoteClientVariables(
1432 self.getSelectedDebuggerId(), 1635 self.getSelectedDebuggerId(), 0, self.__localsVarFilterList
1433 0, self.__localsVarFilterList) 1636 )
1434 elif scope == 0: 1637 elif scope == 0:
1435 self.debugViewer.showVariables(variables, False) 1638 self.debugViewer.showVariables(variables, False)
1436 elif scope == -1: 1639 elif scope == -1:
1437 vlist = [ 1640 vlist = [(self.tr("No locals available."), "", "", False, -2, "")]
1438 (self.tr('No locals available.'), '', '', False, -2, '')
1439 ]
1440 self.debugViewer.showVariables(vlist, False) 1641 self.debugViewer.showVariables(vlist, False)
1441 1642
1442 def __clientVariable(self, scope, variables, debuggerId): 1643 def __clientVariable(self, scope, variables, debuggerId):
1443 """ 1644 """
1444 Private method to write the contents of a clients classvariable to 1645 Private method to write the contents of a clients classvariable to
1445 the user interface. 1646 the user interface.
1446 1647
1447 @param scope scope of the variables (-1 = empty locals, 1 = global, 1648 @param scope scope of the variables (-1 = empty locals, 1 = global,
1448 0 = local) 1649 0 = local)
1449 @type int 1650 @type int
1450 @param variables the list of variables from the client 1651 @param variables the list of variables from the client
1451 @type list 1652 @type list
1456 self.ui.activateDebugViewer() 1657 self.ui.activateDebugViewer()
1457 if scope == 1: 1658 if scope == 1:
1458 self.debugViewer.showVariable(variables, True) 1659 self.debugViewer.showVariable(variables, True)
1459 elif scope == 0: 1660 elif scope == 0:
1460 self.debugViewer.showVariable(variables, False) 1661 self.debugViewer.showVariable(variables, False)
1461 1662
1462 def __getClientDisassembly(self, debuggerId): 1663 def __getClientDisassembly(self, debuggerId):
1463 """ 1664 """
1464 Private method to ask the client for the latest traceback disassembly. 1665 Private method to ask the client for the latest traceback disassembly.
1465 1666
1466 @param debuggerId ID of the debugger backend 1667 @param debuggerId ID of the debugger backend
1467 @type str 1668 @type str
1468 """ 1669 """
1469 self.debugServer.remoteClientDisassembly(debuggerId) 1670 self.debugServer.remoteClientDisassembly(debuggerId)
1470 1671
1471 def __clientBreakConditionError(self, filename, lineno, debuggerId): 1672 def __clientBreakConditionError(self, filename, lineno, debuggerId):
1472 """ 1673 """
1473 Private method to handle a condition error of a breakpoint. 1674 Private method to handle a condition error of a breakpoint.
1474 1675
1475 @param filename filename of the breakpoint 1676 @param filename filename of the breakpoint
1476 @type str 1677 @type str
1477 @param lineno line umber of the breakpoint 1678 @param lineno line umber of the breakpoint
1478 @type int 1679 @type int
1479 @param debuggerId ID of the debugger backend 1680 @param debuggerId ID of the debugger backend
1482 EricMessageBox.critical( 1683 EricMessageBox.critical(
1483 self.ui, 1684 self.ui,
1484 self.tr("Breakpoint Condition Error"), 1685 self.tr("Breakpoint Condition Error"),
1485 self.tr( 1686 self.tr(
1486 """<p>The condition of the breakpoint <b>{0}, {1}</b>""" 1687 """<p>The condition of the breakpoint <b>{0}, {1}</b>"""
1487 """ contains a syntax error.</p>""") 1688 """ contains a syntax error.</p>"""
1488 .format(filename, lineno)) 1689 ).format(filename, lineno),
1489 1690 )
1691
1490 model = self.debugServer.getBreakPointModel() 1692 model = self.debugServer.getBreakPointModel()
1491 index = model.getBreakPointIndex(filename, lineno) 1693 index = model.getBreakPointIndex(filename, lineno)
1492 if not index.isValid(): 1694 if not index.isValid():
1493 return 1695 return
1494 1696
1495 bp = model.getBreakPointByIndex(index) 1697 bp = model.getBreakPointByIndex(index)
1496 if not bp: 1698 if not bp:
1497 return 1699 return
1498 1700
1499 fn, line, cond, temp, enabled, count = bp[:6] 1701 fn, line, cond, temp, enabled, count = bp[:6]
1500 1702
1501 # get recently used breakpoint conditions 1703 # get recently used breakpoint conditions
1502 rs = Preferences.Prefs.rsettings.value( 1704 rs = Preferences.Prefs.rsettings.value(recentNameBreakpointConditions)
1503 recentNameBreakpointConditions)
1504 condHistory = ( 1705 condHistory = (
1505 Preferences.toList(rs)[ 1706 Preferences.toList(rs)[: Preferences.getDebugger("RecentNumber")]
1506 :Preferences.getDebugger("RecentNumber")] 1707 if rs is not None
1507 if rs is not None else 1708 else []
1508 [] 1709 )
1509 ) 1710
1510
1511 from .EditBreakpointDialog import EditBreakpointDialog 1711 from .EditBreakpointDialog import EditBreakpointDialog
1712
1512 dlg = EditBreakpointDialog( 1713 dlg = EditBreakpointDialog(
1513 (fn, line), (cond, temp, enabled, count), 1714 (fn, line), (cond, temp, enabled, count), condHistory, self.ui, modal=True
1514 condHistory, self.ui, modal=True) 1715 )
1515 if dlg.exec() == QDialog.DialogCode.Accepted: 1716 if dlg.exec() == QDialog.DialogCode.Accepted:
1516 cond, temp, enabled, count = dlg.getData() 1717 cond, temp, enabled, count = dlg.getData()
1517 model.setBreakPointByIndex(index, fn, line, 1718 model.setBreakPointByIndex(index, fn, line, (cond, temp, enabled, count))
1518 (cond, temp, enabled, count)) 1719
1519
1520 if cond: 1720 if cond:
1521 # save the recently used breakpoint condition 1721 # save the recently used breakpoint condition
1522 if cond in condHistory: 1722 if cond in condHistory:
1523 condHistory.remove(cond) 1723 condHistory.remove(cond)
1524 condHistory.insert(0, cond) 1724 condHistory.insert(0, cond)
1525 Preferences.Prefs.rsettings.setValue( 1725 Preferences.Prefs.rsettings.setValue(
1526 recentNameBreakpointConditions, condHistory) 1726 recentNameBreakpointConditions, condHistory
1727 )
1527 Preferences.Prefs.rsettings.sync() 1728 Preferences.Prefs.rsettings.sync()
1528 1729
1529 def __clientWatchConditionError(self, cond, debuggerId): 1730 def __clientWatchConditionError(self, cond, debuggerId):
1530 """ 1731 """
1531 Private method to handle a expression error of a watch expression. 1732 Private method to handle a expression error of a watch expression.
1532 1733
1533 Note: This can only happen for normal watch expressions 1734 Note: This can only happen for normal watch expressions
1534 1735
1535 @param cond expression of the watch expression 1736 @param cond expression of the watch expression
1536 @type str 1737 @type str
1537 @param debuggerId ID of the debugger backend 1738 @param debuggerId ID of the debugger backend
1538 @type str 1739 @type str
1539 """ 1740 """
1540 EricMessageBox.critical( 1741 EricMessageBox.critical(
1541 self.ui, 1742 self.ui,
1542 self.tr("Watch Expression Error"), 1743 self.tr("Watch Expression Error"),
1543 self.tr("""<p>The watch expression <b>{0}</b>""" 1744 self.tr(
1544 """ contains a syntax error.</p>""") 1745 """<p>The watch expression <b>{0}</b>"""
1545 .format(cond)) 1746 """ contains a syntax error.</p>"""
1546 1747 ).format(cond),
1748 )
1749
1547 model = self.debugServer.getWatchPointModel() 1750 model = self.debugServer.getWatchPointModel()
1548 index = model.getWatchPointIndex(cond) 1751 index = model.getWatchPointIndex(cond)
1549 if not index.isValid(): 1752 if not index.isValid():
1550 return 1753 return
1551 1754
1552 wp = model.getWatchPointByIndex(index) 1755 wp = model.getWatchPointByIndex(index)
1553 if not wp: 1756 if not wp:
1554 return 1757 return
1555 1758
1556 cond, special, temp, enabled, count = wp[:5] 1759 cond, special, temp, enabled, count = wp[:5]
1557 1760
1558 from .EditWatchpointDialog import EditWatchpointDialog 1761 from .EditWatchpointDialog import EditWatchpointDialog
1559 dlg = EditWatchpointDialog( 1762
1560 (cond, temp, enabled, count, special), self.ui) 1763 dlg = EditWatchpointDialog((cond, temp, enabled, count, special), self.ui)
1561 if dlg.exec() == QDialog.DialogCode.Accepted: 1764 if dlg.exec() == QDialog.DialogCode.Accepted:
1562 cond, temp, enabled, count, special = dlg.getData() 1765 cond, temp, enabled, count, special = dlg.getData()
1563 1766
1564 # check for duplicates 1767 # check for duplicates
1565 idx = model.getWatchPointIndex(cond, special) 1768 idx = model.getWatchPointIndex(cond, special)
1566 duplicate = (idx.isValid() and 1769 duplicate = (
1567 idx.internalPointer() != index.internalPointer()) 1770 idx.isValid() and idx.internalPointer() != index.internalPointer()
1771 )
1568 if duplicate: 1772 if duplicate:
1569 if not special: 1773 if not special:
1570 msg = self.tr( 1774 msg = self.tr(
1571 """<p>A watch expression '<b>{0}</b>'""" 1775 """<p>A watch expression '<b>{0}</b>'"""
1572 """ already exists.</p>""" 1776 """ already exists.</p>"""
1576 """<p>A watch expression '<b>{0}</b>'""" 1780 """<p>A watch expression '<b>{0}</b>'"""
1577 """ for the variable <b>{1}</b> already""" 1781 """ for the variable <b>{1}</b> already"""
1578 """ exists.</p>""" 1782 """ exists.</p>"""
1579 ).format(special, Utilities.html_encode(cond)) 1783 ).format(special, Utilities.html_encode(cond))
1580 EricMessageBox.warning( 1784 EricMessageBox.warning(
1581 self.ui, 1785 self.ui, self.tr("Watch expression already exists"), msg
1582 self.tr("Watch expression already exists"), 1786 )
1583 msg)
1584 model.deleteWatchPointByIndex(index) 1787 model.deleteWatchPointByIndex(index)
1585 else: 1788 else:
1586 model.setWatchPointByIndex(index, cond, special, 1789 model.setWatchPointByIndex(index, cond, special, (temp, enabled, count))
1587 (temp, enabled, count)) 1790
1588
1589 def __configureVariablesFilters(self): 1791 def __configureVariablesFilters(self):
1590 """ 1792 """
1591 Private slot for displaying the variables filter configuration dialog. 1793 Private slot for displaying the variables filter configuration dialog.
1592 """ 1794 """
1593 from .VariablesFilterDialog import VariablesFilterDialog 1795 from .VariablesFilterDialog import VariablesFilterDialog
1594 dlg = VariablesFilterDialog(self.ui, 'Filter Dialog', True) 1796
1595 dlg.setSelection(self.__localsVarFilterList, 1797 dlg = VariablesFilterDialog(self.ui, "Filter Dialog", True)
1596 self.__globalsVarFilterList) 1798 dlg.setSelection(self.__localsVarFilterList, self.__globalsVarFilterList)
1597 if dlg.exec() == QDialog.DialogCode.Accepted: 1799 if dlg.exec() == QDialog.DialogCode.Accepted:
1598 self.__localsVarFilterList, self.__globalsVarFilterList = ( 1800 self.__localsVarFilterList, self.__globalsVarFilterList = dlg.getSelection()
1599 dlg.getSelection()
1600 )
1601 self.debugViewer.setVariablesFilter( 1801 self.debugViewer.setVariablesFilter(
1602 self.__globalsVarFilterList, self.__localsVarFilterList) 1802 self.__globalsVarFilterList, self.__localsVarFilterList
1803 )
1603 1804
1604 def __configureExceptionsFilter(self): 1805 def __configureExceptionsFilter(self):
1605 """ 1806 """
1606 Private slot for displaying the exception filter dialog. 1807 Private slot for displaying the exception filter dialog.
1607 """ 1808 """
1608 from .ExceptionsFilterDialog import ExceptionsFilterDialog 1809 from .ExceptionsFilterDialog import ExceptionsFilterDialog
1810
1609 dlg = ExceptionsFilterDialog(self.excList, ignore=False) 1811 dlg = ExceptionsFilterDialog(self.excList, ignore=False)
1610 if dlg.exec() == QDialog.DialogCode.Accepted: 1812 if dlg.exec() == QDialog.DialogCode.Accepted:
1611 self.excList = dlg.getExceptionsList()[:] # keep a copy 1813 self.excList = dlg.getExceptionsList()[:] # keep a copy
1612 1814
1613 def __configureIgnoredExceptions(self): 1815 def __configureIgnoredExceptions(self):
1614 """ 1816 """
1615 Private slot for displaying the ignored exceptions dialog. 1817 Private slot for displaying the ignored exceptions dialog.
1616 """ 1818 """
1617 from .ExceptionsFilterDialog import ExceptionsFilterDialog 1819 from .ExceptionsFilterDialog import ExceptionsFilterDialog
1820
1618 dlg = ExceptionsFilterDialog(self.excIgnoreList, ignore=True) 1821 dlg = ExceptionsFilterDialog(self.excIgnoreList, ignore=True)
1619 if dlg.exec() == QDialog.DialogCode.Accepted: 1822 if dlg.exec() == QDialog.DialogCode.Accepted:
1620 self.excIgnoreList = dlg.getExceptionsList()[:] # keep a copy 1823 self.excIgnoreList = dlg.getExceptionsList()[:] # keep a copy
1621 1824
1622 def __toggleBreakpoint(self): 1825 def __toggleBreakpoint(self):
1623 """ 1826 """
1624 Private slot to handle the 'Set/Reset breakpoint' action. 1827 Private slot to handle the 'Set/Reset breakpoint' action.
1625 """ 1828 """
1626 self.viewmanager.activeWindow().menuToggleBreakpoint() 1829 self.viewmanager.activeWindow().menuToggleBreakpoint()
1627 1830
1628 def __editBreakpoint(self): 1831 def __editBreakpoint(self):
1629 """ 1832 """
1630 Private slot to handle the 'Edit breakpoint' action. 1833 Private slot to handle the 'Edit breakpoint' action.
1631 """ 1834 """
1632 self.viewmanager.activeWindow().menuEditBreakpoint() 1835 self.viewmanager.activeWindow().menuEditBreakpoint()
1633 1836
1634 def __nextBreakpoint(self): 1837 def __nextBreakpoint(self):
1635 """ 1838 """
1636 Private slot to handle the 'Next breakpoint' action. 1839 Private slot to handle the 'Next breakpoint' action.
1637 """ 1840 """
1638 self.viewmanager.activeWindow().menuNextBreakpoint() 1841 self.viewmanager.activeWindow().menuNextBreakpoint()
1639 1842
1640 def __previousBreakpoint(self): 1843 def __previousBreakpoint(self):
1641 """ 1844 """
1642 Private slot to handle the 'Previous breakpoint' action. 1845 Private slot to handle the 'Previous breakpoint' action.
1643 """ 1846 """
1644 self.viewmanager.activeWindow().menuPreviousBreakpoint() 1847 self.viewmanager.activeWindow().menuPreviousBreakpoint()
1645 1848
1646 def __clearBreakpoints(self): 1849 def __clearBreakpoints(self):
1647 """ 1850 """
1648 Private slot to handle the 'Clear breakpoints' action. 1851 Private slot to handle the 'Clear breakpoints' action.
1649 """ 1852 """
1650 self.debugServer.getBreakPointModel().deleteAll() 1853 self.debugServer.getBreakPointModel().deleteAll()
1651 1854
1652 def __showDebugMenu(self): 1855 def __showDebugMenu(self):
1653 """ 1856 """
1654 Private method to set up the debug menu. 1857 Private method to set up the debug menu.
1655 """ 1858 """
1656 bpCount = self.debugServer.getBreakPointModel().rowCount() 1859 bpCount = self.debugServer.getBreakPointModel().rowCount()
1657 self.menuBreakpointsAct.setEnabled(bpCount > 0) 1860 self.menuBreakpointsAct.setEnabled(bpCount > 0)
1658 1861
1659 def __showBreakpointsMenu(self): 1862 def __showBreakpointsMenu(self):
1660 """ 1863 """
1661 Private method to handle the show breakpoints menu signal. 1864 Private method to handle the show breakpoints menu signal.
1662 """ 1865 """
1663 self.breakpointsMenu.clear() 1866 self.breakpointsMenu.clear()
1664 1867
1665 model = self.debugServer.getBreakPointModel() 1868 model = self.debugServer.getBreakPointModel()
1666 for row in range(model.rowCount()): 1869 for row in range(model.rowCount()):
1667 index = model.index(row, 0) 1870 index = model.index(row, 0)
1668 filename, line, cond = model.getBreakPointByIndex(index)[:3] 1871 filename, line, cond = model.getBreakPointByIndex(index)[:3]
1669 formattedCond = " : {0}".format(cond[:20]) if cond else "" 1872 formattedCond = " : {0}".format(cond[:20]) if cond else ""
1670 bpSuffix = " : {0:d}{1}".format(line, formattedCond) 1873 bpSuffix = " : {0:d}{1}".format(line, formattedCond)
1671 act = self.breakpointsMenu.addAction( 1874 act = self.breakpointsMenu.addAction(
1672 "{0}{1}".format( 1875 "{0}{1}".format(
1673 Utilities.compactPath( 1876 Utilities.compactPath(
1674 filename, 1877 filename, self.ui.maxMenuFilePathLen - len(bpSuffix)
1675 self.ui.maxMenuFilePathLen - len(bpSuffix)), 1878 ),
1676 bpSuffix)) 1879 bpSuffix,
1880 )
1881 )
1677 act.setData([filename, line]) 1882 act.setData([filename, line])
1678 1883
1679 def __breakpointSelected(self, act): 1884 def __breakpointSelected(self, act):
1680 """ 1885 """
1681 Private method to handle the breakpoint selected signal. 1886 Private method to handle the breakpoint selected signal.
1682 1887
1683 @param act reference to the action that triggered (QAction) 1888 @param act reference to the action that triggered (QAction)
1684 """ 1889 """
1685 qvList = act.data() 1890 qvList = act.data()
1686 filename = qvList[0] 1891 filename = qvList[0]
1687 line = qvList[1] 1892 line = qvList[1]
1688 self.viewmanager.openSourceFile(filename, line) 1893 self.viewmanager.openSourceFile(filename, line)
1689 1894
1690 def __compileChangedProjectFiles(self): 1895 def __compileChangedProjectFiles(self):
1691 """ 1896 """
1692 Private method to signal compilation of changed forms and resources 1897 Private method to signal compilation of changed forms and resources
1693 is wanted. 1898 is wanted.
1694 """ 1899 """
1697 if Preferences.getProject("AutoCompileResources"): 1902 if Preferences.getProject("AutoCompileResources"):
1698 self.compileResources.emit() 1903 self.compileResources.emit()
1699 if Preferences.getProject("AutoExecuteMake"): 1904 if Preferences.getProject("AutoExecuteMake"):
1700 self.executeMake.emit() 1905 self.executeMake.emit()
1701 QApplication.processEvents() 1906 QApplication.processEvents()
1702 1907
1703 def __coverageScript(self): 1908 def __coverageScript(self):
1704 """ 1909 """
1705 Private slot to handle the coverage of script action. 1910 Private slot to handle the coverage of script action.
1706 """ 1911 """
1707 self.doCoverage(False) 1912 self.doCoverage(False)
1708 1913
1709 def __coverageProject(self): 1914 def __coverageProject(self):
1710 """ 1915 """
1711 Private slot to handle the coverage of project action. 1916 Private slot to handle the coverage of project action.
1712 """ 1917 """
1713 self.__compileChangedProjectFiles() 1918 self.__compileChangedProjectFiles()
1714 self.doCoverage(True) 1919 self.doCoverage(True)
1715 1920
1716 def doCoverage(self, runProject, script=""): 1921 def doCoverage(self, runProject, script=""):
1717 """ 1922 """
1718 Public method to handle the coverage actions. 1923 Public method to handle the coverage actions.
1719 1924
1720 @param runProject flag indicating coverage of the current project 1925 @param runProject flag indicating coverage of the current project
1721 (True) or script (false) 1926 (True) or script (false)
1722 @type bool 1927 @type bool
1723 @param script name of a script (optional) 1928 @param script name of a script (optional)
1724 @type str 1929 @type str
1725 """ 1930 """
1726 from .StartDialog import StartDialog 1931 from .StartDialog import StartDialog
1727 1932
1728 self.__resetUI() 1933 self.__resetUI()
1729 doNotStart = False 1934 doNotStart = False
1730 1935
1731 # Get the command line arguments, the working directory and the 1936 # Get the command line arguments, the working directory and the
1732 # exception reporting flag. 1937 # exception reporting flag.
1733 cap = ( 1938 cap = (
1734 self.tr("Coverage of Project") 1939 self.tr("Coverage of Project")
1735 if runProject else 1940 if runProject
1736 self.tr("Coverage of Script") 1941 else self.tr("Coverage of Script")
1737 ) 1942 )
1738 if runProject: 1943 if runProject:
1739 scriptName = self.project.getMainScript(True) 1944 scriptName = self.project.getMainScript(True)
1740 elif script: 1945 elif script:
1741 scriptName = script 1946 scriptName = script
1742 elif self.lastDebuggedFile: 1947 elif self.lastDebuggedFile:
1743 scriptName = self.lastDebuggedFile 1948 scriptName = self.lastDebuggedFile
1744 else: 1949 else:
1745 scriptName = "" 1950 scriptName = ""
1746 dlg = StartDialog( 1951 dlg = StartDialog(
1747 cap, self.lastUsedVenvName, self.argvHistory, self.wdHistory, 1952 cap,
1748 self.envHistory, self.exceptions, self.ui, 2, 1953 self.lastUsedVenvName,
1954 self.argvHistory,
1955 self.wdHistory,
1956 self.envHistory,
1957 self.exceptions,
1958 self.ui,
1959 2,
1749 autoClearShell=self.autoClearShell, 1960 autoClearShell=self.autoClearShell,
1750 configOverride=self.overrideGlobalConfig, 1961 configOverride=self.overrideGlobalConfig,
1751 forProject=runProject, scriptName=scriptName, 1962 forProject=runProject,
1752 scriptsList=self.scriptsHistory) 1963 scriptName=scriptName,
1964 scriptsList=self.scriptsHistory,
1965 )
1753 if dlg.exec() == QDialog.DialogCode.Accepted: 1966 if dlg.exec() == QDialog.DialogCode.Accepted:
1754 (lastUsedVenvName, scriptName, argv, wd, env, exceptions, 1967 (
1755 clearShell, console) = dlg.getData() 1968 lastUsedVenvName,
1969 scriptName,
1970 argv,
1971 wd,
1972 env,
1973 exceptions,
1974 clearShell,
1975 console,
1976 ) = dlg.getData()
1756 configOverride = dlg.getGlobalOverrideData() 1977 configOverride = dlg.getGlobalOverrideData()
1757 eraseCoverage = dlg.getCoverageData() 1978 eraseCoverage = dlg.getCoverageData()
1758 1979
1759 if runProject: 1980 if runProject:
1760 fn = self.project.getMainScript(True) 1981 fn = self.project.getMainScript(True)
1761 if fn is None: 1982 if fn is None:
1762 EricMessageBox.critical( 1983 EricMessageBox.critical(
1763 self.ui, 1984 self.ui,
1764 self.tr("Coverage of Project"), 1985 self.tr("Coverage of Project"),
1765 self.tr( 1986 self.tr(
1766 "There is no main script defined for the" 1987 "There is no main script defined for the"
1767 " current project. Aborting")) 1988 " current project. Aborting"
1989 ),
1990 )
1768 return 1991 return
1769 1992
1770 if ( 1993 if Preferences.getDebugger(
1771 Preferences.getDebugger("Autosave") and 1994 "Autosave"
1772 not self.project.saveAllScripts(reportSyntaxErrors=True) 1995 ) and not self.project.saveAllScripts(reportSyntaxErrors=True):
1773 ):
1774 doNotStart = True 1996 doNotStart = True
1775 1997
1776 # save the info for later use 1998 # save the info for later use
1777 self.project.setDbgInfo( 1999 self.project.setDbgInfo(
1778 lastUsedVenvName, argv, wd, env, exceptions, self.excList, 2000 lastUsedVenvName,
1779 self.excIgnoreList, clearShell, 2001 argv,
1780 configOverride=configOverride 2002 wd,
2003 env,
2004 exceptions,
2005 self.excList,
2006 self.excIgnoreList,
2007 clearShell,
2008 configOverride=configOverride,
1781 ) 2009 )
1782 2010
1783 self.lastStartAction = 6 2011 self.lastStartAction = 6
1784 self.clientType = self.project.getProjectLanguage() 2012 self.clientType = self.project.getProjectLanguage()
1785 else: 2013 else:
1786 if scriptName: 2014 if scriptName:
1787 fn = scriptName 2015 fn = scriptName
1789 else: 2017 else:
1790 # run current editor 2018 # run current editor
1791 editor = self.viewmanager.activeWindow() 2019 editor = self.viewmanager.activeWindow()
1792 if editor is None: 2020 if editor is None:
1793 return 2021 return
1794 2022
1795 if ( 2023 if (
1796 not self.viewmanager.checkDirty( 2024 not self.viewmanager.checkDirty(
1797 editor, Preferences.getDebugger("Autosave")) or 2025 editor, Preferences.getDebugger("Autosave")
1798 editor.getFileName() is None 2026 )
2027 or editor.getFileName() is None
1799 ): 2028 ):
1800 return 2029 return
1801 2030
1802 fn = editor.getFileName() 2031 fn = editor.getFileName()
1803 self.clientType = editor.determineFileType() 2032 self.clientType = editor.determineFileType()
1804 self.lastStartAction = 5 2033 self.lastStartAction = 5
1805 2034
1806 # save the filename for use by the restart method 2035 # save the filename for use by the restart method
1807 self.lastDebuggedFile = fn 2036 self.lastDebuggedFile = fn
1808 self.restartAct.setEnabled(True) 2037 self.restartAct.setEnabled(True)
1809 2038
1810 # save the most recently used virtual environment 2039 # save the most recently used virtual environment
1811 self.lastUsedVenvName = lastUsedVenvName 2040 self.lastUsedVenvName = lastUsedVenvName
1812 2041
1813 # This moves any previous occurrence of these arguments to the head 2042 # This moves any previous occurrence of these arguments to the head
1814 # of the list. 2043 # of the list.
1815 self.setScriptsHistory(scriptName) 2044 self.setScriptsHistory(scriptName)
1816 self.setArgvHistory(argv) 2045 self.setArgvHistory(argv)
1817 self.setWdHistory(wd) 2046 self.setWdHistory(wd)
1818 self.setEnvHistory(env) 2047 self.setEnvHistory(env)
1819 2048
1820 # Save the exception flags 2049 # Save the exception flags
1821 self.exceptions = exceptions 2050 self.exceptions = exceptions
1822 2051
1823 # Save the erase coverage flag 2052 # Save the erase coverage flag
1824 self.eraseCoverage = eraseCoverage 2053 self.eraseCoverage = eraseCoverage
1825 2054
1826 # Save the clear interpreter flag 2055 # Save the clear interpreter flag
1827 self.autoClearShell = clearShell 2056 self.autoClearShell = clearShell
1828 2057
1829 # Save the run in console flag 2058 # Save the run in console flag
1830 self.runInConsole = console 2059 self.runInConsole = console
1831 2060
1832 # Save the global config override data 2061 # Save the global config override data
1833 self.overrideGlobalConfig = copy.deepcopy(configOverride) 2062 self.overrideGlobalConfig = copy.deepcopy(configOverride)
1834 2063
1835 # Hide all error highlights 2064 # Hide all error highlights
1836 self.viewmanager.unhighlight() 2065 self.viewmanager.unhighlight()
1837 2066
1838 if not doNotStart: 2067 if not doNotStart:
1839 if runProject and self.project.getProjectType() in [ 2068 if runProject and self.project.getProjectType() in ["E7Plugin"]:
1840 "E7Plugin"]:
1841 argv = '--plugin="{0}" {1}'.format(fn, argv) 2069 argv = '--plugin="{0}" {1}'.format(fn, argv)
1842 fn = os.path.join(getConfig('ericDir'), "eric7.py") 2070 fn = os.path.join(getConfig("ericDir"), "eric7.py")
1843 2071
1844 self.debugViewer.initCallStackViewer(runProject) 2072 self.debugViewer.initCallStackViewer(runProject)
1845 2073
1846 # Ask the client to open the new program. 2074 # Ask the client to open the new program.
1847 self.debugServer.remoteCoverage( 2075 self.debugServer.remoteCoverage(
1848 lastUsedVenvName, fn, argv, wd, env, 2076 lastUsedVenvName,
1849 autoClearShell=self.autoClearShell, erase=eraseCoverage, 2077 fn,
1850 forProject=runProject, runInConsole=console, 2078 argv,
2079 wd,
2080 env,
2081 autoClearShell=self.autoClearShell,
2082 erase=eraseCoverage,
2083 forProject=runProject,
2084 runInConsole=console,
1851 clientType=self.clientType, 2085 clientType=self.clientType,
1852 configOverride=self.overrideGlobalConfig) 2086 configOverride=self.overrideGlobalConfig,
1853 2087 )
2088
1854 self.stopAct.setEnabled(True) 2089 self.stopAct.setEnabled(True)
1855 2090
1856 if dlg.clearHistories(): 2091 if dlg.clearHistories():
1857 self.setScriptsHistory("", clearHistories=True) 2092 self.setScriptsHistory("", clearHistories=True)
1858 self.setArgvHistory("", clearHistories=True) 2093 self.setArgvHistory("", clearHistories=True)
1859 self.setWdHistory("", clearHistories=True) 2094 self.setWdHistory("", clearHistories=True)
1860 self.setEnvHistory("", clearHistories=True) 2095 self.setEnvHistory("", clearHistories=True)
1861 self.setMultiprocessNoDebugHistory("", clearHistories=True) 2096 self.setMultiprocessNoDebugHistory("", clearHistories=True)
1862 elif dlg.historiesModified(): 2097 elif dlg.historiesModified():
1863 (scriptsHistory, argvHistory, wdHistory, envHistory, 2098 (scriptsHistory, argvHistory, wdHistory, envHistory, _) = dlg.getHistories()
1864 _) = dlg.getHistories()
1865 self.setScriptsHistory("", history=scriptsHistory) 2099 self.setScriptsHistory("", history=scriptsHistory)
1866 self.setArgvHistory("", history=argvHistory) 2100 self.setArgvHistory("", history=argvHistory)
1867 self.setWdHistory("", history=wdHistory) 2101 self.setWdHistory("", history=wdHistory)
1868 self.setEnvHistory("", history=envHistory) 2102 self.setEnvHistory("", history=envHistory)
1869 2103
1870 def __profileScript(self): 2104 def __profileScript(self):
1871 """ 2105 """
1872 Private slot to handle the profile script action. 2106 Private slot to handle the profile script action.
1873 """ 2107 """
1874 self.doProfile(False) 2108 self.doProfile(False)
1875 2109
1876 def __profileProject(self): 2110 def __profileProject(self):
1877 """ 2111 """
1878 Private slot to handle the profile project action. 2112 Private slot to handle the profile project action.
1879 """ 2113 """
1880 self.__compileChangedProjectFiles() 2114 self.__compileChangedProjectFiles()
1881 self.doProfile(True) 2115 self.doProfile(True)
1882 2116
1883 def doProfile(self, runProject, script=""): 2117 def doProfile(self, runProject, script=""):
1884 """ 2118 """
1885 Public method to handle the profile actions. 2119 Public method to handle the profile actions.
1886 2120
1887 @param runProject flag indicating profiling of the current project 2121 @param runProject flag indicating profiling of the current project
1888 (True) or script (False) 2122 (True) or script (False)
1889 @type bool 2123 @type bool
1890 @param script name of a script (optional) 2124 @param script name of a script (optional)
1891 @type str 2125 @type str
1892 """ 2126 """
1893 from .StartDialog import StartDialog 2127 from .StartDialog import StartDialog
1894 2128
1895 self.__resetUI() 2129 self.__resetUI()
1896 doNotStart = False 2130 doNotStart = False
1897 2131
1898 # Get the command line arguments, the working directory and the 2132 # Get the command line arguments, the working directory and the
1899 # exception reporting flag. 2133 # exception reporting flag.
1900 cap = ( 2134 cap = (
1901 self.tr("Profile of Project") 2135 self.tr("Profile of Project")
1902 if runProject else 2136 if runProject
1903 self.tr("Profile of Script") 2137 else self.tr("Profile of Script")
1904 ) 2138 )
1905 if runProject: 2139 if runProject:
1906 scriptName = self.project.getMainScript(True) 2140 scriptName = self.project.getMainScript(True)
1907 elif script: 2141 elif script:
1908 scriptName = script 2142 scriptName = script
1909 elif self.lastDebuggedFile: 2143 elif self.lastDebuggedFile:
1910 scriptName = self.lastDebuggedFile 2144 scriptName = self.lastDebuggedFile
1911 else: 2145 else:
1912 scriptName = "" 2146 scriptName = ""
1913 dlg = StartDialog( 2147 dlg = StartDialog(
1914 cap, self.lastUsedVenvName, self.argvHistory, self.wdHistory, 2148 cap,
1915 self.envHistory, self.exceptions, self.ui, 3, 2149 self.lastUsedVenvName,
2150 self.argvHistory,
2151 self.wdHistory,
2152 self.envHistory,
2153 self.exceptions,
2154 self.ui,
2155 3,
1916 autoClearShell=self.autoClearShell, 2156 autoClearShell=self.autoClearShell,
1917 configOverride=self.overrideGlobalConfig, 2157 configOverride=self.overrideGlobalConfig,
1918 forProject=runProject, scriptName=scriptName, 2158 forProject=runProject,
1919 scriptsList=self.scriptsHistory) 2159 scriptName=scriptName,
2160 scriptsList=self.scriptsHistory,
2161 )
1920 if dlg.exec() == QDialog.DialogCode.Accepted: 2162 if dlg.exec() == QDialog.DialogCode.Accepted:
1921 (lastUsedVenvName, scriptName, argv, wd, env, exceptions, 2163 (
1922 clearShell, console) = dlg.getData() 2164 lastUsedVenvName,
2165 scriptName,
2166 argv,
2167 wd,
2168 env,
2169 exceptions,
2170 clearShell,
2171 console,
2172 ) = dlg.getData()
1923 configOverride = dlg.getGlobalOverrideData() 2173 configOverride = dlg.getGlobalOverrideData()
1924 eraseTimings = dlg.getProfilingData() 2174 eraseTimings = dlg.getProfilingData()
1925 2175
1926 if runProject: 2176 if runProject:
1927 fn = self.project.getMainScript(True) 2177 fn = self.project.getMainScript(True)
1928 if fn is None: 2178 if fn is None:
1929 EricMessageBox.critical( 2179 EricMessageBox.critical(
1930 self.ui, 2180 self.ui,
1931 self.tr("Profile of Project"), 2181 self.tr("Profile of Project"),
1932 self.tr( 2182 self.tr(
1933 "There is no main script defined for the" 2183 "There is no main script defined for the"
1934 " current project. Aborting")) 2184 " current project. Aborting"
2185 ),
2186 )
1935 return 2187 return
1936 2188
1937 if ( 2189 if Preferences.getDebugger(
1938 Preferences.getDebugger("Autosave") and 2190 "Autosave"
1939 not self.project.saveAllScripts(reportSyntaxErrors=True) 2191 ) and not self.project.saveAllScripts(reportSyntaxErrors=True):
1940 ):
1941 doNotStart = True 2192 doNotStart = True
1942 2193
1943 # save the info for later use 2194 # save the info for later use
1944 self.project.setDbgInfo( 2195 self.project.setDbgInfo(
1945 lastUsedVenvName, argv, wd, env, exceptions, self.excList, 2196 lastUsedVenvName,
1946 self.excIgnoreList, clearShell, 2197 argv,
1947 configOverride=configOverride 2198 wd,
2199 env,
2200 exceptions,
2201 self.excList,
2202 self.excIgnoreList,
2203 clearShell,
2204 configOverride=configOverride,
1948 ) 2205 )
1949 2206
1950 self.lastStartAction = 8 2207 self.lastStartAction = 8
1951 self.clientType = self.project.getProjectLanguage() 2208 self.clientType = self.project.getProjectLanguage()
1952 else: 2209 else:
1953 if scriptName: 2210 if scriptName:
1954 fn = scriptName 2211 fn = scriptName
1956 else: 2213 else:
1957 # run current editor 2214 # run current editor
1958 editor = self.viewmanager.activeWindow() 2215 editor = self.viewmanager.activeWindow()
1959 if editor is None: 2216 if editor is None:
1960 return 2217 return
1961 2218
1962 if ( 2219 if (
1963 not self.viewmanager.checkDirty( 2220 not self.viewmanager.checkDirty(
1964 editor, Preferences.getDebugger("Autosave")) or 2221 editor, Preferences.getDebugger("Autosave")
1965 editor.getFileName() is None 2222 )
2223 or editor.getFileName() is None
1966 ): 2224 ):
1967 return 2225 return
1968 2226
1969 fn = editor.getFileName() 2227 fn = editor.getFileName()
1970 self.clientType = editor.determineFileType() 2228 self.clientType = editor.determineFileType()
1971 self.lastStartAction = 7 2229 self.lastStartAction = 7
1972 2230
1973 # save the filename for use by the restart method 2231 # save the filename for use by the restart method
1974 self.lastDebuggedFile = fn 2232 self.lastDebuggedFile = fn
1975 self.restartAct.setEnabled(True) 2233 self.restartAct.setEnabled(True)
1976 2234
1977 # save the most recently used virtual environment 2235 # save the most recently used virtual environment
1978 self.lastUsedVenvName = lastUsedVenvName 2236 self.lastUsedVenvName = lastUsedVenvName
1979 2237
1980 # This moves any previous occurrence of these arguments to the head 2238 # This moves any previous occurrence of these arguments to the head
1981 # of the list. 2239 # of the list.
1982 self.setScriptsHistory(scriptName) 2240 self.setScriptsHistory(scriptName)
1983 self.setArgvHistory(argv) 2241 self.setArgvHistory(argv)
1984 self.setWdHistory(wd) 2242 self.setWdHistory(wd)
1985 self.setEnvHistory(env) 2243 self.setEnvHistory(env)
1986 2244
1987 # Save the exception flags 2245 # Save the exception flags
1988 self.exceptions = exceptions 2246 self.exceptions = exceptions
1989 2247
1990 # Save the erase timing flag 2248 # Save the erase timing flag
1991 self.eraseTimings = eraseTimings 2249 self.eraseTimings = eraseTimings
1992 2250
1993 # Save the clear interpreter flag 2251 # Save the clear interpreter flag
1994 self.autoClearShell = clearShell 2252 self.autoClearShell = clearShell
1995 2253
1996 # Save the run in console flag 2254 # Save the run in console flag
1997 self.runInConsole = console 2255 self.runInConsole = console
1998 2256
1999 # Save the global config override data 2257 # Save the global config override data
2000 self.overrideGlobalConfig = copy.deepcopy(configOverride) 2258 self.overrideGlobalConfig = copy.deepcopy(configOverride)
2001 2259
2002 # Hide all error highlights 2260 # Hide all error highlights
2003 self.viewmanager.unhighlight() 2261 self.viewmanager.unhighlight()
2004 2262
2005 if not doNotStart: 2263 if not doNotStart:
2006 if runProject and self.project.getProjectType() in [ 2264 if runProject and self.project.getProjectType() in ["E7Plugin"]:
2007 "E7Plugin"]:
2008 argv = '--plugin="{0}" {1}'.format(fn, argv) 2265 argv = '--plugin="{0}" {1}'.format(fn, argv)
2009 fn = os.path.join(getConfig('ericDir'), "eric7.py") 2266 fn = os.path.join(getConfig("ericDir"), "eric7.py")
2010 2267
2011 self.debugViewer.initCallStackViewer(runProject) 2268 self.debugViewer.initCallStackViewer(runProject)
2012 2269
2013 # Ask the client to open the new program. 2270 # Ask the client to open the new program.
2014 self.debugServer.remoteProfile( 2271 self.debugServer.remoteProfile(
2015 lastUsedVenvName, fn, argv, wd, env, 2272 lastUsedVenvName,
2016 autoClearShell=self.autoClearShell, erase=eraseTimings, 2273 fn,
2017 forProject=runProject, runInConsole=console, 2274 argv,
2275 wd,
2276 env,
2277 autoClearShell=self.autoClearShell,
2278 erase=eraseTimings,
2279 forProject=runProject,
2280 runInConsole=console,
2018 clientType=self.clientType, 2281 clientType=self.clientType,
2019 configOverride=self.overrideGlobalConfig) 2282 configOverride=self.overrideGlobalConfig,
2020 2283 )
2284
2021 self.stopAct.setEnabled(True) 2285 self.stopAct.setEnabled(True)
2022 2286
2023 if dlg.clearHistories(): 2287 if dlg.clearHistories():
2024 self.setScriptsHistory("", clearHistories=True) 2288 self.setScriptsHistory("", clearHistories=True)
2025 self.setArgvHistory("", clearHistories=True) 2289 self.setArgvHistory("", clearHistories=True)
2026 self.setWdHistory("", clearHistories=True) 2290 self.setWdHistory("", clearHistories=True)
2027 self.setEnvHistory("", clearHistories=True) 2291 self.setEnvHistory("", clearHistories=True)
2028 self.setMultiprocessNoDebugHistory("", clearHistories=True) 2292 self.setMultiprocessNoDebugHistory("", clearHistories=True)
2029 elif dlg.historiesModified(): 2293 elif dlg.historiesModified():
2030 (scriptsHistory, argvHistory, wdHistory, envHistory, 2294 (scriptsHistory, argvHistory, wdHistory, envHistory, _) = dlg.getHistories()
2031 _) = dlg.getHistories()
2032 self.setScriptsHistory("", history=scriptsHistory) 2295 self.setScriptsHistory("", history=scriptsHistory)
2033 self.setArgvHistory("", history=argvHistory) 2296 self.setArgvHistory("", history=argvHistory)
2034 self.setWdHistory("", history=wdHistory) 2297 self.setWdHistory("", history=wdHistory)
2035 self.setEnvHistory("", history=envHistory) 2298 self.setEnvHistory("", history=envHistory)
2036 2299
2037 def __runScript(self): 2300 def __runScript(self):
2038 """ 2301 """
2039 Private slot to handle the run script action. 2302 Private slot to handle the run script action.
2040 """ 2303 """
2041 self.doRun(False) 2304 self.doRun(False)
2042 2305
2043 def __runProject(self): 2306 def __runProject(self):
2044 """ 2307 """
2045 Private slot to handle the run project action. 2308 Private slot to handle the run project action.
2046 """ 2309 """
2047 self.__compileChangedProjectFiles() 2310 self.__compileChangedProjectFiles()
2048 self.doRun(True) 2311 self.doRun(True)
2049 2312
2050 def doRun(self, runProject, script=""): 2313 def doRun(self, runProject, script=""):
2051 """ 2314 """
2052 Public method to handle the run actions. 2315 Public method to handle the run actions.
2053 2316
2054 @param runProject flag indicating running the current project (True) 2317 @param runProject flag indicating running the current project (True)
2055 or script (False) 2318 or script (False)
2056 @type bool 2319 @type bool
2057 @param script name of a script (optional) 2320 @param script name of a script (optional)
2058 @type str 2321 @type str
2059 """ 2322 """
2060 from .StartDialog import StartDialog 2323 from .StartDialog import StartDialog
2061 2324
2062 self.__resetUI() 2325 self.__resetUI()
2063 doNotStart = False 2326 doNotStart = False
2064 2327
2065 # Get the command line arguments, the working directory and the 2328 # Get the command line arguments, the working directory and the
2066 # exception reporting flag. 2329 # exception reporting flag.
2067 cap = ( 2330 cap = self.tr("Run Project") if runProject else self.tr("Run Script")
2068 self.tr("Run Project")
2069 if runProject else
2070 self.tr("Run Script")
2071 )
2072 if runProject: 2331 if runProject:
2073 scriptName = self.project.getMainScript(True) 2332 scriptName = self.project.getMainScript(True)
2074 elif script: 2333 elif script:
2075 scriptName = script 2334 scriptName = script
2076 elif self.lastDebuggedFile: 2335 elif self.lastDebuggedFile:
2077 scriptName = self.lastDebuggedFile 2336 scriptName = self.lastDebuggedFile
2078 else: 2337 else:
2079 scriptName = "" 2338 scriptName = ""
2080 dlg = StartDialog( 2339 dlg = StartDialog(
2081 cap, self.lastUsedVenvName, self.argvHistory, self.wdHistory, 2340 cap,
2082 self.envHistory, self.exceptions, self.ui, 1, 2341 self.lastUsedVenvName,
2342 self.argvHistory,
2343 self.wdHistory,
2344 self.envHistory,
2345 self.exceptions,
2346 self.ui,
2347 1,
2083 autoClearShell=self.autoClearShell, 2348 autoClearShell=self.autoClearShell,
2084 configOverride=self.overrideGlobalConfig, 2349 configOverride=self.overrideGlobalConfig,
2085 forProject=runProject, scriptName=scriptName, 2350 forProject=runProject,
2086 scriptsList=self.scriptsHistory) 2351 scriptName=scriptName,
2352 scriptsList=self.scriptsHistory,
2353 )
2087 if dlg.exec() == QDialog.DialogCode.Accepted: 2354 if dlg.exec() == QDialog.DialogCode.Accepted:
2088 (lastUsedVenvName, scriptName, argv, wd, env, exceptions, 2355 (
2089 clearShell, console) = dlg.getData() 2356 lastUsedVenvName,
2357 scriptName,
2358 argv,
2359 wd,
2360 env,
2361 exceptions,
2362 clearShell,
2363 console,
2364 ) = dlg.getData()
2090 configOverride = dlg.getGlobalOverrideData() 2365 configOverride = dlg.getGlobalOverrideData()
2091 2366
2092 if runProject: 2367 if runProject:
2093 fn = self.project.getMainScript(True) 2368 fn = self.project.getMainScript(True)
2094 if fn is None: 2369 if fn is None:
2095 EricMessageBox.critical( 2370 EricMessageBox.critical(
2096 self.ui, 2371 self.ui,
2097 self.tr("Run Project"), 2372 self.tr("Run Project"),
2098 self.tr( 2373 self.tr(
2099 "There is no main script defined for the" 2374 "There is no main script defined for the"
2100 " current project. Aborting")) 2375 " current project. Aborting"
2376 ),
2377 )
2101 return 2378 return
2102 2379
2103 if ( 2380 if Preferences.getDebugger(
2104 Preferences.getDebugger("Autosave") and 2381 "Autosave"
2105 not self.project.saveAllScripts(reportSyntaxErrors=True) 2382 ) and not self.project.saveAllScripts(reportSyntaxErrors=True):
2106 ):
2107 doNotStart = True 2383 doNotStart = True
2108 2384
2109 # save the info for later use 2385 # save the info for later use
2110 self.project.setDbgInfo( 2386 self.project.setDbgInfo(
2111 lastUsedVenvName, argv, wd, env, exceptions, self.excList, 2387 lastUsedVenvName,
2112 self.excIgnoreList, clearShell, 2388 argv,
2113 configOverride=configOverride 2389 wd,
2390 env,
2391 exceptions,
2392 self.excList,
2393 self.excIgnoreList,
2394 clearShell,
2395 configOverride=configOverride,
2114 ) 2396 )
2115 2397
2116 self.lastStartAction = 4 2398 self.lastStartAction = 4
2117 self.clientType = self.project.getProjectLanguage() 2399 self.clientType = self.project.getProjectLanguage()
2118 else: 2400 else:
2119 if scriptName: 2401 if scriptName:
2120 fn = scriptName 2402 fn = scriptName
2122 else: 2404 else:
2123 # run current editor 2405 # run current editor
2124 editor = self.viewmanager.activeWindow() 2406 editor = self.viewmanager.activeWindow()
2125 if editor is None: 2407 if editor is None:
2126 return 2408 return
2127 2409
2128 if ( 2410 if (
2129 not self.viewmanager.checkDirty( 2411 not self.viewmanager.checkDirty(
2130 editor, 2412 editor, Preferences.getDebugger("Autosave")
2131 Preferences.getDebugger("Autosave")) or 2413 )
2132 editor.getFileName() is None 2414 or editor.getFileName() is None
2133 ): 2415 ):
2134 return 2416 return
2135 2417
2136 fn = editor.getFileName() 2418 fn = editor.getFileName()
2137 self.clientType = editor.determineFileType() 2419 self.clientType = editor.determineFileType()
2138 self.lastStartAction = 3 2420 self.lastStartAction = 3
2139 2421
2140 # save the filename for use by the restart method 2422 # save the filename for use by the restart method
2141 self.lastDebuggedFile = fn 2423 self.lastDebuggedFile = fn
2142 self.restartAct.setEnabled(True) 2424 self.restartAct.setEnabled(True)
2143 2425
2144 # save the most recently used virtual environment 2426 # save the most recently used virtual environment
2145 self.lastUsedVenvName = lastUsedVenvName 2427 self.lastUsedVenvName = lastUsedVenvName
2146 2428
2147 # This moves any previous occurrence of these arguments to the head 2429 # This moves any previous occurrence of these arguments to the head
2148 # of the list. 2430 # of the list.
2149 self.setScriptsHistory(scriptName) 2431 self.setScriptsHistory(scriptName)
2150 self.setArgvHistory(argv) 2432 self.setArgvHistory(argv)
2151 self.setWdHistory(wd) 2433 self.setWdHistory(wd)
2152 self.setEnvHistory(env) 2434 self.setEnvHistory(env)
2153 2435
2154 # Save the exception flags 2436 # Save the exception flags
2155 self.exceptions = exceptions 2437 self.exceptions = exceptions
2156 2438
2157 # Save the clear interpreter flag 2439 # Save the clear interpreter flag
2158 self.autoClearShell = clearShell 2440 self.autoClearShell = clearShell
2159 2441
2160 # Save the run in console flag 2442 # Save the run in console flag
2161 self.runInConsole = console 2443 self.runInConsole = console
2162 2444
2163 # Save the global config override data 2445 # Save the global config override data
2164 self.overrideGlobalConfig = copy.deepcopy(configOverride) 2446 self.overrideGlobalConfig = copy.deepcopy(configOverride)
2165 2447
2166 # Hide all error highlights 2448 # Hide all error highlights
2167 self.viewmanager.unhighlight() 2449 self.viewmanager.unhighlight()
2168 2450
2169 if not doNotStart: 2451 if not doNotStart:
2170 if runProject and self.project.getProjectType() in [ 2452 if runProject and self.project.getProjectType() in ["E7Plugin"]:
2171 "E7Plugin"]:
2172 argv = '--plugin="{0}" {1}'.format(fn, argv) 2453 argv = '--plugin="{0}" {1}'.format(fn, argv)
2173 fn = os.path.join(getConfig('ericDir'), "eric7.py") 2454 fn = os.path.join(getConfig("ericDir"), "eric7.py")
2174 2455
2175 self.debugViewer.initCallStackViewer(runProject) 2456 self.debugViewer.initCallStackViewer(runProject)
2176 2457
2177 # Ask the client to open the new program. 2458 # Ask the client to open the new program.
2178 self.debugServer.remoteRun( 2459 self.debugServer.remoteRun(
2179 lastUsedVenvName, fn, argv, wd, env, 2460 lastUsedVenvName,
2180 autoClearShell=self.autoClearShell, forProject=runProject, 2461 fn,
2181 runInConsole=console, clientType=self.clientType, 2462 argv,
2182 configOverride=self.overrideGlobalConfig) 2463 wd,
2183 2464 env,
2465 autoClearShell=self.autoClearShell,
2466 forProject=runProject,
2467 runInConsole=console,
2468 clientType=self.clientType,
2469 configOverride=self.overrideGlobalConfig,
2470 )
2471
2184 self.stopAct.setEnabled(True) 2472 self.stopAct.setEnabled(True)
2185 2473
2186 if dlg.clearHistories(): 2474 if dlg.clearHistories():
2187 self.setScriptsHistory("", clearHistories=True) 2475 self.setScriptsHistory("", clearHistories=True)
2188 self.setArgvHistory("", clearHistories=True) 2476 self.setArgvHistory("", clearHistories=True)
2189 self.setWdHistory("", clearHistories=True) 2477 self.setWdHistory("", clearHistories=True)
2190 self.setEnvHistory("", clearHistories=True) 2478 self.setEnvHistory("", clearHistories=True)
2191 self.setMultiprocessNoDebugHistory("", clearHistories=True) 2479 self.setMultiprocessNoDebugHistory("", clearHistories=True)
2192 elif dlg.historiesModified(): 2480 elif dlg.historiesModified():
2193 (scriptsHistory, argvHistory, wdHistory, envHistory, 2481 (scriptsHistory, argvHistory, wdHistory, envHistory, _) = dlg.getHistories()
2194 _) = dlg.getHistories()
2195 self.setScriptsHistory("", history=scriptsHistory) 2482 self.setScriptsHistory("", history=scriptsHistory)
2196 self.setArgvHistory("", history=argvHistory) 2483 self.setArgvHistory("", history=argvHistory)
2197 self.setWdHistory("", history=wdHistory) 2484 self.setWdHistory("", history=wdHistory)
2198 self.setEnvHistory("", history=envHistory) 2485 self.setEnvHistory("", history=envHistory)
2199 2486
2200 def __debugScript(self): 2487 def __debugScript(self):
2201 """ 2488 """
2202 Private slot to handle the debug script action. 2489 Private slot to handle the debug script action.
2203 """ 2490 """
2204 self.doDebug(False) 2491 self.doDebug(False)
2205 2492
2206 def __debugProject(self): 2493 def __debugProject(self):
2207 """ 2494 """
2208 Private slot to handle the debug project action. 2495 Private slot to handle the debug project action.
2209 """ 2496 """
2210 self.__compileChangedProjectFiles() 2497 self.__compileChangedProjectFiles()
2211 self.doDebug(True) 2498 self.doDebug(True)
2212 2499
2213 def doDebug(self, debugProject, script=""): 2500 def doDebug(self, debugProject, script=""):
2214 """ 2501 """
2215 Public method to handle the debug actions. 2502 Public method to handle the debug actions.
2216 2503
2217 @param debugProject flag indicating debugging the current project 2504 @param debugProject flag indicating debugging the current project
2218 (True) or script (False) 2505 (True) or script (False)
2219 @type bool 2506 @type bool
2220 @param script name of a script (optional) 2507 @param script name of a script (optional)
2221 @type str 2508 @type str
2222 """ 2509 """
2223 from .StartDialog import StartDialog 2510 from .StartDialog import StartDialog
2224 2511
2225 self.__resetUI() 2512 self.__resetUI()
2226 doNotStart = False 2513 doNotStart = False
2227 2514
2228 # Get the command line arguments, the working directory and the 2515 # Get the command line arguments, the working directory and the
2229 # exception reporting flag. 2516 # exception reporting flag.
2230 cap = ( 2517 cap = self.tr("Debug Project") if debugProject else self.tr("Debug Script")
2231 self.tr("Debug Project")
2232 if debugProject else
2233 self.tr("Debug Script")
2234 )
2235 if debugProject: 2518 if debugProject:
2236 scriptName = self.project.getMainScript(True) 2519 scriptName = self.project.getMainScript(True)
2237 elif script: 2520 elif script:
2238 scriptName = script 2521 scriptName = script
2239 elif self.lastDebuggedFile: 2522 elif self.lastDebuggedFile:
2240 scriptName = self.lastDebuggedFile 2523 scriptName = self.lastDebuggedFile
2241 else: 2524 else:
2242 scriptName = "" 2525 scriptName = ""
2243 dlg = StartDialog( 2526 dlg = StartDialog(
2244 cap, self.lastUsedVenvName, self.argvHistory, self.wdHistory, 2527 cap,
2245 self.envHistory, self.exceptions, self.ui, 0, 2528 self.lastUsedVenvName,
2246 tracePython=self.tracePython, autoClearShell=self.autoClearShell, 2529 self.argvHistory,
2530 self.wdHistory,
2531 self.envHistory,
2532 self.exceptions,
2533 self.ui,
2534 0,
2535 tracePython=self.tracePython,
2536 autoClearShell=self.autoClearShell,
2247 autoContinue=self.autoContinue, 2537 autoContinue=self.autoContinue,
2248 enableMultiprocess=self.enableMultiprocess, 2538 enableMultiprocess=self.enableMultiprocess,
2249 multiprocessNoDebugHistory=self.multiprocessNoDebugHistory, 2539 multiprocessNoDebugHistory=self.multiprocessNoDebugHistory,
2250 configOverride=self.overrideGlobalConfig, 2540 configOverride=self.overrideGlobalConfig,
2251 forProject=debugProject, scriptName=scriptName, 2541 forProject=debugProject,
2252 scriptsList=self.scriptsHistory) 2542 scriptName=scriptName,
2543 scriptsList=self.scriptsHistory,
2544 )
2253 if dlg.exec() == QDialog.DialogCode.Accepted: 2545 if dlg.exec() == QDialog.DialogCode.Accepted:
2254 (lastUsedVenvName, scriptName, argv, wd, env, exceptions, 2546 (
2255 clearShell, console) = dlg.getData() 2547 lastUsedVenvName,
2548 scriptName,
2549 argv,
2550 wd,
2551 env,
2552 exceptions,
2553 clearShell,
2554 console,
2555 ) = dlg.getData()
2256 configOverride = dlg.getGlobalOverrideData() 2556 configOverride = dlg.getGlobalOverrideData()
2257 (tracePython, autoContinue, enableMultiprocess, 2557 (
2258 multiprocessNoDebug) = dlg.getDebugData() 2558 tracePython,
2259 2559 autoContinue,
2560 enableMultiprocess,
2561 multiprocessNoDebug,
2562 ) = dlg.getDebugData()
2563
2260 if debugProject: 2564 if debugProject:
2261 fn = self.project.getMainScript(True) 2565 fn = self.project.getMainScript(True)
2262 if fn is None: 2566 if fn is None:
2263 EricMessageBox.critical( 2567 EricMessageBox.critical(
2264 self.ui, 2568 self.ui,
2265 self.tr("Debug Project"), 2569 self.tr("Debug Project"),
2266 self.tr( 2570 self.tr(
2267 "There is no main script defined for the" 2571 "There is no main script defined for the"
2268 " current project. No debugging possible.")) 2572 " current project. No debugging possible."
2573 ),
2574 )
2269 return 2575 return
2270 2576
2271 if ( 2577 if Preferences.getDebugger(
2272 Preferences.getDebugger("Autosave") and 2578 "Autosave"
2273 not self.project.saveAllScripts(reportSyntaxErrors=True) 2579 ) and not self.project.saveAllScripts(reportSyntaxErrors=True):
2274 ):
2275 doNotStart = True 2580 doNotStart = True
2276 2581
2277 # save the info for later use 2582 # save the info for later use
2278 self.project.setDbgInfo( 2583 self.project.setDbgInfo(
2279 lastUsedVenvName, argv, wd, env, exceptions, self.excList, 2584 lastUsedVenvName,
2280 self.excIgnoreList, clearShell, tracePython=tracePython, 2585 argv,
2586 wd,
2587 env,
2588 exceptions,
2589 self.excList,
2590 self.excIgnoreList,
2591 clearShell,
2592 tracePython=tracePython,
2281 autoContinue=autoContinue, 2593 autoContinue=autoContinue,
2282 enableMultiprocess=enableMultiprocess, 2594 enableMultiprocess=enableMultiprocess,
2283 multiprocessNoDebug=multiprocessNoDebug, 2595 multiprocessNoDebug=multiprocessNoDebug,
2284 configOverride=configOverride 2596 configOverride=configOverride,
2285 ) 2597 )
2286 2598
2287 self.lastStartAction = 2 2599 self.lastStartAction = 2
2288 self.clientType = self.project.getProjectLanguage() 2600 self.clientType = self.project.getProjectLanguage()
2289 else: 2601 else:
2290 if scriptName: 2602 if scriptName:
2291 fn = scriptName 2603 fn = scriptName
2293 else: 2605 else:
2294 # debug current editor 2606 # debug current editor
2295 editor = self.viewmanager.activeWindow() 2607 editor = self.viewmanager.activeWindow()
2296 if editor is None: 2608 if editor is None:
2297 return 2609 return
2298 2610
2299 if ( 2611 if (
2300 not self.viewmanager.checkDirty( 2612 not self.viewmanager.checkDirty(
2301 editor, Preferences.getDebugger("Autosave")) or 2613 editor, Preferences.getDebugger("Autosave")
2302 editor.getFileName() is None 2614 )
2615 or editor.getFileName() is None
2303 ): 2616 ):
2304 return 2617 return
2305 2618
2306 fn = editor.getFileName() 2619 fn = editor.getFileName()
2307 self.clientType = editor.determineFileType() 2620 self.clientType = editor.determineFileType()
2308 self.lastStartAction = 1 2621 self.lastStartAction = 1
2309 2622
2310 # save the filename for use by the restart method 2623 # save the filename for use by the restart method
2311 self.lastDebuggedFile = fn 2624 self.lastDebuggedFile = fn
2312 self.restartAct.setEnabled(True) 2625 self.restartAct.setEnabled(True)
2313 2626
2314 # save the most recently used virtual environment 2627 # save the most recently used virtual environment
2315 self.lastUsedVenvName = lastUsedVenvName 2628 self.lastUsedVenvName = lastUsedVenvName
2316 2629
2317 # This moves any previous occurrence of these arguments to the head 2630 # This moves any previous occurrence of these arguments to the head
2318 # of the list. 2631 # of the list.
2319 self.setScriptsHistory(scriptName) 2632 self.setScriptsHistory(scriptName)
2320 self.setArgvHistory(argv) 2633 self.setArgvHistory(argv)
2321 self.setWdHistory(wd) 2634 self.setWdHistory(wd)
2322 self.setEnvHistory(env) 2635 self.setEnvHistory(env)
2323 2636
2324 # Save the exception flags 2637 # Save the exception flags
2325 self.exceptions = exceptions 2638 self.exceptions = exceptions
2326 2639
2327 # Save the tracePython flag 2640 # Save the tracePython flag
2328 self.tracePython = tracePython 2641 self.tracePython = tracePython
2329 2642
2330 # Save the clear interpreter flag 2643 # Save the clear interpreter flag
2331 self.autoClearShell = clearShell 2644 self.autoClearShell = clearShell
2332 2645
2333 # Save the run in console flag 2646 # Save the run in console flag
2334 self.runInConsole = console 2647 self.runInConsole = console
2335 2648
2336 # Save the auto continue flag 2649 # Save the auto continue flag
2337 self.autoContinue = autoContinue 2650 self.autoContinue = autoContinue
2338 2651
2339 # Save the multiprocess debugging data 2652 # Save the multiprocess debugging data
2340 self.enableMultiprocess = enableMultiprocess 2653 self.enableMultiprocess = enableMultiprocess
2341 self.setMultiprocessNoDebugHistory(multiprocessNoDebug) 2654 self.setMultiprocessNoDebugHistory(multiprocessNoDebug)
2342 2655
2343 # Save the global config override data 2656 # Save the global config override data
2344 self.overrideGlobalConfig = copy.deepcopy(configOverride) 2657 self.overrideGlobalConfig = copy.deepcopy(configOverride)
2345 2658
2346 # Hide all error highlights 2659 # Hide all error highlights
2347 self.viewmanager.unhighlight() 2660 self.viewmanager.unhighlight()
2348 2661
2349 if not doNotStart: 2662 if not doNotStart:
2350 if debugProject and self.project.getProjectType() in [ 2663 if debugProject and self.project.getProjectType() in ["E7Plugin"]:
2351 "E7Plugin"]:
2352 argv = '--plugin="{0}" {1}'.format(fn, argv) 2664 argv = '--plugin="{0}" {1}'.format(fn, argv)
2353 fn = os.path.join(getConfig('ericDir'), "eric7.py") 2665 fn = os.path.join(getConfig("ericDir"), "eric7.py")
2354 tracePython = True # override flag because it must be true 2666 tracePython = True # override flag because it must be true
2355 2667
2356 self.debugViewer.initCallStackViewer(debugProject) 2668 self.debugViewer.initCallStackViewer(debugProject)
2357 2669
2358 # Ask the client to send call trace info 2670 # Ask the client to send call trace info
2359 enableCallTrace = self.debugViewer.isCallTraceEnabled() 2671 enableCallTrace = self.debugViewer.isCallTraceEnabled()
2360 self.debugViewer.clearCallTrace() 2672 self.debugViewer.clearCallTrace()
2361 self.debugViewer.setCallTraceToProjectMode(debugProject) 2673 self.debugViewer.setCallTraceToProjectMode(debugProject)
2362 2674
2363 # Ask the client to open the new program. 2675 # Ask the client to open the new program.
2364 self.debugServer.remoteLoad( 2676 self.debugServer.remoteLoad(
2365 lastUsedVenvName, fn, argv, wd, env, 2677 lastUsedVenvName,
2678 fn,
2679 argv,
2680 wd,
2681 env,
2366 autoClearShell=self.autoClearShell, 2682 autoClearShell=self.autoClearShell,
2367 tracePython=tracePython, 2683 tracePython=tracePython,
2368 autoContinue=autoContinue, forProject=debugProject, 2684 autoContinue=autoContinue,
2369 runInConsole=console, clientType=self.clientType, 2685 forProject=debugProject,
2686 runInConsole=console,
2687 clientType=self.clientType,
2370 enableCallTrace=enableCallTrace, 2688 enableCallTrace=enableCallTrace,
2371 enableMultiprocess=enableMultiprocess, 2689 enableMultiprocess=enableMultiprocess,
2372 multiprocessNoDebug=multiprocessNoDebug, 2690 multiprocessNoDebug=multiprocessNoDebug,
2373 configOverride=self.overrideGlobalConfig) 2691 configOverride=self.overrideGlobalConfig,
2374 2692 )
2693
2375 if ( 2694 if (
2376 self.debugServer.isClientProcessUp() and 2695 self.debugServer.isClientProcessUp()
2377 self.debugServer.getClientType() == self.clientType 2696 and self.debugServer.getClientType() == self.clientType
2378 ): 2697 ):
2379 # Signal that we have started a debugging session 2698 # Signal that we have started a debugging session
2380 self.debuggingStarted.emit(fn) 2699 self.debuggingStarted.emit(fn)
2381 2700
2382 self.stopAct.setEnabled(True) 2701 self.stopAct.setEnabled(True)
2383 2702
2384 if dlg.clearHistories(): 2703 if dlg.clearHistories():
2385 self.setScriptsHistory("", clearHistories=True) 2704 self.setScriptsHistory("", clearHistories=True)
2386 self.setArgvHistory("", clearHistories=True) 2705 self.setArgvHistory("", clearHistories=True)
2387 self.setWdHistory("", clearHistories=True) 2706 self.setWdHistory("", clearHistories=True)
2388 self.setEnvHistory("", clearHistories=True) 2707 self.setEnvHistory("", clearHistories=True)
2389 self.setMultiprocessNoDebugHistory("", clearHistories=True) 2708 self.setMultiprocessNoDebugHistory("", clearHistories=True)
2390 elif dlg.historiesModified(): 2709 elif dlg.historiesModified():
2391 (scriptsHistory, argvHistory, wdHistory, envHistory, 2710 (
2392 noDebugHistory) = dlg.getHistories() 2711 scriptsHistory,
2712 argvHistory,
2713 wdHistory,
2714 envHistory,
2715 noDebugHistory,
2716 ) = dlg.getHistories()
2393 self.setScriptsHistory("", history=scriptsHistory) 2717 self.setScriptsHistory("", history=scriptsHistory)
2394 self.setArgvHistory("", history=argvHistory) 2718 self.setArgvHistory("", history=argvHistory)
2395 self.setWdHistory("", history=wdHistory) 2719 self.setWdHistory("", history=wdHistory)
2396 self.setEnvHistory("", history=envHistory) 2720 self.setEnvHistory("", history=envHistory)
2397 self.setMultiprocessNoDebugHistory("", history=noDebugHistory) 2721 self.setMultiprocessNoDebugHistory("", history=noDebugHistory)
2398 2722
2399 def __doRestart(self): 2723 def __doRestart(self):
2400 """ 2724 """
2401 Private slot to handle the restart action to restart the last 2725 Private slot to handle the restart action to restart the last
2402 debugged file. 2726 debugged file.
2403 """ 2727 """
2404 self.__resetUI() 2728 self.__resetUI()
2405 doNotStart = False 2729 doNotStart = False
2406 2730
2407 # first save any changes 2731 # first save any changes
2408 if self.lastStartAction in [1, 3, 5, 7, 9]: 2732 if self.lastStartAction in [1, 3, 5, 7, 9]:
2409 editor = self.viewmanager.getOpenEditor(self.lastDebuggedFile) 2733 editor = self.viewmanager.getOpenEditor(self.lastDebuggedFile)
2410 if ( 2734 if editor and not self.viewmanager.checkDirty(
2411 editor and 2735 editor, Preferences.getDebugger("Autosave")
2412 not self.viewmanager.checkDirty(
2413 editor, Preferences.getDebugger("Autosave"))
2414 ): 2736 ):
2415 return 2737 return
2416 forProject = False 2738 forProject = False
2417 elif self.lastStartAction in [2, 4, 6, 8, 10]: 2739 elif self.lastStartAction in [2, 4, 6, 8, 10]:
2418 if ( 2740 if Preferences.getDebugger("Autosave") and not self.project.saveAllScripts(
2419 Preferences.getDebugger("Autosave") and 2741 reportSyntaxErrors=True
2420 not self.project.saveAllScripts(reportSyntaxErrors=True)
2421 ): 2742 ):
2422 doNotStart = True 2743 doNotStart = True
2423 self.__compileChangedProjectFiles() 2744 self.__compileChangedProjectFiles()
2424 forProject = True 2745 forProject = True
2425 else: 2746 else:
2426 return # should not happen 2747 return # should not happen
2427 2748
2428 # get the saved stuff 2749 # get the saved stuff
2429 venvName = self.lastUsedVenvName 2750 venvName = self.lastUsedVenvName
2430 wd = self.wdHistory[0] 2751 wd = self.wdHistory[0]
2431 argv = self.argvHistory[0] 2752 argv = self.argvHistory[0]
2432 fn = self.lastDebuggedFile 2753 fn = self.lastDebuggedFile
2433 env = self.envHistory[0] 2754 env = self.envHistory[0]
2434 2755
2435 # Hide all error highlights 2756 # Hide all error highlights
2436 self.viewmanager.unhighlight() 2757 self.viewmanager.unhighlight()
2437 2758
2438 if not doNotStart: 2759 if not doNotStart:
2439 if forProject and self.project.getProjectType() in [ 2760 if forProject and self.project.getProjectType() in ["E7Plugin"]:
2440 "E7Plugin"]:
2441 argv = '--plugin="{0}" {1}'.format(fn, argv) 2761 argv = '--plugin="{0}" {1}'.format(fn, argv)
2442 fn = os.path.join(getConfig('ericDir'), "eric7.py") 2762 fn = os.path.join(getConfig("ericDir"), "eric7.py")
2443 2763
2444 self.debugViewer.initCallStackViewer(forProject) 2764 self.debugViewer.initCallStackViewer(forProject)
2445 2765
2446 if self.lastStartAction in [1, 2]: 2766 if self.lastStartAction in [1, 2]:
2447 # Ask the client to send call trace info 2767 # Ask the client to send call trace info
2448 enableCallTrace = self.debugViewer.isCallTraceEnabled() 2768 enableCallTrace = self.debugViewer.isCallTraceEnabled()
2449 self.debugViewer.clearCallTrace() 2769 self.debugViewer.clearCallTrace()
2450 self.debugViewer.setCallTraceToProjectMode(forProject) 2770 self.debugViewer.setCallTraceToProjectMode(forProject)
2451 multiprocessNoDebug = self.multiprocessNoDebugHistory[0] 2771 multiprocessNoDebug = self.multiprocessNoDebugHistory[0]
2452 2772
2453 # Ask the client to debug the new program. 2773 # Ask the client to debug the new program.
2454 self.debugServer.remoteLoad( 2774 self.debugServer.remoteLoad(
2455 venvName, fn, argv, wd, env, 2775 venvName,
2776 fn,
2777 argv,
2778 wd,
2779 env,
2456 autoClearShell=self.autoClearShell, 2780 autoClearShell=self.autoClearShell,
2457 tracePython=self.tracePython, 2781 tracePython=self.tracePython,
2458 autoContinue=self.autoContinue, 2782 autoContinue=self.autoContinue,
2459 forProject=forProject, 2783 forProject=forProject,
2460 runInConsole=self.runInConsole, 2784 runInConsole=self.runInConsole,
2461 clientType=self.clientType, 2785 clientType=self.clientType,
2462 enableCallTrace=enableCallTrace, 2786 enableCallTrace=enableCallTrace,
2463 enableMultiprocess=self.enableMultiprocess, 2787 enableMultiprocess=self.enableMultiprocess,
2464 multiprocessNoDebug=multiprocessNoDebug, 2788 multiprocessNoDebug=multiprocessNoDebug,
2465 configOverride=self.overrideGlobalConfig) 2789 configOverride=self.overrideGlobalConfig,
2466 2790 )
2791
2467 # Signal that we have started a debugging session 2792 # Signal that we have started a debugging session
2468 self.debuggingStarted.emit(fn) 2793 self.debuggingStarted.emit(fn)
2469 2794
2470 elif self.lastStartAction in [3, 4]: 2795 elif self.lastStartAction in [3, 4]:
2471 # Ask the client to run the new program. 2796 # Ask the client to run the new program.
2472 self.debugServer.remoteRun( 2797 self.debugServer.remoteRun(
2473 venvName, fn, argv, wd, env, 2798 venvName,
2799 fn,
2800 argv,
2801 wd,
2802 env,
2474 autoClearShell=self.autoClearShell, 2803 autoClearShell=self.autoClearShell,
2475 forProject=forProject, 2804 forProject=forProject,
2476 runInConsole=self.runInConsole, 2805 runInConsole=self.runInConsole,
2477 clientType=self.clientType, 2806 clientType=self.clientType,
2478 configOverride=self.overrideGlobalConfig) 2807 configOverride=self.overrideGlobalConfig,
2479 2808 )
2809
2480 elif self.lastStartAction in [5, 6]: 2810 elif self.lastStartAction in [5, 6]:
2481 # Ask the client to coverage run the new program. 2811 # Ask the client to coverage run the new program.
2482 self.debugServer.remoteCoverage( 2812 self.debugServer.remoteCoverage(
2483 venvName, fn, argv, wd, env, 2813 venvName,
2814 fn,
2815 argv,
2816 wd,
2817 env,
2484 autoClearShell=self.autoClearShell, 2818 autoClearShell=self.autoClearShell,
2485 erase=self.eraseCoverage, 2819 erase=self.eraseCoverage,
2486 forProject=forProject, 2820 forProject=forProject,
2487 runInConsole=self.runInConsole, 2821 runInConsole=self.runInConsole,
2488 clientType=self.clientType, 2822 clientType=self.clientType,
2489 configOverride=self.overrideGlobalConfig) 2823 configOverride=self.overrideGlobalConfig,
2490 2824 )
2825
2491 elif self.lastStartAction in [7, 8]: 2826 elif self.lastStartAction in [7, 8]:
2492 # Ask the client to profile run the new program. 2827 # Ask the client to profile run the new program.
2493 self.debugServer.remoteProfile( 2828 self.debugServer.remoteProfile(
2494 venvName, fn, argv, wd, env, 2829 venvName,
2830 fn,
2831 argv,
2832 wd,
2833 env,
2495 autoClearShell=self.autoClearShell, 2834 autoClearShell=self.autoClearShell,
2496 erase=self.eraseTimings, 2835 erase=self.eraseTimings,
2497 forProject=forProject, 2836 forProject=forProject,
2498 runInConsole=self.runInConsole, 2837 runInConsole=self.runInConsole,
2499 clientType=self.clientType, 2838 clientType=self.clientType,
2500 configOverride=self.overrideGlobalConfig) 2839 configOverride=self.overrideGlobalConfig,
2501 2840 )
2841
2502 self.stopAct.setEnabled(True) 2842 self.stopAct.setEnabled(True)
2503 2843
2504 def __stopScript(self): 2844 def __stopScript(self):
2505 """ 2845 """
2506 Private slot to stop the running script. 2846 Private slot to stop the running script.
2507 """ 2847 """
2508 self.debugServer.startClient(False) 2848 self.debugServer.startClient(False)
2509 2849
2510 def __passiveDebugStarted(self, fn, exc): 2850 def __passiveDebugStarted(self, fn, exc):
2511 """ 2851 """
2512 Private slot to handle a passive debug session start. 2852 Private slot to handle a passive debug session start.
2513 2853
2514 @param fn filename of the debugged script 2854 @param fn filename of the debugged script
2515 @param exc flag to enable exception reporting of the IDE (boolean) 2855 @param exc flag to enable exception reporting of the IDE (boolean)
2516 """ 2856 """
2517 # Hide all error highlights 2857 # Hide all error highlights
2518 self.viewmanager.unhighlight() 2858 self.viewmanager.unhighlight()
2519 2859
2520 # Set filename of script being debugged 2860 # Set filename of script being debugged
2521 self.ui.currentProg = fn 2861 self.ui.currentProg = fn
2522 2862
2523 # Set exception reporting 2863 # Set exception reporting
2524 self.setExceptionReporting(exc) 2864 self.setExceptionReporting(exc)
2525 2865
2526 # Signal that we have started a debugging session 2866 # Signal that we have started a debugging session
2527 self.debuggingStarted.emit(fn) 2867 self.debuggingStarted.emit(fn)
2528 2868
2529 # Initialize the call stack viewer 2869 # Initialize the call stack viewer
2530 self.debugViewer.initCallStackViewer(False) 2870 self.debugViewer.initCallStackViewer(False)
2531 2871
2532 def __continue(self, debuggerId=""): 2872 def __continue(self, debuggerId=""):
2533 """ 2873 """
2534 Private method to handle the Continue action. 2874 Private method to handle the Continue action.
2535 2875
2536 @param debuggerId ID of the debugger backend 2876 @param debuggerId ID of the debugger backend
2537 @type str 2877 @type str
2538 """ 2878 """
2539 if not debuggerId: 2879 if not debuggerId:
2540 debuggerId = self.getSelectedDebuggerId() 2880 debuggerId = self.getSelectedDebuggerId()
2541 2881
2542 self.lastAction = 0 2882 self.lastAction = 0
2543 self.__enterRemote() 2883 self.__enterRemote()
2544 self.debugServer.remoteContinue(debuggerId) 2884 self.debugServer.remoteContinue(debuggerId)
2545 2885
2546 def __specialContinue(self, debuggerId=""): 2886 def __specialContinue(self, debuggerId=""):
2547 """ 2887 """
2548 Private method to handle the Special Continue action. 2888 Private method to handle the Special Continue action.
2549 2889
2550 @param debuggerId ID of the debugger backend 2890 @param debuggerId ID of the debugger backend
2551 @type str 2891 @type str
2552 """ 2892 """
2553 if not debuggerId: 2893 if not debuggerId:
2554 debuggerId = self.getSelectedDebuggerId() 2894 debuggerId = self.getSelectedDebuggerId()
2555 2895
2556 self.lastAction = 2 2896 self.lastAction = 2
2557 self.__enterRemote() 2897 self.__enterRemote()
2558 self.debugServer.remoteContinue(debuggerId, 1) 2898 self.debugServer.remoteContinue(debuggerId, 1)
2559 2899
2560 def __step(self, debuggerId=""): 2900 def __step(self, debuggerId=""):
2561 """ 2901 """
2562 Private method to handle the Step action. 2902 Private method to handle the Step action.
2563 2903
2564 @param debuggerId ID of the debugger backend 2904 @param debuggerId ID of the debugger backend
2565 @type str 2905 @type str
2566 """ 2906 """
2567 if not debuggerId: 2907 if not debuggerId:
2568 debuggerId = self.getSelectedDebuggerId() 2908 debuggerId = self.getSelectedDebuggerId()
2569 2909
2570 self.lastAction = 1 2910 self.lastAction = 1
2571 self.__enterRemote() 2911 self.__enterRemote()
2572 self.debugServer.remoteStep(debuggerId) 2912 self.debugServer.remoteStep(debuggerId)
2573 2913
2574 def __stepOver(self, debuggerId=""): 2914 def __stepOver(self, debuggerId=""):
2575 """ 2915 """
2576 Private method to handle the Step Over action. 2916 Private method to handle the Step Over action.
2577 2917
2578 @param debuggerId ID of the debugger backend 2918 @param debuggerId ID of the debugger backend
2579 @type str 2919 @type str
2580 """ 2920 """
2581 if not debuggerId: 2921 if not debuggerId:
2582 debuggerId = self.getSelectedDebuggerId() 2922 debuggerId = self.getSelectedDebuggerId()
2583 2923
2584 self.lastAction = 2 2924 self.lastAction = 2
2585 self.__enterRemote() 2925 self.__enterRemote()
2586 self.debugServer.remoteStepOver(debuggerId) 2926 self.debugServer.remoteStepOver(debuggerId)
2587 2927
2588 def __stepOut(self, debuggerId=""): 2928 def __stepOut(self, debuggerId=""):
2589 """ 2929 """
2590 Private method to handle the Step Out action. 2930 Private method to handle the Step Out action.
2591 2931
2592 @param debuggerId ID of the debugger backend 2932 @param debuggerId ID of the debugger backend
2593 @type str 2933 @type str
2594 """ 2934 """
2595 if not debuggerId: 2935 if not debuggerId:
2596 debuggerId = self.getSelectedDebuggerId() 2936 debuggerId = self.getSelectedDebuggerId()
2597 2937
2598 self.lastAction = 3 2938 self.lastAction = 3
2599 self.__enterRemote() 2939 self.__enterRemote()
2600 self.debugServer.remoteStepOut(debuggerId) 2940 self.debugServer.remoteStepOut(debuggerId)
2601 2941
2602 def __stepQuit(self, debuggerId=""): 2942 def __stepQuit(self, debuggerId=""):
2603 """ 2943 """
2604 Private method to handle the Step Quit action. 2944 Private method to handle the Step Quit action.
2605 2945
2606 @param debuggerId ID of the debugger backend 2946 @param debuggerId ID of the debugger backend
2607 @type str 2947 @type str
2608 """ 2948 """
2609 if not debuggerId: 2949 if not debuggerId:
2610 debuggerId = self.getSelectedDebuggerId() 2950 debuggerId = self.getSelectedDebuggerId()
2611 2951
2612 self.lastAction = 4 2952 self.lastAction = 4
2613 self.__enterRemote() 2953 self.__enterRemote()
2614 self.debugServer.remoteStepQuit(debuggerId) 2954 self.debugServer.remoteStepQuit(debuggerId)
2615 self.__resetUI() 2955 self.__resetUI()
2616 2956
2617 def __runToCursor(self, debuggerId=""): 2957 def __runToCursor(self, debuggerId=""):
2618 """ 2958 """
2619 Private method to handle the Run to Cursor action. 2959 Private method to handle the Run to Cursor action.
2620 2960
2621 @param debuggerId ID of the debugger backend 2961 @param debuggerId ID of the debugger backend
2622 @type str 2962 @type str
2623 """ 2963 """
2624 if not debuggerId: 2964 if not debuggerId:
2625 debuggerId = self.getSelectedDebuggerId() 2965 debuggerId = self.getSelectedDebuggerId()
2626 2966
2627 self.lastAction = 0 2967 self.lastAction = 0
2628 aw = self.viewmanager.activeWindow() 2968 aw = self.viewmanager.activeWindow()
2629 line = aw.getCursorPosition()[0] + 1 2969 line = aw.getCursorPosition()[0] + 1
2630 self.__enterRemote() 2970 self.__enterRemote()
2631 self.debugServer.remoteBreakpoint( 2971 self.debugServer.remoteBreakpoint(
2632 self.getSelectedDebuggerId(), 2972 self.getSelectedDebuggerId(), aw.getFileName(), line, 1, None, 1
2633 aw.getFileName(), line, 1, None, 1) 2973 )
2634 self.debugServer.remoteContinue(debuggerId) 2974 self.debugServer.remoteContinue(debuggerId)
2635 2975
2636 def __runUntil(self, debuggerId=""): 2976 def __runUntil(self, debuggerId=""):
2637 """ 2977 """
2638 Private method to handle the Run Until action. 2978 Private method to handle the Run Until action.
2639 2979
2640 @param debuggerId ID of the debugger backend 2980 @param debuggerId ID of the debugger backend
2641 @type str 2981 @type str
2642 """ 2982 """
2643 if not debuggerId: 2983 if not debuggerId:
2644 debuggerId = self.getSelectedDebuggerId() 2984 debuggerId = self.getSelectedDebuggerId()
2645 2985
2646 self.lastAction = 0 2986 self.lastAction = 0
2647 aw = self.viewmanager.activeWindow() 2987 aw = self.viewmanager.activeWindow()
2648 line = aw.getCursorPosition()[0] + 1 2988 line = aw.getCursorPosition()[0] + 1
2649 self.__enterRemote() 2989 self.__enterRemote()
2650 self.debugServer.remoteContinueUntil(debuggerId, line) 2990 self.debugServer.remoteContinueUntil(debuggerId, line)
2651 2991
2652 def __moveInstructionPointer(self, debuggerId=""): 2992 def __moveInstructionPointer(self, debuggerId=""):
2653 """ 2993 """
2654 Private method to move the instruction pointer to a different line. 2994 Private method to move the instruction pointer to a different line.
2655 2995
2656 @param debuggerId ID of the debugger backend 2996 @param debuggerId ID of the debugger backend
2657 @type str 2997 @type str
2658 """ 2998 """
2659 if not debuggerId: 2999 if not debuggerId:
2660 debuggerId = self.getSelectedDebuggerId() 3000 debuggerId = self.getSelectedDebuggerId()
2661 3001
2662 self.lastAction = 0 3002 self.lastAction = 0
2663 aw = self.viewmanager.activeWindow() 3003 aw = self.viewmanager.activeWindow()
2664 line = aw.getCursorPosition()[0] + 1 3004 line = aw.getCursorPosition()[0] + 1
2665 self.debugServer.remoteMoveIP(debuggerId, line) 3005 self.debugServer.remoteMoveIP(debuggerId, line)
2666 3006
2671 This method is called just prior to executing some of 3011 This method is called just prior to executing some of
2672 the program being debugged. 3012 the program being debugged.
2673 """ 3013 """
2674 # Disable further debug commands from the user. 3014 # Disable further debug commands from the user.
2675 self.debugActGrp.setEnabled(False) 3015 self.debugActGrp.setEnabled(False)
2676 3016
2677 self.viewmanager.unhighlight(True) 3017 self.viewmanager.unhighlight(True)
2678 3018
2679 def getActions(self): 3019 def getActions(self):
2680 """ 3020 """
2681 Public method to get a list of all actions. 3021 Public method to get a list of all actions.
2682 3022
2683 @return list of all actions (list of EricAction) 3023 @return list of all actions (list of EricAction)
2684 """ 3024 """
2685 return self.actions[:] 3025 return self.actions[:]
2686 3026
2687 def getSelectedDebuggerId(self): 3027 def getSelectedDebuggerId(self):
2688 """ 3028 """
2689 Public method to get the currently selected debugger ID. 3029 Public method to get the currently selected debugger ID.
2690 3030
2691 @return selected debugger ID 3031 @return selected debugger ID
2692 @rtype str 3032 @rtype str
2693 """ 3033 """
2694 return self.debugViewer.getSelectedDebuggerId() 3034 return self.debugViewer.getSelectedDebuggerId()
2695 3035
2696 def setDebugActionsEnabled(self, enable): 3036 def setDebugActionsEnabled(self, enable):
2697 """ 3037 """
2698 Public method to set the enabled state of the debug actions. 3038 Public method to set the enabled state of the debug actions.
2699 3039
2700 @param enable enable state to be set 3040 @param enable enable state to be set
2701 @type bool 3041 @type bool
2702 """ 3042 """
2703 self.debugActGrp.setEnabled(enable) 3043 self.debugActGrp.setEnabled(enable)
2704 3044
2705 def setMultiprocessNoDebugHistory(self, noDebugList, clearHistories=False, 3045 def setMultiprocessNoDebugHistory(
2706 history=None): 3046 self, noDebugList, clearHistories=False, history=None
3047 ):
2707 """ 3048 """
2708 Public slot to initialize the no debug list history. 3049 Public slot to initialize the no debug list history.
2709 3050
2710 @param noDebugList whitespace separated list of programs not to be 3051 @param noDebugList whitespace separated list of programs not to be
2711 debugged 3052 debugged
2712 @type str 3053 @type str
2713 @param clearHistories flag indicating, that the list should be cleared 3054 @param clearHistories flag indicating, that the list should be cleared
2714 @type bool 3055 @type bool
2721 self.multiprocessNoDebugHistory = history[:] 3062 self.multiprocessNoDebugHistory = history[:]
2722 else: 3063 else:
2723 if noDebugList in self.multiprocessNoDebugHistory: 3064 if noDebugList in self.multiprocessNoDebugHistory:
2724 self.multiprocessNoDebugHistory.remove(noDebugList) 3065 self.multiprocessNoDebugHistory.remove(noDebugList)
2725 self.multiprocessNoDebugHistory.insert(0, noDebugList) 3066 self.multiprocessNoDebugHistory.insert(0, noDebugList)
2726 3067
2727 def setEnableMultiprocess(self, enableMultiprocess): 3068 def setEnableMultiprocess(self, enableMultiprocess):
2728 """ 3069 """
2729 Public slot to initialize the enableMultiprocess flag. 3070 Public slot to initialize the enableMultiprocess flag.
2730 3071
2731 @param enableMultiprocess flag indicating, that the debugger should be 3072 @param enableMultiprocess flag indicating, that the debugger should be
2732 run in multi process mode 3073 run in multi process mode
2733 @type bool 3074 @type bool
2734 """ 3075 """
2735 self.enableMultiprocess = enableMultiprocess 3076 self.enableMultiprocess = enableMultiprocess
2736 3077
2737 def setEnableGlobalConfigOverride(self, overrideData): 3078 def setEnableGlobalConfigOverride(self, overrideData):
2738 """ 3079 """
2739 Public method to initialize the global config override data. 3080 Public method to initialize the global config override data.
2740 3081
2741 @param overrideData dictionary containing a flag indicating to enable 3082 @param overrideData dictionary containing a flag indicating to enable
2742 global config override and a flag indicating to redirect 3083 global config override and a flag indicating to redirect
2743 stdin/stdout/stderr 3084 stdin/stdout/stderr
2744 @type dict 3085 @type dict
2745 """ 3086 """

eric ide

mercurial