src/eric7/Debugger/DebugUI.py

Tue, 10 Dec 2024 15:46:34 +0100

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Tue, 10 Dec 2024 15:46:34 +0100
branch
eric7
changeset 11090
f5f5f5803935
parent 11006
a671918232f3
child 11215
d07c71a34adf
permissions
-rw-r--r--

Updated copyright for 2025.

0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1 # -*- coding: utf-8 -*-
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2
11090
f5f5f5803935 Updated copyright for 2025.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 11006
diff changeset
3 # Copyright (c) 2002 - 2025 Detlev Offenbach <detlev@die-offenbachs.de>
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
4 #
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
5
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
6 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
7 Module implementing the debugger UI.
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
8 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
9
9473
3f23dbf37dbe Resorted the import statements using isort.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9413
diff changeset
10 import contextlib
8163
29fb6d420a25 Debugger
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8162
diff changeset
11 import copy
9473
3f23dbf37dbe Resorted the import statements using isort.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9413
diff changeset
12 import os
10415
af9a6dac2611 Testing
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10321
diff changeset
13 import shlex
9473
3f23dbf37dbe Resorted the import statements using isort.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9413
diff changeset
14
3f23dbf37dbe Resorted the import statements using isort.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9413
diff changeset
15 from PyQt6.QtCore import QKeyCombination, QObject, Qt, pyqtSignal, pyqtSlot
8318
962bce857696 Replaced all imports of PyQt5 to PyQt6 and started to replace code using obsoleted methods and adapt to the PyQt6 enum usage.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8314
diff changeset
16 from PyQt6.QtGui import QKeySequence
9473
3f23dbf37dbe Resorted the import statements using isort.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9413
diff changeset
17 from PyQt6.QtWidgets import QApplication, QDialog, QMenu, QToolBar
3f23dbf37dbe Resorted the import statements using isort.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9413
diff changeset
18
10806
2f6df822e3b9 Moved some functions to the EricUtilities package for consistency and adapted the code base accordingly.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10704
diff changeset
19 from eric7 import EricUtilities, Preferences, Utilities
9473
3f23dbf37dbe Resorted the import statements using isort.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9413
diff changeset
20 from eric7.EricGui import EricPixmapCache
9413
80c06d472826 Changed the eric7 import statements to include the package name (i.e. eric7) in order to not fiddle with sys.path.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9409
diff changeset
21 from eric7.EricGui.EricAction import EricAction, createActionGroup
80c06d472826 Changed the eric7 import statements to include the package name (i.e. eric7) in order to not fiddle with sys.path.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9409
diff changeset
22 from eric7.EricWidgets import EricMessageBox
9473
3f23dbf37dbe Resorted the import statements using isort.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9413
diff changeset
23 from eric7.Globals import recentNameBreakpointConditions
9624
b47dfa7a137d Refactored the Utilities and Globals modules in order to enhance the maintainability.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9576
diff changeset
24 from eric7.SystemUtilities import FileSystemUtilities
9413
80c06d472826 Changed the eric7 import statements to include the package name (i.e. eric7) in order to not fiddle with sys.path.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9409
diff changeset
25 from eric7.UI.Info import Program
80c06d472826 Changed the eric7 import statements to include the package name (i.e. eric7) in order to not fiddle with sys.path.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9409
diff changeset
26 from eric7.UI.NotificationWidget import NotificationTypes
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
27
7251
bc5b1b00560a Continued to resolve code style issue M841.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7229
diff changeset
28 from .DebugClientCapabilities import (
9473
3f23dbf37dbe Resorted the import statements using isort.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9413
diff changeset
29 HasCoverage,
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
30 HasDebugger,
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
31 HasInterpreter,
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
32 HasProfiler,
7251
bc5b1b00560a Continued to resolve code style issue M841.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7229
diff changeset
33 )
7959
44e15eda6506 Improved the Notification system by supporting colored notifications.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7958
diff changeset
34
945
8cd4d08fa9f6 Made code mostly PEP 8 compliant (except all whitespace and line length).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 816
diff changeset
35
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
36 class DebugUI(QObject):
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
37 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
38 Class implementing the debugger part of the UI.
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
39
7377
cc920e534ac0 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7374
diff changeset
40 @signal clientStack(stack, debuggerId) emitted at breaking after a reported
cc920e534ac0 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7374
diff changeset
41 exception
2988
f53c03574697 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2703
diff changeset
42 @signal debuggingStarted(filename) emitted when a debugging session was
f53c03574697 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2703
diff changeset
43 started
10415
af9a6dac2611 Testing
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10321
diff changeset
44 @signal debuggingFinished emitted to signal the end of a debugging session
7928
a78ce4578fed Debugger: some more fixes
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7923
diff changeset
45 @signal resetUI(full) emitted to reset the UI partially or fully
2988
f53c03574697 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2703
diff changeset
46 @signal exceptionInterrupt() emitted after the execution was interrupted
f53c03574697 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2703
diff changeset
47 by an exception and acknowledged by the user
9517
d73c3a1e432b Continued refactoring of the project browser related code in order to extract some as plugins later on.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9482
diff changeset
48 @signal processChangedProjectFiles() emitted to indicate, that changed project files
d73c3a1e432b Continued refactoring of the project browser related code in order to extract some as plugins later on.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9482
diff changeset
49 should be processed
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
50 """
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
51
7377
cc920e534ac0 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7374
diff changeset
52 clientStack = pyqtSignal(list, str)
7928
a78ce4578fed Debugger: some more fixes
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7923
diff changeset
53 resetUI = pyqtSignal(bool)
482
4650a72c307a Continued porting signal/slot usage to the new API.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 481
diff changeset
54 exceptionInterrupt = pyqtSignal()
4650a72c307a Continued porting signal/slot usage to the new API.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 481
diff changeset
55 debuggingStarted = pyqtSignal(str)
10415
af9a6dac2611 Testing
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10321
diff changeset
56 debuggingFinished = pyqtSignal()
9517
d73c3a1e432b Continued refactoring of the project browser related code in order to extract some as plugins later on.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9482
diff changeset
57 processChangedProjectFiles = pyqtSignal()
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
58
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
59 def __init__(self, ui, vm, debugServer, debugViewer, project):
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
60 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
61 Constructor
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
62
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
63 @param ui reference to the main UI
10417
c6011e501282 Modernized some code and converted Debug Client and Debugger source code documentation to the new style.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10415
diff changeset
64 @type UserInterface
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
65 @param vm reference to the viewmanager
10417
c6011e501282 Modernized some code and converted Debug Client and Debugger source code documentation to the new style.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10415
diff changeset
66 @type ViewManager
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
67 @param debugServer reference to the debug server
10417
c6011e501282 Modernized some code and converted Debug Client and Debugger source code documentation to the new style.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10415
diff changeset
68 @type DebugServer
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
69 @param debugViewer reference to the debug viewer widget
10417
c6011e501282 Modernized some code and converted Debug Client and Debugger source code documentation to the new style.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10415
diff changeset
70 @type DebugViewer
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
71 @param project reference to the project object
10417
c6011e501282 Modernized some code and converted Debug Client and Debugger source code documentation to the new style.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10415
diff changeset
72 @type Project
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
73 """
8218
7c09585bd960 Applied some more code simplifications suggested by the new Simplify checker (super(Foo, self) => super()).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8163
diff changeset
74 super().__init__(ui)
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
75
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
76 self.ui = ui
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
77 self.viewmanager = vm
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
78 self.debugServer = debugServer
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
79 self.debugViewer = debugViewer
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
80 self.project = project
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
81
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
82 # Clear some variables
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
83 self.projectOpen = False
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
84 self.editorOpen = False
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
85
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
86 # read the saved debug info values
8637
394377638256 Replaced the direct access to 'Preferences.Prefs.settings' with 'Preferences.getSettings()'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8568
diff changeset
87 self.lastUsedVenvName = Preferences.getSettings().value(
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
88 "DebugInfo/VirtualEnvironment", ""
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
89 )
10806
2f6df822e3b9 Moved some functions to the EricUtilities package for consistency and adapted the code base accordingly.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10704
diff changeset
90 self.scriptsHistory = EricUtilities.toList(
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
91 Preferences.getSettings().value("DebugInfo/ScriptsHistory")
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
92 )
10806
2f6df822e3b9 Moved some functions to the EricUtilities package for consistency and adapted the code base accordingly.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10704
diff changeset
93 self.argvHistory = EricUtilities.toList(
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
94 Preferences.getSettings().value("DebugInfo/ArgumentsHistory")
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
95 )
10806
2f6df822e3b9 Moved some functions to the EricUtilities package for consistency and adapted the code base accordingly.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10704
diff changeset
96 self.wdHistory = EricUtilities.toList(
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
97 Preferences.getSettings().value("DebugInfo/WorkingDirectoryHistory")
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
98 )
10806
2f6df822e3b9 Moved some functions to the EricUtilities package for consistency and adapted the code base accordingly.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10704
diff changeset
99 self.envHistory = EricUtilities.toList(
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
100 Preferences.getSettings().value("DebugInfo/EnvironmentHistory")
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
101 )
10806
2f6df822e3b9 Moved some functions to the EricUtilities package for consistency and adapted the code base accordingly.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10704
diff changeset
102 self.excList = EricUtilities.toList(
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
103 Preferences.getSettings().value("DebugInfo/Exceptions")
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
104 )
10806
2f6df822e3b9 Moved some functions to the EricUtilities package for consistency and adapted the code base accordingly.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10704
diff changeset
105 self.excIgnoreList = EricUtilities.toList(
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
106 Preferences.getSettings().value("DebugInfo/IgnoredExceptions")
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
107 )
10806
2f6df822e3b9 Moved some functions to the EricUtilities package for consistency and adapted the code base accordingly.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10704
diff changeset
108 self.autoClearShell = EricUtilities.toBool(
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
109 Preferences.getSettings().value("DebugInfo/AutoClearShell", True)
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
110 )
10806
2f6df822e3b9 Moved some functions to the EricUtilities package for consistency and adapted the code base accordingly.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10704
diff changeset
111 self.tracePython = EricUtilities.toBool(
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
112 Preferences.getSettings().value("DebugInfo/TracePython", False)
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
113 )
10806
2f6df822e3b9 Moved some functions to the EricUtilities package for consistency and adapted the code base accordingly.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10704
diff changeset
114 self.autoContinue = EricUtilities.toBool(
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
115 Preferences.getSettings().value("DebugInfo/AutoContinue", True)
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
116 )
10806
2f6df822e3b9 Moved some functions to the EricUtilities package for consistency and adapted the code base accordingly.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10704
diff changeset
117 self.reportAllExceptions = EricUtilities.toBool(
10321
4a017fdf316f Debugger
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10306
diff changeset
118 Preferences.getSettings().value("DebugInfo/ReportAllExceptions", False)
4a017fdf316f Debugger
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10306
diff changeset
119 )
10806
2f6df822e3b9 Moved some functions to the EricUtilities package for consistency and adapted the code base accordingly.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10704
diff changeset
120 self.enableMultiprocess = EricUtilities.toBool(
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
121 Preferences.getSettings().value("DebugInfo/EnableMultiprocess", False)
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
122 )
10806
2f6df822e3b9 Moved some functions to the EricUtilities package for consistency and adapted the code base accordingly.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10704
diff changeset
123 self.multiprocessNoDebugHistory = EricUtilities.toList(
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
124 Preferences.getSettings().value("DebugInfo/MultiprocessNoDebugHistory")
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
125 )
8163
29fb6d420a25 Debugger
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8162
diff changeset
126 self.overrideGlobalConfig = {
10806
2f6df822e3b9 Moved some functions to the EricUtilities package for consistency and adapted the code base accordingly.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10704
diff changeset
127 "enable": EricUtilities.toBool(
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
128 Preferences.getSettings().value("DebugInfo/OverrideGlobal", False)
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
129 ),
10806
2f6df822e3b9 Moved some functions to the EricUtilities package for consistency and adapted the code base accordingly.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10704
diff changeset
130 "redirect": EricUtilities.toBool(
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
131 Preferences.getSettings().value("DebugInfo/RedirectStdinStdout", True)
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
132 ),
8163
29fb6d420a25 Debugger
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8162
diff changeset
133 }
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
134
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
135 self.lastDebuggedFile = None
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
136 self.lastStartAction = 0 # 0=None, 1=Script, 2=Project
795
917f1945355c Added a syntax checker function for Python 2 files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 791
diff changeset
137 self.clientType = ""
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
138 self.lastAction = -1
3021
801289962f4e Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3020
diff changeset
139 self.debugActions = [
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
140 self.__continue,
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
141 self.__step,
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
142 self.__stepOver,
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
143 self.__stepOut,
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
144 self.__stepQuit,
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
145 self.__runToCursor,
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
146 self.__runUntil,
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
147 self.__moveInstructionPointer,
3021
801289962f4e Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3020
diff changeset
148 ]
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
149 (
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
150 self.__localsVarFilterList,
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
151 self.__globalsVarFilterList,
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
152 ) = Preferences.getVarFilters()
2988
f53c03574697 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2703
diff changeset
153 self.debugViewer.setVariablesFilter(
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
154 self.__globalsVarFilterList, self.__localsVarFilterList
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
155 )
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
156
7928
a78ce4578fed Debugger: some more fixes
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7923
diff changeset
157 self.__clientDebuggerIds = set()
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
158
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
159 # Connect the signals emitted by the debug-server
481
ad71812ba395 Continued porting signal/slot usage to the new API.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 461
diff changeset
160 debugServer.clientGone.connect(self.__clientGone)
ad71812ba395 Continued porting signal/slot usage to the new API.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 461
diff changeset
161 debugServer.clientLine.connect(self.__clientLine)
7932
c4c6b2784eec Debugger: fixed an issue related to multiprocessing on Windows and macOS because these use the 'spawn' method.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7928
diff changeset
162 debugServer.clientDisconnected.connect(self.__clientDisconnected)
481
ad71812ba395 Continued porting signal/slot usage to the new API.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 461
diff changeset
163 debugServer.clientExit.connect(self.__clientExit)
10415
af9a6dac2611 Testing
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10321
diff changeset
164 debugServer.mainClientExit.connect(self.__mainClientExit)
481
ad71812ba395 Continued porting signal/slot usage to the new API.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 461
diff changeset
165 debugServer.clientSyntaxError.connect(self.__clientSyntaxError)
ad71812ba395 Continued porting signal/slot usage to the new API.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 461
diff changeset
166 debugServer.clientException.connect(self.__clientException)
4366
9445c7cb991f Implemented a signal handler for the Python debug clients.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4303
diff changeset
167 debugServer.clientSignal.connect(self.__clientSignal)
481
ad71812ba395 Continued porting signal/slot usage to the new API.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 461
diff changeset
168 debugServer.clientVariables.connect(self.__clientVariables)
ad71812ba395 Continued porting signal/slot usage to the new API.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 461
diff changeset
169 debugServer.clientVariable.connect(self.__clientVariable)
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
170 debugServer.clientBreakConditionError.connect(self.__clientBreakConditionError)
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
171 debugServer.clientWatchConditionError.connect(self.__clientWatchConditionError)
481
ad71812ba395 Continued porting signal/slot usage to the new API.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 461
diff changeset
172 debugServer.passiveDebugStarted.connect(self.__passiveDebugStarted)
ad71812ba395 Continued porting signal/slot usage to the new API.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 461
diff changeset
173 debugServer.clientThreadSet.connect(self.__clientThreadSet)
7928
a78ce4578fed Debugger: some more fixes
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7923
diff changeset
174 debugServer.clientDebuggerId.connect(self.__clientDebuggerId)
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
175
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
176 # Connect the signals emitted by the viewmanager
486
e4711a55e482 Continued porting signal/slot usage to the new API.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 482
diff changeset
177 vm.editorOpened.connect(self.__editorOpened)
e4711a55e482 Continued porting signal/slot usage to the new API.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 482
diff changeset
178 vm.lastEditorClosed.connect(self.__lastEditorClosed)
e4711a55e482 Continued porting signal/slot usage to the new API.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 482
diff changeset
179 vm.checkActions.connect(self.__checkActions)
e4711a55e482 Continued porting signal/slot usage to the new API.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 482
diff changeset
180 vm.cursorChanged.connect(self.__cursorChanged)
e4711a55e482 Continued porting signal/slot usage to the new API.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 482
diff changeset
181 vm.breakpointToggled.connect(self.__cursorChanged)
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
182
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
183 # Connect the signals emitted by the project
486
e4711a55e482 Continued porting signal/slot usage to the new API.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 482
diff changeset
184 project.projectOpened.connect(self.__projectOpened)
e4711a55e482 Continued porting signal/slot usage to the new API.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 482
diff changeset
185 project.newProject.connect(self.__projectOpened)
e4711a55e482 Continued porting signal/slot usage to the new API.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 482
diff changeset
186 project.projectClosed.connect(self.__projectClosed)
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
187
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
188 # Set a flag for the passive debug mode
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
189 self.passive = Preferences.getDebugger("PassiveDbgEnabled")
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
190
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
191 def showNotification(
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
192 self, notification, kind=NotificationTypes.INFORMATION, timeout=None
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
193 ):
7876
9164a5c0d4a6 Debugger UI: added code to show a notification when a new debug client has been connected.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7874
diff changeset
194 """
9164a5c0d4a6 Debugger UI: added code to show a notification when a new debug client has been connected.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7874
diff changeset
195 Public method to show some notification message.
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
196
7945
76daafe10009 Removed code dealing with Qt versions less than the required one and removed use of QDesktopWidget or QApplication.desktop().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7933
diff changeset
197 @param notification message to be shown
7876
9164a5c0d4a6 Debugger UI: added code to show a notification when a new debug client has been connected.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7874
diff changeset
198 @type str
7959
44e15eda6506 Improved the Notification system by supporting colored notifications.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7958
diff changeset
199 @param kind kind of notification to be shown
44e15eda6506 Improved the Notification system by supporting colored notifications.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7958
diff changeset
200 @type NotificationTypes
7955
567f2ec958c3 Changed code to always use the reworked notification system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7945
diff changeset
201 @param timeout timeout for the notification (None = use configured
567f2ec958c3 Changed code to always use the reworked notification system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7945
diff changeset
202 default, 0 = indefinitely)
567f2ec958c3 Changed code to always use the reworked notification system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7945
diff changeset
203 @type int
7876
9164a5c0d4a6 Debugger UI: added code to show a notification when a new debug client has been connected.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7874
diff changeset
204 """
7955
567f2ec958c3 Changed code to always use the reworked notification system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7945
diff changeset
205 self.ui.showNotification(
9413
80c06d472826 Changed the eric7 import statements to include the package name (i.e. eric7) in order to not fiddle with sys.path.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9409
diff changeset
206 EricPixmapCache.getPixmap("debug48"),
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
207 self.tr("Notification"),
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
208 notification,
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
209 kind=kind,
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
210 timeout=timeout,
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
211 )
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
212
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
213 def variablesFilter(self, scope):
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
214 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
215 Public method to get the variables filter for a scope.
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
216
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
217 @param scope flag indicating global (True) or local (False) scope
10417
c6011e501282 Modernized some code and converted Debug Client and Debugger source code documentation to the new style.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10415
diff changeset
218 @type bool
7862
817ef8e0fa66 Debugger: changed the handling of variable type filters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7857
diff changeset
219 @return filters list
817ef8e0fa66 Debugger: changed the handling of variable type filters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7857
diff changeset
220 @rtype list of str
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
221 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
222 if scope:
7862
817ef8e0fa66 Debugger: changed the handling of variable type filters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7857
diff changeset
223 return self.__globalsVarFilterList[:]
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
224 else:
7862
817ef8e0fa66 Debugger: changed the handling of variable type filters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7857
diff changeset
225 return self.__localsVarFilterList[:]
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
226
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
227 def initActions(self):
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
228 """
3591
2f2a4a76dd22 Corrected a bunch of source docu issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3484
diff changeset
229 Public method defining the user interface actions.
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
230 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
231 self.actions = []
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
232
8356
68ec9c3d4de5 Renamed the modules and classes of the E5Gui package to have the prefix 'Eric' instead of 'E5'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8336
diff changeset
233 self.runAct = EricAction(
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
234 self.tr("Run Script"),
9413
80c06d472826 Changed the eric7 import statements to include the package name (i.e. eric7) in order to not fiddle with sys.path.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9409
diff changeset
235 EricPixmapCache.getIcon("runScript"),
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
236 self.tr("&Run Script..."),
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
237 Qt.Key.Key_F2,
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
238 0,
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
239 self,
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
240 "dbg_run_script",
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
241 )
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
242 self.runAct.setStatusTip(self.tr("Run the current Script"))
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
243 self.runAct.setWhatsThis(
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
244 self.tr(
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
245 """<b>Run Script</b>"""
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
246 """<p>Set the command line arguments and run the script outside"""
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
247 """ the debugger. If the file has unsaved changes it may be"""
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
248 """ saved first.</p>"""
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
249 )
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
250 )
3345
071afe8be2a1 Changed signal/slot usage to not use constructs like 'triggered[()].connect(...)' anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3190
diff changeset
251 self.runAct.triggered.connect(self.__runScript)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
252 self.actions.append(self.runAct)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
253
8356
68ec9c3d4de5 Renamed the modules and classes of the E5Gui package to have the prefix 'Eric' instead of 'E5'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8336
diff changeset
254 self.runProjectAct = EricAction(
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
255 self.tr("Run Project"),
9413
80c06d472826 Changed the eric7 import statements to include the package name (i.e. eric7) in order to not fiddle with sys.path.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9409
diff changeset
256 EricPixmapCache.getIcon("runProject"),
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
257 self.tr("Run &Project..."),
8318
962bce857696 Replaced all imports of PyQt5 to PyQt6 and started to replace code using obsoleted methods and adapt to the PyQt6 enum usage.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8314
diff changeset
258 QKeyCombination(Qt.Modifier.SHIFT, Qt.Key.Key_F2),
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
259 0,
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
260 self,
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
261 "dbg_run_project",
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
262 )
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
263 self.runProjectAct.setStatusTip(self.tr("Run the current Project"))
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
264 self.runProjectAct.setWhatsThis(
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
265 self.tr(
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
266 """<b>Run Project</b>"""
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
267 """<p>Set the command line arguments and run the current project"""
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
268 """ outside the debugger."""
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
269 """ If files of the current project have unsaved changes they"""
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
270 """ may be saved first.</p>"""
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
271 )
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
272 )
3345
071afe8be2a1 Changed signal/slot usage to not use constructs like 'triggered[()].connect(...)' anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3190
diff changeset
273 self.runProjectAct.triggered.connect(self.__runProject)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
274 self.actions.append(self.runProjectAct)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
275
8356
68ec9c3d4de5 Renamed the modules and classes of the E5Gui package to have the prefix 'Eric' instead of 'E5'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8336
diff changeset
276 self.coverageAct = EricAction(
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
277 self.tr("Coverage run of Script"),
9413
80c06d472826 Changed the eric7 import statements to include the package name (i.e. eric7) in order to not fiddle with sys.path.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9409
diff changeset
278 EricPixmapCache.getIcon("coverageScript"),
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
279 self.tr("Coverage run of Script..."),
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
280 0,
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
281 0,
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
282 self,
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
283 "dbg_coverage_script",
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
284 )
564
b3d966393ba9 Did some code cleanup.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 553
diff changeset
285 self.coverageAct.setStatusTip(
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
286 self.tr("Perform a coverage run of the current Script")
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
287 )
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
288 self.coverageAct.setWhatsThis(
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
289 self.tr(
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
290 """<b>Coverage run of Script</b>"""
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
291 """<p>Set the command line arguments and run the script under"""
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
292 """ the control of a coverage analysis tool. If the file has"""
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
293 """ unsaved changes it may be saved first.</p>"""
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
294 )
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
295 )
3345
071afe8be2a1 Changed signal/slot usage to not use constructs like 'triggered[()].connect(...)' anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3190
diff changeset
296 self.coverageAct.triggered.connect(self.__coverageScript)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
297 self.actions.append(self.coverageAct)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
298
8356
68ec9c3d4de5 Renamed the modules and classes of the E5Gui package to have the prefix 'Eric' instead of 'E5'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8336
diff changeset
299 self.coverageProjectAct = EricAction(
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
300 self.tr("Coverage run of Project"),
9413
80c06d472826 Changed the eric7 import statements to include the package name (i.e. eric7) in order to not fiddle with sys.path.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9409
diff changeset
301 EricPixmapCache.getIcon("coverageProject"),
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
302 self.tr("Coverage run of Project..."),
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
303 0,
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
304 0,
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
305 self,
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
306 "dbg_coverage_project",
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
307 )
564
b3d966393ba9 Did some code cleanup.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 553
diff changeset
308 self.coverageProjectAct.setStatusTip(
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
309 self.tr("Perform a coverage run of the current Project")
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
310 )
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
311 self.coverageProjectAct.setWhatsThis(
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
312 self.tr(
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
313 """<b>Coverage run of Project</b>"""
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
314 """<p>Set the command line arguments and run the current project"""
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
315 """ under the control of a coverage analysis tool."""
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
316 """ If files of the current project have unsaved changes"""
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
317 """ they may be saved first.</p>"""
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
318 )
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
319 )
3345
071afe8be2a1 Changed signal/slot usage to not use constructs like 'triggered[()].connect(...)' anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3190
diff changeset
320 self.coverageProjectAct.triggered.connect(self.__coverageProject)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
321 self.actions.append(self.coverageProjectAct)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
322
8356
68ec9c3d4de5 Renamed the modules and classes of the E5Gui package to have the prefix 'Eric' instead of 'E5'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8336
diff changeset
323 self.profileAct = EricAction(
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
324 self.tr("Profile Script"),
9413
80c06d472826 Changed the eric7 import statements to include the package name (i.e. eric7) in order to not fiddle with sys.path.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9409
diff changeset
325 EricPixmapCache.getIcon("profileScript"),
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
326 self.tr("Profile Script..."),
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
327 0,
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
328 0,
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
329 self,
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
330 "dbg_profile_script",
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
331 )
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
332 self.profileAct.setStatusTip(self.tr("Profile the current Script"))
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
333 self.profileAct.setWhatsThis(
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
334 self.tr(
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
335 """<b>Profile Script</b>"""
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
336 """<p>Set the command line arguments and profile the script."""
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
337 """ If the file has unsaved changes it may be saved first.</p>"""
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
338 )
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
339 )
3345
071afe8be2a1 Changed signal/slot usage to not use constructs like 'triggered[()].connect(...)' anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3190
diff changeset
340 self.profileAct.triggered.connect(self.__profileScript)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
341 self.actions.append(self.profileAct)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
342
8356
68ec9c3d4de5 Renamed the modules and classes of the E5Gui package to have the prefix 'Eric' instead of 'E5'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8336
diff changeset
343 self.profileProjectAct = EricAction(
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
344 self.tr("Profile Project"),
9413
80c06d472826 Changed the eric7 import statements to include the package name (i.e. eric7) in order to not fiddle with sys.path.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9409
diff changeset
345 EricPixmapCache.getIcon("profileProject"),
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
346 self.tr("Profile Project..."),
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
347 0,
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
348 0,
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
349 self,
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
350 "dbg_profile_project",
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
351 )
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
352 self.profileProjectAct.setStatusTip(self.tr("Profile the current Project"))
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
353 self.profileProjectAct.setWhatsThis(
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
354 self.tr(
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
355 """<b>Profile Project</b>"""
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
356 """<p>Set the command line arguments and profile the current"""
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
357 """ project. If files of the current project have unsaved"""
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
358 """ changes they may be saved first.</p>"""
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
359 )
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
360 )
3345
071afe8be2a1 Changed signal/slot usage to not use constructs like 'triggered[()].connect(...)' anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3190
diff changeset
361 self.profileProjectAct.triggered.connect(self.__profileProject)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
362 self.actions.append(self.profileProjectAct)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
363
8356
68ec9c3d4de5 Renamed the modules and classes of the E5Gui package to have the prefix 'Eric' instead of 'E5'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8336
diff changeset
364 self.debugAct = EricAction(
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
365 self.tr("Debug Script"),
9413
80c06d472826 Changed the eric7 import statements to include the package name (i.e. eric7) in order to not fiddle with sys.path.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9409
diff changeset
366 EricPixmapCache.getIcon("debugScript"),
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
367 self.tr("&Debug Script..."),
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
368 Qt.Key.Key_F5,
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
369 0,
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
370 self,
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
371 "dbg_debug_script",
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
372 )
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
373 self.debugAct.setStatusTip(self.tr("Debug the current Script"))
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
374 self.debugAct.setWhatsThis(
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
375 self.tr(
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
376 """<b>Debug Script</b>"""
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
377 """<p>Set the command line arguments and set the current line"""
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
378 """ to be the first executable Python statement of the current"""
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
379 """ editor window. If the file has unsaved changes it may be"""
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
380 """ saved first.</p>"""
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
381 )
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
382 )
3345
071afe8be2a1 Changed signal/slot usage to not use constructs like 'triggered[()].connect(...)' anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3190
diff changeset
383 self.debugAct.triggered.connect(self.__debugScript)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
384 self.actions.append(self.debugAct)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
385
8356
68ec9c3d4de5 Renamed the modules and classes of the E5Gui package to have the prefix 'Eric' instead of 'E5'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8336
diff changeset
386 self.debugProjectAct = EricAction(
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
387 self.tr("Debug Project"),
9413
80c06d472826 Changed the eric7 import statements to include the package name (i.e. eric7) in order to not fiddle with sys.path.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9409
diff changeset
388 EricPixmapCache.getIcon("debugProject"),
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
389 self.tr("Debug &Project..."),
8318
962bce857696 Replaced all imports of PyQt5 to PyQt6 and started to replace code using obsoleted methods and adapt to the PyQt6 enum usage.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8314
diff changeset
390 QKeyCombination(Qt.Modifier.SHIFT, Qt.Key.Key_F5),
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
391 0,
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
392 self,
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
393 "dbg_debug_project",
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
394 )
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
395 self.debugProjectAct.setStatusTip(self.tr("Debug the current Project"))
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
396 self.debugProjectAct.setWhatsThis(
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
397 self.tr(
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
398 """<b>Debug Project</b>"""
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
399 """<p>Set the command line arguments and set the current line"""
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
400 """ to be the first executable Python statement of the main"""
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
401 """ script of the current project. If files of the current"""
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
402 """ project have unsaved changes they may be saved first.</p>"""
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
403 )
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
404 )
3345
071afe8be2a1 Changed signal/slot usage to not use constructs like 'triggered[()].connect(...)' anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3190
diff changeset
405 self.debugProjectAct.triggered.connect(self.__debugProject)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
406 self.actions.append(self.debugProjectAct)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
407
8356
68ec9c3d4de5 Renamed the modules and classes of the E5Gui package to have the prefix 'Eric' instead of 'E5'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8336
diff changeset
408 self.restartAct = EricAction(
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
409 self.tr("Restart"),
9413
80c06d472826 Changed the eric7 import statements to include the package name (i.e. eric7) in order to not fiddle with sys.path.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9409
diff changeset
410 EricPixmapCache.getIcon("debugRestart"),
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
411 self.tr("Restart"),
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
412 Qt.Key.Key_F4,
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
413 0,
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
414 self,
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
415 "dbg_restart_script",
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
416 )
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
417 self.restartAct.setStatusTip(self.tr("Restart the last debugged script"))
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
418 self.restartAct.setWhatsThis(
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
419 self.tr(
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
420 """<b>Restart</b>"""
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
421 """<p>Set the command line arguments and set the current line"""
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
422 """ to be the first executable Python statement of the script"""
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
423 """ that was debugged last. If there are unsaved changes, they"""
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
424 """ may be saved first.</p>"""
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
425 )
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
426 )
3345
071afe8be2a1 Changed signal/slot usage to not use constructs like 'triggered[()].connect(...)' anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3190
diff changeset
427 self.restartAct.triggered.connect(self.__doRestart)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
428 self.actions.append(self.restartAct)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
429
8356
68ec9c3d4de5 Renamed the modules and classes of the E5Gui package to have the prefix 'Eric' instead of 'E5'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8336
diff changeset
430 self.stopAct = EricAction(
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
431 self.tr("Stop"),
9413
80c06d472826 Changed the eric7 import statements to include the package name (i.e. eric7) in order to not fiddle with sys.path.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9409
diff changeset
432 EricPixmapCache.getIcon("stopScript"),
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
433 self.tr("Stop"),
8318
962bce857696 Replaced all imports of PyQt5 to PyQt6 and started to replace code using obsoleted methods and adapt to the PyQt6 enum usage.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8314
diff changeset
434 QKeyCombination(Qt.Modifier.SHIFT, Qt.Key.Key_F10),
962bce857696 Replaced all imports of PyQt5 to PyQt6 and started to replace code using obsoleted methods and adapt to the PyQt6 enum usage.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8314
diff changeset
435 0,
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
436 self,
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
437 "dbg_stop_script",
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
438 )
3190
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
439 self.stopAct.setStatusTip(self.tr("""Stop the running script."""))
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
440 self.stopAct.setWhatsThis(
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
441 self.tr(
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
442 """<b>Stop</b>"""
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
443 """<p>This stops the script running in the debugger backend.</p>"""
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
444 )
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
445 )
3345
071afe8be2a1 Changed signal/slot usage to not use constructs like 'triggered[()].connect(...)' anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3190
diff changeset
446 self.stopAct.triggered.connect(self.__stopScript)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
447 self.actions.append(self.stopAct)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
448
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
449 self.debugActGrp = createActionGroup(self)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
450
8356
68ec9c3d4de5 Renamed the modules and classes of the E5Gui package to have the prefix 'Eric' instead of 'E5'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8336
diff changeset
451 act = EricAction(
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
452 self.tr("Continue"),
9413
80c06d472826 Changed the eric7 import statements to include the package name (i.e. eric7) in order to not fiddle with sys.path.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9409
diff changeset
453 EricPixmapCache.getIcon("continue"),
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
454 self.tr("&Continue"),
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
455 Qt.Key.Key_F6,
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
456 0,
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
457 self.debugActGrp,
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
458 "dbg_continue",
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
459 )
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
460 act.setStatusTip(self.tr("Continue running the program from the current line"))
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
461 act.setWhatsThis(
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
462 self.tr(
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
463 """<b>Continue</b>"""
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
464 """<p>Continue running the program from the current line. The"""
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
465 """ program will stop when it terminates or when a breakpoint"""
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
466 """ is reached.</p>"""
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
467 )
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
468 )
3345
071afe8be2a1 Changed signal/slot usage to not use constructs like 'triggered[()].connect(...)' anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3190
diff changeset
469 act.triggered.connect(self.__continue)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
470 self.actions.append(act)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
471
8356
68ec9c3d4de5 Renamed the modules and classes of the E5Gui package to have the prefix 'Eric' instead of 'E5'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8336
diff changeset
472 act = EricAction(
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
473 self.tr("Continue to Cursor"),
9413
80c06d472826 Changed the eric7 import statements to include the package name (i.e. eric7) in order to not fiddle with sys.path.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9409
diff changeset
474 EricPixmapCache.getIcon("continueToCursor"),
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
475 self.tr("Continue &To Cursor"),
8318
962bce857696 Replaced all imports of PyQt5 to PyQt6 and started to replace code using obsoleted methods and adapt to the PyQt6 enum usage.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8314
diff changeset
476 QKeyCombination(Qt.Modifier.SHIFT, Qt.Key.Key_F6),
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
477 0,
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
478 self.debugActGrp,
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
479 "dbg_continue_to_cursor",
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
480 )
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
481 act.setStatusTip(
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
482 self.tr(
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
483 """Continue running the program from the"""
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
484 """ current line to the current cursor position"""
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
485 )
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
486 )
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
487 act.setWhatsThis(
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
488 self.tr(
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
489 """<b>Continue To Cursor</b>"""
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
490 """<p>Continue running the program from the current line to the"""
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
491 """ current cursor position.</p>"""
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
492 )
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
493 )
3345
071afe8be2a1 Changed signal/slot usage to not use constructs like 'triggered[()].connect(...)' anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3190
diff changeset
494 act.triggered.connect(self.__runToCursor)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
495 self.actions.append(act)
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
496
8356
68ec9c3d4de5 Renamed the modules and classes of the E5Gui package to have the prefix 'Eric' instead of 'E5'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8336
diff changeset
497 act = EricAction(
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
498 self.tr("Continue Until"),
9413
80c06d472826 Changed the eric7 import statements to include the package name (i.e. eric7) in order to not fiddle with sys.path.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9409
diff changeset
499 EricPixmapCache.getIcon("continueUntil"),
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
500 self.tr("Continue &Until"),
8318
962bce857696 Replaced all imports of PyQt5 to PyQt6 and started to replace code using obsoleted methods and adapt to the PyQt6 enum usage.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8314
diff changeset
501 QKeyCombination(Qt.Modifier.CTRL, Qt.Key.Key_F6),
962bce857696 Replaced all imports of PyQt5 to PyQt6 and started to replace code using obsoleted methods and adapt to the PyQt6 enum usage.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8314
diff changeset
502 0,
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
503 self.debugActGrp,
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
504 "dbg_continue_until",
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
505 )
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
506 act.setStatusTip(
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
507 self.tr(
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
508 """Continue running the program from the current line to the"""
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
509 """ current cursor position or until leaving the current frame"""
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
510 )
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
511 )
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
512 act.setWhatsThis(
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
513 self.tr(
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
514 """<b>Continue Until</b>"""
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
515 """<p>Continue running the program from the current line to the"""
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
516 """ cursor position greater than the current line or until"""
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
517 """ leaving the current frame.</p>"""
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
518 )
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
519 )
7897
9acc015ea443 Debugger: added support for the "Continue Until" debug action.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7876
diff changeset
520 act.triggered.connect(self.__runUntil)
9acc015ea443 Debugger: added support for the "Continue Until" debug action.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7876
diff changeset
521 self.actions.append(act)
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
522
8356
68ec9c3d4de5 Renamed the modules and classes of the E5Gui package to have the prefix 'Eric' instead of 'E5'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8336
diff changeset
523 act = EricAction(
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
524 self.tr("Move Instruction Pointer to Cursor"),
9413
80c06d472826 Changed the eric7 import statements to include the package name (i.e. eric7) in order to not fiddle with sys.path.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9409
diff changeset
525 EricPixmapCache.getIcon("moveInstructionPointer"),
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
526 self.tr("&Jump To Cursor"),
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
527 Qt.Key.Key_F12,
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
528 0,
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
529 self.debugActGrp,
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
530 "dbg_jump_to_cursor",
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
531 )
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
532 act.setStatusTip(
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
533 self.tr(
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
534 """Skip the code from the"""
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
535 """ current line to the current cursor position"""
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
536 )
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
537 )
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
538 act.setWhatsThis(
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
539 self.tr(
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
540 """<b>Move Instruction Pointer to Cursor</b>"""
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
541 """<p>Move the Python internal instruction pointer to the"""
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
542 """ current cursor position without executing the code in"""
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
543 """ between.</p>"""
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
544 """<p>It's not possible to jump out of a function or jump"""
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
545 """ in a code block, e.g. a loop. In these cases, a error"""
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
546 """ message is printed to the log window.</p>"""
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
547 )
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
548 )
5658
e5f6fe5855fd move the instruction pointer within the current function (Hotkey: F12)
T.Rzepka <Tobias.Rzepka@gmail.com>
parents: 5590
diff changeset
549 act.triggered.connect(self.__moveInstructionPointer)
e5f6fe5855fd move the instruction pointer within the current function (Hotkey: F12)
T.Rzepka <Tobias.Rzepka@gmail.com>
parents: 5590
diff changeset
550 self.actions.append(act)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
551
8356
68ec9c3d4de5 Renamed the modules and classes of the E5Gui package to have the prefix 'Eric' instead of 'E5'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8336
diff changeset
552 act = EricAction(
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
553 self.tr("Single Step"),
9413
80c06d472826 Changed the eric7 import statements to include the package name (i.e. eric7) in order to not fiddle with sys.path.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9409
diff changeset
554 EricPixmapCache.getIcon("step"),
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
555 self.tr("Sin&gle Step"),
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
556 Qt.Key.Key_F7,
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
557 0,
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
558 self.debugActGrp,
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
559 "dbg_single_step",
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
560 )
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
561 act.setStatusTip(self.tr("Execute a single Python statement"))
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
562 act.setWhatsThis(
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
563 self.tr(
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
564 """<b>Single Step</b>"""
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
565 """<p>Execute a single Python statement. If the statement"""
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
566 """ is an <tt>import</tt> statement, a class constructor, or a"""
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
567 """ method or function call then control is returned to the"""
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
568 """ debugger at the next statement.</p>"""
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
569 )
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
570 )
3345
071afe8be2a1 Changed signal/slot usage to not use constructs like 'triggered[()].connect(...)' anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3190
diff changeset
571 act.triggered.connect(self.__step)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
572 self.actions.append(act)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
573
8356
68ec9c3d4de5 Renamed the modules and classes of the E5Gui package to have the prefix 'Eric' instead of 'E5'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8336
diff changeset
574 act = EricAction(
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
575 self.tr("Step Over"),
9413
80c06d472826 Changed the eric7 import statements to include the package name (i.e. eric7) in order to not fiddle with sys.path.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9409
diff changeset
576 EricPixmapCache.getIcon("stepOver"),
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
577 self.tr("Step &Over"),
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
578 Qt.Key.Key_F8,
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
579 0,
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
580 self.debugActGrp,
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
581 "dbg_step_over",
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
582 )
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
583 act.setStatusTip(
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
584 self.tr(
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
585 """Execute a single Python statement staying"""
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
586 """ in the current frame"""
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
587 )
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
588 )
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
589 act.setWhatsThis(
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
590 self.tr(
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
591 """<b>Step Over</b>"""
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
592 """<p>Execute a single Python statement staying in the same"""
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
593 """ frame. If the statement is an <tt>import</tt> statement,"""
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
594 """ a class constructor, or a method or function call then"""
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
595 """ control is returned to the debugger after the statement"""
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
596 """ has completed.</p>"""
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
597 )
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
598 )
3345
071afe8be2a1 Changed signal/slot usage to not use constructs like 'triggered[()].connect(...)' anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3190
diff changeset
599 act.triggered.connect(self.__stepOver)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
600 self.actions.append(act)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
601
8356
68ec9c3d4de5 Renamed the modules and classes of the E5Gui package to have the prefix 'Eric' instead of 'E5'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8336
diff changeset
602 act = EricAction(
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
603 self.tr("Step Out"),
9413
80c06d472826 Changed the eric7 import statements to include the package name (i.e. eric7) in order to not fiddle with sys.path.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9409
diff changeset
604 EricPixmapCache.getIcon("stepOut"),
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
605 self.tr("Step Ou&t"),
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
606 Qt.Key.Key_F9,
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
607 0,
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
608 self.debugActGrp,
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
609 "dbg_step_out",
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
610 )
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
611 act.setStatusTip(
9576
be9f8e7e42e0 Corrected some 'wrong' string quotes caused by the Black line merging.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9573
diff changeset
612 self.tr("""Execute Python statements until leaving the current frame""")
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
613 )
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
614 act.setWhatsThis(
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
615 self.tr(
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
616 """<b>Step Out</b>"""
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
617 """<p>Execute Python statements until leaving the current"""
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
618 """ frame. If the statements are inside an <tt>import</tt>"""
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
619 """ statement, a class constructor, or a method or function"""
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
620 """ call then control is returned to the debugger after the"""
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
621 """ current frame has been left.</p>"""
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
622 )
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
623 )
3345
071afe8be2a1 Changed signal/slot usage to not use constructs like 'triggered[()].connect(...)' anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3190
diff changeset
624 act.triggered.connect(self.__stepOut)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
625 self.actions.append(act)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
626
8356
68ec9c3d4de5 Renamed the modules and classes of the E5Gui package to have the prefix 'Eric' instead of 'E5'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8336
diff changeset
627 act = EricAction(
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
628 self.tr("Stop"),
9413
80c06d472826 Changed the eric7 import statements to include the package name (i.e. eric7) in order to not fiddle with sys.path.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9409
diff changeset
629 EricPixmapCache.getIcon("stepQuit"),
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
630 self.tr("&Stop"),
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
631 Qt.Key.Key_F10,
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
632 0,
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
633 self.debugActGrp,
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
634 "dbg_stop",
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
635 )
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
636 act.setStatusTip(self.tr("Stop debugging"))
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
637 act.setWhatsThis(
9573
9960d19d66b5 Corrected some 'wrong' string quotes caused by the Black line merging.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9541
diff changeset
638 self.tr("""<b>Stop</b><p>Stop the running debugging session.</p>""")
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
639 )
3345
071afe8be2a1 Changed signal/slot usage to not use constructs like 'triggered[()].connect(...)' anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3190
diff changeset
640 act.triggered.connect(self.__stepQuit)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
641 self.actions.append(act)
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
642
8356
68ec9c3d4de5 Renamed the modules and classes of the E5Gui package to have the prefix 'Eric' instead of 'E5'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8336
diff changeset
643 self.dbgFilterAct = EricAction(
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
644 self.tr("Variables Type Filter"),
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
645 self.tr("Varia&bles Type Filter..."),
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
646 0,
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
647 0,
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
648 self,
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
649 "dbg_variables_filter",
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
650 )
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
651 self.dbgFilterAct.setStatusTip(self.tr("Configure variables type filter"))
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
652 self.dbgFilterAct.setWhatsThis(
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
653 self.tr(
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
654 """<b>Variables Type Filter</b>"""
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
655 """<p>Configure the variables type filter. Only variable types"""
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
656 """ that are not selected are displayed in the global or local"""
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
657 """ variables window during a debugging session.</p>"""
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
658 )
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
659 )
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
660 self.dbgFilterAct.triggered.connect(self.__configureVariablesFilters)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
661 self.actions.append(self.dbgFilterAct)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
662
8356
68ec9c3d4de5 Renamed the modules and classes of the E5Gui package to have the prefix 'Eric' instead of 'E5'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8336
diff changeset
663 self.excFilterAct = EricAction(
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
664 self.tr("Exceptions Filter"),
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
665 self.tr("&Exceptions Filter..."),
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
666 0,
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
667 0,
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
668 self,
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
669 "dbg_exceptions_filter",
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
670 )
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
671 self.excFilterAct.setStatusTip(self.tr("Configure exceptions filter"))
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
672 self.excFilterAct.setWhatsThis(
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
673 self.tr(
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
674 """<b>Exceptions Filter</b>"""
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
675 """<p>Configure the exceptions filter. Only exception types"""
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
676 """ that are listed are highlighted during a debugging"""
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
677 """ session.</p><p>Please note, that all unhandled exceptions"""
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
678 """ are highlighted indepent from the filter list.</p>"""
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
679 )
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
680 )
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
681 self.excFilterAct.triggered.connect(self.__configureExceptionsFilter)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
682 self.actions.append(self.excFilterAct)
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
683
8356
68ec9c3d4de5 Renamed the modules and classes of the E5Gui package to have the prefix 'Eric' instead of 'E5'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8336
diff changeset
684 self.excIgnoreFilterAct = EricAction(
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
685 self.tr("Ignored Exceptions"),
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
686 self.tr("&Ignored Exceptions..."),
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
687 0,
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
688 0,
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
689 self,
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
690 "dbg_ignored_exceptions",
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
691 )
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
692 self.excIgnoreFilterAct.setStatusTip(self.tr("Configure ignored exceptions"))
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
693 self.excIgnoreFilterAct.setWhatsThis(
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
694 self.tr(
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
695 """<b>Ignored Exceptions</b>"""
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
696 """<p>Configure the ignored exceptions. Only exception types"""
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
697 """ that are not listed are highlighted during a debugging"""
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
698 """ session.</p><p>Please note, that unhandled exceptions"""
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
699 """ cannot be ignored.</p>"""
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
700 )
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
701 )
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
702 self.excIgnoreFilterAct.triggered.connect(self.__configureIgnoredExceptions)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
703 self.actions.append(self.excIgnoreFilterAct)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
704
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
705 self.dbgSetBpActGrp = createActionGroup(self)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
706
8356
68ec9c3d4de5 Renamed the modules and classes of the E5Gui package to have the prefix 'Eric' instead of 'E5'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8336
diff changeset
707 self.dbgToggleBpAct = EricAction(
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
708 self.tr("Toggle Breakpoint"),
9413
80c06d472826 Changed the eric7 import statements to include the package name (i.e. eric7) in order to not fiddle with sys.path.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9409
diff changeset
709 EricPixmapCache.getIcon("breakpointToggle"),
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
710 self.tr("Toggle Breakpoint"),
3190
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
711 QKeySequence(self.tr("Shift+F11", "Debug|Toggle Breakpoint")),
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
712 0,
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
713 self.dbgSetBpActGrp,
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
714 "dbg_toggle_breakpoint",
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
715 )
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
716 self.dbgToggleBpAct.setStatusTip(self.tr("Toggle Breakpoint"))
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
717 self.dbgToggleBpAct.setWhatsThis(
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
718 self.tr(
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
719 """<b>Toggle Breakpoint</b>"""
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
720 """<p>Toggles a breakpoint at the current line of the"""
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
721 """ current editor.</p>"""
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
722 )
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
723 )
3345
071afe8be2a1 Changed signal/slot usage to not use constructs like 'triggered[()].connect(...)' anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3190
diff changeset
724 self.dbgToggleBpAct.triggered.connect(self.__toggleBreakpoint)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
725 self.actions.append(self.dbgToggleBpAct)
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
726
8356
68ec9c3d4de5 Renamed the modules and classes of the E5Gui package to have the prefix 'Eric' instead of 'E5'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8336
diff changeset
727 self.dbgEditBpAct = EricAction(
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
728 self.tr("Edit Breakpoint"),
9413
80c06d472826 Changed the eric7 import statements to include the package name (i.e. eric7) in order to not fiddle with sys.path.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9409
diff changeset
729 EricPixmapCache.getIcon("cBreakpointToggle"),
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
730 self.tr("Edit Breakpoint..."),
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
731 QKeySequence(self.tr("Shift+F12", "Debug|Edit Breakpoint")),
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
732 0,
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
733 self.dbgSetBpActGrp,
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
734 "dbg_edit_breakpoint",
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
735 )
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
736 self.dbgEditBpAct.setStatusTip(self.tr("Edit Breakpoint"))
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
737 self.dbgEditBpAct.setWhatsThis(
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
738 self.tr(
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
739 """<b>Edit Breakpoint</b>"""
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
740 """<p>Opens a dialog to edit the breakpoints properties."""
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
741 """ It works at the current line of the current editor.</p>"""
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
742 )
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
743 )
3345
071afe8be2a1 Changed signal/slot usage to not use constructs like 'triggered[()].connect(...)' anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3190
diff changeset
744 self.dbgEditBpAct.triggered.connect(self.__editBreakpoint)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
745 self.actions.append(self.dbgEditBpAct)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
746
8356
68ec9c3d4de5 Renamed the modules and classes of the E5Gui package to have the prefix 'Eric' instead of 'E5'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8336
diff changeset
747 self.dbgNextBpAct = EricAction(
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
748 self.tr("Next Breakpoint"),
9413
80c06d472826 Changed the eric7 import statements to include the package name (i.e. eric7) in order to not fiddle with sys.path.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9409
diff changeset
749 EricPixmapCache.getIcon("breakpointNext"),
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
750 self.tr("Next Breakpoint"),
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
751 QKeySequence(self.tr("Ctrl+Shift+PgDown", "Debug|Next Breakpoint")),
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
752 0,
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
753 self.dbgSetBpActGrp,
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
754 "dbg_next_breakpoint",
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
755 )
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
756 self.dbgNextBpAct.setStatusTip(self.tr("Next Breakpoint"))
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
757 self.dbgNextBpAct.setWhatsThis(
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
758 self.tr(
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
759 """<b>Next Breakpoint</b>"""
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
760 """<p>Go to next breakpoint of the current editor.</p>"""
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
761 )
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
762 )
3345
071afe8be2a1 Changed signal/slot usage to not use constructs like 'triggered[()].connect(...)' anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3190
diff changeset
763 self.dbgNextBpAct.triggered.connect(self.__nextBreakpoint)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
764 self.actions.append(self.dbgNextBpAct)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
765
8356
68ec9c3d4de5 Renamed the modules and classes of the E5Gui package to have the prefix 'Eric' instead of 'E5'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8336
diff changeset
766 self.dbgPrevBpAct = EricAction(
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
767 self.tr("Previous Breakpoint"),
9413
80c06d472826 Changed the eric7 import statements to include the package name (i.e. eric7) in order to not fiddle with sys.path.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9409
diff changeset
768 EricPixmapCache.getIcon("breakpointPrevious"),
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
769 self.tr("Previous Breakpoint"),
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
770 QKeySequence(self.tr("Ctrl+Shift+PgUp", "Debug|Previous Breakpoint")),
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
771 0,
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
772 self.dbgSetBpActGrp,
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
773 "dbg_previous_breakpoint",
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
774 )
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
775 self.dbgPrevBpAct.setStatusTip(self.tr("Previous Breakpoint"))
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
776 self.dbgPrevBpAct.setWhatsThis(
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
777 self.tr(
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
778 """<b>Previous Breakpoint</b>"""
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
779 """<p>Go to previous breakpoint of the current editor.</p>"""
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
780 )
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
781 )
3345
071afe8be2a1 Changed signal/slot usage to not use constructs like 'triggered[()].connect(...)' anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3190
diff changeset
782 self.dbgPrevBpAct.triggered.connect(self.__previousBreakpoint)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
783 self.actions.append(self.dbgPrevBpAct)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
784
8356
68ec9c3d4de5 Renamed the modules and classes of the E5Gui package to have the prefix 'Eric' instead of 'E5'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8336
diff changeset
785 act = EricAction(
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
786 self.tr("Clear Breakpoints"),
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
787 self.tr("Clear Breakpoints"),
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
788 0,
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
789 0,
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
790 self.dbgSetBpActGrp,
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
791 "dbg_clear_breakpoint",
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
792 )
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
793 act.setStatusTip(self.tr("Clear Breakpoints"))
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
794 act.setWhatsThis(
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
795 self.tr(
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
796 """<b>Clear Breakpoints</b>"""
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
797 """<p>Clear breakpoints of all editors.</p>"""
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
798 )
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
799 )
3345
071afe8be2a1 Changed signal/slot usage to not use constructs like 'triggered[()].connect(...)' anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3190
diff changeset
800 act.triggered.connect(self.__clearBreakpoints)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
801 self.actions.append(act)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
802
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
803 self.debugActGrp.setEnabled(False)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
804 self.dbgSetBpActGrp.setEnabled(False)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
805 self.runProjectAct.setEnabled(False)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
806 self.profileProjectAct.setEnabled(False)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
807 self.coverageProjectAct.setEnabled(False)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
808 self.debugProjectAct.setEnabled(False)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
809 self.restartAct.setEnabled(False)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
810 self.stopAct.setEnabled(False)
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
811
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
812 def initMenus(self):
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
813 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
814 Public slot to initialize the project menu.
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
815
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
816 @return the generated menu
10417
c6011e501282 Modernized some code and converted Debug Client and Debugger source code documentation to the new style.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10415
diff changeset
817 @rtype QMenu
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
818 """
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
819 dmenu = QMenu(self.tr("&Debug"), self.parent())
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
820 dmenu.setTearOffEnabled(True)
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
821 smenu = QMenu(self.tr("Sta&rt"), self.parent())
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
822 smenu.setTearOffEnabled(True)
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
823 self.breakpointsMenu = QMenu(self.tr("&Breakpoints"), dmenu)
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
824
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
825 smenu.addAction(self.restartAct)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
826 smenu.addAction(self.stopAct)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
827 smenu.addSeparator()
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
828 smenu.addAction(self.runAct)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
829 smenu.addAction(self.runProjectAct)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
830 smenu.addSeparator()
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
831 smenu.addAction(self.debugAct)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
832 smenu.addAction(self.debugProjectAct)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
833 smenu.addSeparator()
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
834 smenu.addAction(self.profileAct)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
835 smenu.addAction(self.profileProjectAct)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
836 smenu.addSeparator()
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
837 smenu.addAction(self.coverageAct)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
838 smenu.addAction(self.coverageProjectAct)
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
839
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
840 dmenu.addActions(self.debugActGrp.actions())
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
841 dmenu.addSeparator()
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
842 dmenu.addActions(self.dbgSetBpActGrp.actions())
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
843 self.menuBreakpointsAct = dmenu.addMenu(self.breakpointsMenu)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
844 dmenu.addSeparator()
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
845 dmenu.addAction(self.dbgFilterAct)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
846 dmenu.addAction(self.excFilterAct)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
847 dmenu.addAction(self.excIgnoreFilterAct)
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
848
461
34528aaedf1c Continued porting signal/slot usage to the new API.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 454
diff changeset
849 self.breakpointsMenu.aboutToShow.connect(self.__showBreakpointsMenu)
482
4650a72c307a Continued porting signal/slot usage to the new API.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 481
diff changeset
850 self.breakpointsMenu.triggered.connect(self.__breakpointSelected)
461
34528aaedf1c Continued porting signal/slot usage to the new API.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 454
diff changeset
851 dmenu.aboutToShow.connect(self.__showDebugMenu)
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
852
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
853 return smenu, dmenu
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
854
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
855 def initToolbars(self, toolbarManager):
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
856 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
857 Public slot to initialize the debug toolbars.
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
858
2988
f53c03574697 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2703
diff changeset
859 @param toolbarManager reference to a toolbar manager object
10417
c6011e501282 Modernized some code and converted Debug Client and Debugger source code documentation to the new style.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10415
diff changeset
860 @type EricToolBarManager
c6011e501282 Modernized some code and converted Debug Client and Debugger source code documentation to the new style.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10415
diff changeset
861 @return the generated toolbars
c6011e501282 Modernized some code and converted Debug Client and Debugger source code documentation to the new style.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10415
diff changeset
862 @rtype list of QToolBar
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
863 """
3190
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
864 starttb = QToolBar(self.tr("Start"), self.ui)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
865 starttb.setObjectName("StartToolbar")
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
866 starttb.setToolTip(self.tr("Start"))
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
867
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
868 starttb.addAction(self.restartAct)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
869 starttb.addAction(self.stopAct)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
870 starttb.addSeparator()
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
871 starttb.addAction(self.runAct)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
872 starttb.addAction(self.runProjectAct)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
873 starttb.addSeparator()
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
874 starttb.addAction(self.debugAct)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
875 starttb.addAction(self.debugProjectAct)
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
876
3190
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
877 debugtb = QToolBar(self.tr("Debug"), self.ui)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
878 debugtb.setObjectName("DebugToolbar")
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
879 debugtb.setToolTip(self.tr("Debug"))
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
880
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
881 debugtb.addActions(self.debugActGrp.actions())
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
882 debugtb.addSeparator()
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
883 debugtb.addAction(self.dbgToggleBpAct)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
884 debugtb.addAction(self.dbgEditBpAct)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
885 debugtb.addAction(self.dbgNextBpAct)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
886 debugtb.addAction(self.dbgPrevBpAct)
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
887
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
888 toolbarManager.addToolBar(starttb, starttb.windowTitle())
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
889 toolbarManager.addToolBar(debugtb, debugtb.windowTitle())
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
890 toolbarManager.addAction(self.profileAct, starttb.windowTitle())
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
891 toolbarManager.addAction(self.profileProjectAct, starttb.windowTitle())
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
892 toolbarManager.addAction(self.coverageAct, starttb.windowTitle())
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
893 toolbarManager.addAction(self.coverageProjectAct, starttb.windowTitle())
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
894
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
895 return [starttb, debugtb]
5899
0516f6548ca6 Added the capability to enter an interpreter in the Start... dialogs of the debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5663
diff changeset
896
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
897 def setScriptsHistory(self, scriptName, clearHistories=False, history=None):
8529
569623270e29 Finished implementing an extension to the debug/run/... start dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8524
diff changeset
898 """
569623270e29 Finished implementing an extension to the debug/run/... start dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8524
diff changeset
899 Public slot to initialize the scripts history.
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
900
8529
569623270e29 Finished implementing an extension to the debug/run/... start dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8524
diff changeset
901 @param scriptName script name
569623270e29 Finished implementing an extension to the debug/run/... start dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8524
diff changeset
902 @type str
569623270e29 Finished implementing an extension to the debug/run/... start dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8524
diff changeset
903 @param clearHistories flag indicating, that the list should
569623270e29 Finished implementing an extension to the debug/run/... start dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8524
diff changeset
904 be cleared (defaults to False)
569623270e29 Finished implementing an extension to the debug/run/... start dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8524
diff changeset
905 @type bool (optional)
569623270e29 Finished implementing an extension to the debug/run/... start dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8524
diff changeset
906 @param history list of history entries to be set (defaults to None)
569623270e29 Finished implementing an extension to the debug/run/... start dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8524
diff changeset
907 @type list of str (optional)
569623270e29 Finished implementing an extension to the debug/run/... start dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8524
diff changeset
908 """
569623270e29 Finished implementing an extension to the debug/run/... start dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8524
diff changeset
909 if clearHistories:
569623270e29 Finished implementing an extension to the debug/run/... start dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8524
diff changeset
910 del self.scriptsHistory[1:]
569623270e29 Finished implementing an extension to the debug/run/... start dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8524
diff changeset
911 elif history is not None:
569623270e29 Finished implementing an extension to the debug/run/... start dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8524
diff changeset
912 self.scriptsHistory = history[:]
569623270e29 Finished implementing an extension to the debug/run/... start dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8524
diff changeset
913 else:
569623270e29 Finished implementing an extension to the debug/run/... start dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8524
diff changeset
914 if scriptName in self.scriptsHistory:
569623270e29 Finished implementing an extension to the debug/run/... start dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8524
diff changeset
915 self.scriptsHistory.remove(scriptName)
569623270e29 Finished implementing an extension to the debug/run/... start dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8524
diff changeset
916 self.scriptsHistory.insert(0, scriptName)
569623270e29 Finished implementing an extension to the debug/run/... start dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8524
diff changeset
917
5373
7826884089fd Added some TODOs to improve history handling of the debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5141
diff changeset
918 def setArgvHistory(self, argsStr, clearHistories=False, history=None):
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
919 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
920 Public slot to initialize the argv history.
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
921
10417
c6011e501282 Modernized some code and converted Debug Client and Debugger source code documentation to the new style.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10415
diff changeset
922 @param argsStr command line arguments
c6011e501282 Modernized some code and converted Debug Client and Debugger source code documentation to the new style.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10415
diff changeset
923 @type str
c6011e501282 Modernized some code and converted Debug Client and Debugger source code documentation to the new style.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10415
diff changeset
924 @param clearHistories flag indicating, that the list should be cleared
c6011e501282 Modernized some code and converted Debug Client and Debugger source code documentation to the new style.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10415
diff changeset
925 @type bool
c6011e501282 Modernized some code and converted Debug Client and Debugger source code documentation to the new style.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10415
diff changeset
926 @param history list of history entries to be set
c6011e501282 Modernized some code and converted Debug Client and Debugger source code documentation to the new style.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10415
diff changeset
927 @type list of str
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
928 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
929 if clearHistories:
5374
c18d759b6b86 Improved the histories handling of the debugger UI.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5373
diff changeset
930 del self.argvHistory[1:]
c18d759b6b86 Improved the histories handling of the debugger UI.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5373
diff changeset
931 elif history is not None:
c18d759b6b86 Improved the histories handling of the debugger UI.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5373
diff changeset
932 self.argvHistory = history[:]
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
933 else:
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
934 if argsStr in self.argvHistory:
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
935 self.argvHistory.remove(argsStr)
5374
c18d759b6b86 Improved the histories handling of the debugger UI.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5373
diff changeset
936 self.argvHistory.insert(0, argsStr)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
937
5373
7826884089fd Added some TODOs to improve history handling of the debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5141
diff changeset
938 def setWdHistory(self, wdStr, clearHistories=False, history=None):
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
939 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
940 Public slot to initialize the wd history.
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
941
10417
c6011e501282 Modernized some code and converted Debug Client and Debugger source code documentation to the new style.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10415
diff changeset
942 @param wdStr working directory
c6011e501282 Modernized some code and converted Debug Client and Debugger source code documentation to the new style.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10415
diff changeset
943 @type str
c6011e501282 Modernized some code and converted Debug Client and Debugger source code documentation to the new style.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10415
diff changeset
944 @param clearHistories flag indicating, that the list should be cleared
c6011e501282 Modernized some code and converted Debug Client and Debugger source code documentation to the new style.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10415
diff changeset
945 @type bool
c6011e501282 Modernized some code and converted Debug Client and Debugger source code documentation to the new style.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10415
diff changeset
946 @param history list of history entries to be set
c6011e501282 Modernized some code and converted Debug Client and Debugger source code documentation to the new style.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10415
diff changeset
947 @type list of str
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
948 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
949 if clearHistories:
5374
c18d759b6b86 Improved the histories handling of the debugger UI.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5373
diff changeset
950 del self.wdHistory[1:]
c18d759b6b86 Improved the histories handling of the debugger UI.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5373
diff changeset
951 elif history is not None:
c18d759b6b86 Improved the histories handling of the debugger UI.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5373
diff changeset
952 self.wdHistory = history[:]
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
953 else:
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
954 if wdStr in self.wdHistory:
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
955 self.wdHistory.remove(wdStr)
5374
c18d759b6b86 Improved the histories handling of the debugger UI.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5373
diff changeset
956 self.wdHistory.insert(0, wdStr)
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
957
5373
7826884089fd Added some TODOs to improve history handling of the debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5141
diff changeset
958 def setEnvHistory(self, envStr, clearHistories=False, history=None):
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
959 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
960 Public slot to initialize the env history.
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
961
10417
c6011e501282 Modernized some code and converted Debug Client and Debugger source code documentation to the new style.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10415
diff changeset
962 @param envStr the environment settings
c6011e501282 Modernized some code and converted Debug Client and Debugger source code documentation to the new style.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10415
diff changeset
963 @type str
c6011e501282 Modernized some code and converted Debug Client and Debugger source code documentation to the new style.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10415
diff changeset
964 @param clearHistories flag indicating, that the list should be cleared
c6011e501282 Modernized some code and converted Debug Client and Debugger source code documentation to the new style.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10415
diff changeset
965 @type bool
c6011e501282 Modernized some code and converted Debug Client and Debugger source code documentation to the new style.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10415
diff changeset
966 @param history list of history entries to be set
c6011e501282 Modernized some code and converted Debug Client and Debugger source code documentation to the new style.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10415
diff changeset
967 @type list of str
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
968 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
969 if clearHistories:
5374
c18d759b6b86 Improved the histories handling of the debugger UI.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5373
diff changeset
970 del self.envHistory[1:]
c18d759b6b86 Improved the histories handling of the debugger UI.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5373
diff changeset
971 elif history is not None:
c18d759b6b86 Improved the histories handling of the debugger UI.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5373
diff changeset
972 self.envHistory = history[:]
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
973 else:
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
974 if envStr in self.envHistory:
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
975 self.envHistory.remove(envStr)
5374
c18d759b6b86 Improved the histories handling of the debugger UI.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5373
diff changeset
976 self.envHistory.insert(0, envStr)
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
977
10321
4a017fdf316f Debugger
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10306
diff changeset
978 def setExceptionReporting(self, reportAllExceptions):
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
979 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
980 Public slot to initialize the exception reporting flag.
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
981
10321
4a017fdf316f Debugger
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10306
diff changeset
982 @param reportAllExceptions flag indicating to report all exceptions
9291
7b271bcd12d0 Debugger
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9285
diff changeset
983 @type bool
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
984 """
10321
4a017fdf316f Debugger
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10306
diff changeset
985 self.reportAllExceptions = reportAllExceptions
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
986
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
987 def setExcList(self, excList):
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
988 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
989 Public slot to initialize the exceptions type list.
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
990
10417
c6011e501282 Modernized some code and converted Debug Client and Debugger source code documentation to the new style.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10415
diff changeset
991 @param excList list of exception types
c6011e501282 Modernized some code and converted Debug Client and Debugger source code documentation to the new style.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10415
diff changeset
992 @type list of str
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
993 """
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
994 self.excList = excList[:] # keep a copy
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
995
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
996 def setExcIgnoreList(self, excIgnoreList):
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
997 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
998 Public slot to initialize the ignored exceptions type list.
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
999
10417
c6011e501282 Modernized some code and converted Debug Client and Debugger source code documentation to the new style.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10415
diff changeset
1000 @param excIgnoreList list of ignored exception types
c6011e501282 Modernized some code and converted Debug Client and Debugger source code documentation to the new style.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10415
diff changeset
1001 @type list of str
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1002 """
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
1003 self.excIgnoreList = excIgnoreList[:] # keep a copy
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
1004
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1005 def setAutoClearShell(self, autoClearShell):
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1006 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1007 Public slot to initialize the autoClearShell flag.
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
1008
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1009 @param autoClearShell flag indicating, that the interpreter window
10417
c6011e501282 Modernized some code and converted Debug Client and Debugger source code documentation to the new style.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10415
diff changeset
1010 should be cleared
c6011e501282 Modernized some code and converted Debug Client and Debugger source code documentation to the new style.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10415
diff changeset
1011 @type bool
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1012 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1013 self.autoClearShell = autoClearShell
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1014
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1015 def setTracePython(self, tracePython):
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1016 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1017 Public slot to initialize the trace Python flag.
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
1018
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1019 @param tracePython flag indicating if the Python library should be
10417
c6011e501282 Modernized some code and converted Debug Client and Debugger source code documentation to the new style.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10415
diff changeset
1020 traced as well
c6011e501282 Modernized some code and converted Debug Client and Debugger source code documentation to the new style.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10415
diff changeset
1021 @type bool
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1022 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1023 self.tracePython = tracePython
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1024
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1025 def setAutoContinue(self, autoContinue):
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1026 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1027 Public slot to initialize the autoContinue flag.
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
1028
2988
f53c03574697 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2703
diff changeset
1029 @param autoContinue flag indicating, that the debugger should not
10417
c6011e501282 Modernized some code and converted Debug Client and Debugger source code documentation to the new style.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10415
diff changeset
1030 stop at the first executable line
c6011e501282 Modernized some code and converted Debug Client and Debugger source code documentation to the new style.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10415
diff changeset
1031 @type bool
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1032 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1033 self.autoContinue = autoContinue
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1034
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1035 def __editorOpened(self, fn):
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1036 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1037 Private slot to handle the editorOpened signal.
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
1038
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1039 @param fn filename of the opened editor
10417
c6011e501282 Modernized some code and converted Debug Client and Debugger source code documentation to the new style.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10415
diff changeset
1040 @type str
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1041 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1042 self.editorOpen = True
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
1043
8230
8b5c6896655b Applied some more code simplifications suggested by the new Simplify checker (Y108: use ternary operator) (batch 1).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8222
diff changeset
1044 editor = self.viewmanager.getOpenEditor(fn) if fn else None
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1045 self.__checkActions(editor)
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
1046
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1047 def __lastEditorClosed(self):
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1048 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1049 Private slot to handle the closeProgram signal.
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1050 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1051 self.editorOpen = False
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1052 self.debugActGrp.setEnabled(False)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1053 self.dbgSetBpActGrp.setEnabled(False)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1054 self.lastAction = -1
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1055 if not self.projectOpen:
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1056 self.restartAct.setEnabled(False)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1057 self.lastDebuggedFile = None
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1058 self.lastStartAction = 0
795
917f1945355c Added a syntax checker function for Python 2 files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 791
diff changeset
1059 self.clientType = ""
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
1060
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1061 def __checkActions(self, editor):
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1062 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1063 Private slot to check some actions for their enable/disable status.
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
1064
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1065 @param editor editor window
10417
c6011e501282 Modernized some code and converted Debug Client and Debugger source code documentation to the new style.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10415
diff changeset
1066 @type Editor
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1067 """
8230
8b5c6896655b Applied some more code simplifications suggested by the new Simplify checker (Y108: use ternary operator) (batch 1).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8222
diff changeset
1068 fn = editor.getFileName() if editor else None
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
1069
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1070 cap = 0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1071 if fn:
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1072 for language in self.debugServer.getSupportedLanguages():
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1073 exts = self.debugServer.getExtensions(language)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1074 if fn.endswith(exts):
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1075 cap = self.debugServer.getClientCapabilities(language)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1076 break
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1077 else:
7635
0cdead130a81 Removed support for Python2 and removed support for Qt4 (PyQt4 and pyside).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7533
diff changeset
1078 if editor.isPy3File():
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
1079 cap = self.debugServer.getClientCapabilities("Python3")
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1080 elif editor.isRubyFile():
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
1081 cap = self.debugServer.getClientCapabilities("Ruby")
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
1082
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1083 self.dbgSetBpActGrp.setEnabled(cap & HasDebugger)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1084 if editor.curLineHasBreakpoint():
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1085 self.dbgEditBpAct.setEnabled(True)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1086 else:
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1087 self.dbgEditBpAct.setEnabled(False)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1088 if editor.hasBreakpoints():
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1089 self.dbgNextBpAct.setEnabled(True)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1090 self.dbgPrevBpAct.setEnabled(True)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1091 else:
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1092 self.dbgNextBpAct.setEnabled(False)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1093 self.dbgPrevBpAct.setEnabled(False)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1094 else:
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1095 self.dbgSetBpActGrp.setEnabled(False)
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
1096
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1097 def __cursorChanged(self, editor):
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1098 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1099 Private slot handling the cursorChanged signal of the viewmanager.
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
1100
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1101 @param editor editor window
10417
c6011e501282 Modernized some code and converted Debug Client and Debugger source code documentation to the new style.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10415
diff changeset
1102 @type Editor
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1103 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1104 if editor is None:
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1105 return
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
1106
3446
5a670e55adbb Improved the way the Python variant of a source file is detected (thanks to Tobias Rzepka).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3345
diff changeset
1107 if editor.isPyFile() or editor.isRubyFile():
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1108 if editor.curLineHasBreakpoint():
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1109 self.dbgEditBpAct.setEnabled(True)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1110 else:
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1111 self.dbgEditBpAct.setEnabled(False)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1112 if editor.hasBreakpoints():
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1113 self.dbgNextBpAct.setEnabled(True)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1114 self.dbgPrevBpAct.setEnabled(True)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1115 else:
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1116 self.dbgNextBpAct.setEnabled(False)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1117 self.dbgPrevBpAct.setEnabled(False)
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
1118
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1119 def __projectOpened(self):
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1120 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1121 Private slot to handle the projectOpened signal.
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1122 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1123 self.projectOpen = True
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
1124 cap = self.debugServer.getClientCapabilities(self.project.getProjectLanguage())
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1125 if not self.passive:
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1126 self.debugProjectAct.setEnabled(cap & HasDebugger)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1127 self.runProjectAct.setEnabled(cap & HasInterpreter)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1128 self.profileProjectAct.setEnabled(cap & HasProfiler)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1129 self.coverageProjectAct.setEnabled(cap & HasCoverage)
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
1130
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1131 def __projectClosed(self):
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1132 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1133 Private slot to handle the projectClosed signal.
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1134 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1135 self.projectOpen = False
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1136 self.runProjectAct.setEnabled(False)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1137 self.profileProjectAct.setEnabled(False)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1138 self.coverageProjectAct.setEnabled(False)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1139 self.debugProjectAct.setEnabled(False)
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
1140
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1141 if not self.editorOpen:
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1142 self.restartAct.setEnabled(False)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1143 self.lastDebuggedFile = None
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1144 self.lastStartAction = 0
795
917f1945355c Added a syntax checker function for Python 2 files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 791
diff changeset
1145 self.clientType = ""
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
1146
5108
f5cb9cb98e6a Added an action to clear the private data of the IDE.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5100
diff changeset
1147 def clearHistories(self):
f5cb9cb98e6a Added an action to clear the private data of the IDE.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5100
diff changeset
1148 """
f5cb9cb98e6a Added an action to clear the private data of the IDE.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5100
diff changeset
1149 Public method to clear the various debug histories.
f5cb9cb98e6a Added an action to clear the private data of the IDE.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5100
diff changeset
1150 """
8529
569623270e29 Finished implementing an extension to the debug/run/... start dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8524
diff changeset
1151 self.scriptsHistory = []
5108
f5cb9cb98e6a Added an action to clear the private data of the IDE.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5100
diff changeset
1152 self.argvHistory = []
f5cb9cb98e6a Added an action to clear the private data of the IDE.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5100
diff changeset
1153 self.wdHistory = []
f5cb9cb98e6a Added an action to clear the private data of the IDE.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5100
diff changeset
1154 self.envHistory = []
7411
6d8dcb3551b3 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7410
diff changeset
1155 self.multiprocessNoDebugHistory = []
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
1156
8637
394377638256 Replaced the direct access to 'Preferences.Prefs.settings' with 'Preferences.getSettings()'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8568
diff changeset
1157 Preferences.getSettings().setValue(
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
1158 "DebugInfo/ScriptsHistory", self.scriptsHistory
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
1159 )
8637
394377638256 Replaced the direct access to 'Preferences.Prefs.settings' with 'Preferences.getSettings()'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8568
diff changeset
1160 Preferences.getSettings().setValue(
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
1161 "DebugInfo/ArgumentsHistory", self.argvHistory
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
1162 )
8637
394377638256 Replaced the direct access to 'Preferences.Prefs.settings' with 'Preferences.getSettings()'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8568
diff changeset
1163 Preferences.getSettings().setValue(
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
1164 "DebugInfo/WorkingDirectoryHistory", self.wdHistory
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
1165 )
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
1166 Preferences.getSettings().setValue(
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
1167 "DebugInfo/EnvironmentHistory", self.envHistory
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
1168 )
8637
394377638256 Replaced the direct access to 'Preferences.Prefs.settings' with 'Preferences.getSettings()'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8568
diff changeset
1169 Preferences.getSettings().setValue(
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
1170 "DebugInfo/MultiprocessNoDebugHistory", self.multiprocessNoDebugHistory
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
1171 )
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
1172
8524
595547ab8d6f Debugger: added code to remember the list of recently used breakpoint conditions in the editor and the breakpoint viewer
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8366
diff changeset
1173 self.debugViewer.breakpointViewer.clearHistories()
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
1174
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1175 def shutdown(self):
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1176 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1177 Public method to perform shutdown actions.
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1178 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1179 # Just save the 10 most recent entries
8529
569623270e29 Finished implementing an extension to the debug/run/... start dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8524
diff changeset
1180 del self.scriptsHistory[10:]
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1181 del self.argvHistory[10:]
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1182 del self.wdHistory[10:]
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1183 del self.envHistory[10:]
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
1184
8637
394377638256 Replaced the direct access to 'Preferences.Prefs.settings' with 'Preferences.getSettings()'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8568
diff changeset
1185 Preferences.getSettings().setValue(
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
1186 "DebugInfo/VirtualEnvironment", self.lastUsedVenvName
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
1187 )
8637
394377638256 Replaced the direct access to 'Preferences.Prefs.settings' with 'Preferences.getSettings()'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8568
diff changeset
1188 Preferences.getSettings().setValue(
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
1189 "DebugInfo/ScriptsHistory", self.scriptsHistory
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
1190 )
8637
394377638256 Replaced the direct access to 'Preferences.Prefs.settings' with 'Preferences.getSettings()'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8568
diff changeset
1191 Preferences.getSettings().setValue(
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
1192 "DebugInfo/ArgumentsHistory", self.argvHistory
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
1193 )
8637
394377638256 Replaced the direct access to 'Preferences.Prefs.settings' with 'Preferences.getSettings()'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8568
diff changeset
1194 Preferences.getSettings().setValue(
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
1195 "DebugInfo/WorkingDirectoryHistory", self.wdHistory
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
1196 )
8637
394377638256 Replaced the direct access to 'Preferences.Prefs.settings' with 'Preferences.getSettings()'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8568
diff changeset
1197 Preferences.getSettings().setValue(
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
1198 "DebugInfo/EnvironmentHistory", self.envHistory
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
1199 )
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
1200 Preferences.getSettings().setValue("DebugInfo/Exceptions", self.excList)
8637
394377638256 Replaced the direct access to 'Preferences.Prefs.settings' with 'Preferences.getSettings()'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8568
diff changeset
1201 Preferences.getSettings().setValue(
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
1202 "DebugInfo/IgnoredExceptions", self.excIgnoreList
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
1203 )
8637
394377638256 Replaced the direct access to 'Preferences.Prefs.settings' with 'Preferences.getSettings()'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8568
diff changeset
1204 Preferences.getSettings().setValue(
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
1205 "DebugInfo/AutoClearShell", self.autoClearShell
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
1206 )
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
1207 Preferences.getSettings().setValue("DebugInfo/TracePython", self.tracePython)
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
1208 Preferences.getSettings().setValue("DebugInfo/AutoContinue", self.autoContinue)
8637
394377638256 Replaced the direct access to 'Preferences.Prefs.settings' with 'Preferences.getSettings()'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8568
diff changeset
1209 Preferences.getSettings().setValue(
10321
4a017fdf316f Debugger
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10306
diff changeset
1210 "DebugInfo/ReportAllExceptions", self.reportAllExceptions
4a017fdf316f Debugger
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10306
diff changeset
1211 )
4a017fdf316f Debugger
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10306
diff changeset
1212 Preferences.getSettings().setValue(
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
1213 "DebugInfo/EnableMultiprocess", self.enableMultiprocess
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
1214 )
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
1215 Preferences.getSettings().setValue(
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
1216 "DebugInfo/MultiprocessNoDebugHistory", self.multiprocessNoDebugHistory
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
1217 )
8637
394377638256 Replaced the direct access to 'Preferences.Prefs.settings' with 'Preferences.getSettings()'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8568
diff changeset
1218 Preferences.getSettings().setValue(
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
1219 "DebugInfo/OverrideGlobal", self.overrideGlobalConfig["enable"]
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
1220 )
8637
394377638256 Replaced the direct access to 'Preferences.Prefs.settings' with 'Preferences.getSettings()'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8568
diff changeset
1221 Preferences.getSettings().setValue(
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
1222 "DebugInfo/RedirectStdinStdout", self.overrideGlobalConfig["redirect"]
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
1223 )
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
1224
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1225 def shutdownServer(self):
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1226 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1227 Public method to shut down the debug server.
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
1228
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1229 This is needed to cleanly close the sockets on Win OS.
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
1230
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1231 @return always true
10417
c6011e501282 Modernized some code and converted Debug Client and Debugger source code documentation to the new style.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10415
diff changeset
1232 @rtype bool
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1233 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1234 self.debugServer.shutdownServer()
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1235 return True
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
1236
7928
a78ce4578fed Debugger: some more fixes
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7923
diff changeset
1237 def __resetUI(self, fullReset=True):
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1238 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1239 Private slot to reset the user interface.
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
1240
7928
a78ce4578fed Debugger: some more fixes
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7923
diff changeset
1241 @param fullReset flag indicating a full reset is required
a78ce4578fed Debugger: some more fixes
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7923
diff changeset
1242 @type bool
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1243 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1244 self.lastAction = -1
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1245 self.debugActGrp.setEnabled(False)
7928
a78ce4578fed Debugger: some more fixes
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7923
diff changeset
1246 self.__clientDebuggerIds.clear()
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
1247
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1248 if not self.passive:
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1249 if self.editorOpen:
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1250 editor = self.viewmanager.activeWindow()
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1251 else:
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1252 editor = None
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1253 self.__checkActions(editor)
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
1254
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1255 self.debugProjectAct.setEnabled(self.projectOpen)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1256 self.runProjectAct.setEnabled(self.projectOpen)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1257 self.profileProjectAct.setEnabled(self.projectOpen)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1258 self.coverageProjectAct.setEnabled(self.projectOpen)
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
1259 if self.lastDebuggedFile is not None and (
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
1260 self.editorOpen or self.projectOpen
7251
bc5b1b00560a Continued to resolve code style issue M841.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7229
diff changeset
1261 ):
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1262 self.restartAct.setEnabled(True)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1263 else:
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1264 self.restartAct.setEnabled(False)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1265 self.stopAct.setEnabled(False)
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
1266
7928
a78ce4578fed Debugger: some more fixes
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7923
diff changeset
1267 self.resetUI.emit(fullReset)
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
1268
7928
a78ce4578fed Debugger: some more fixes
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7923
diff changeset
1269 def __clientDebuggerId(self, debuggerId):
a78ce4578fed Debugger: some more fixes
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7923
diff changeset
1270 """
a78ce4578fed Debugger: some more fixes
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7923
diff changeset
1271 Private slot to track the list of connected debuggers.
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
1272
7928
a78ce4578fed Debugger: some more fixes
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7923
diff changeset
1273 @param debuggerId ID of the debugger backend
a78ce4578fed Debugger: some more fixes
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7923
diff changeset
1274 @type str
a78ce4578fed Debugger: some more fixes
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7923
diff changeset
1275 """
a78ce4578fed Debugger: some more fixes
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7923
diff changeset
1276 self.__clientDebuggerIds.add(debuggerId)
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
1277
10683
779cda568acb Changed the source code and the source code documentation to improve the indication of unused method/function arguments.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10540
diff changeset
1278 def __clientLine(self, fn, line, debuggerId, _threadName, forStack):
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1279 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1280 Private method to handle a change to the current line.
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
1281
7377
cc920e534ac0 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7374
diff changeset
1282 @param fn filename
cc920e534ac0 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7374
diff changeset
1283 @type str
cc920e534ac0 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7374
diff changeset
1284 @param line linenumber
cc920e534ac0 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7374
diff changeset
1285 @type int
cc920e534ac0 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7374
diff changeset
1286 @param debuggerId ID of the debugger backend
cc920e534ac0 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7374
diff changeset
1287 @type str
10683
779cda568acb Changed the source code and the source code documentation to improve the indication of unused method/function arguments.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10540
diff changeset
1288 @param _threadName name of the thread signaling the event (unused)
7986
2971d5d19951 Fixed a few thread related issues in the debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7962
diff changeset
1289 @type str
7377
cc920e534ac0 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7374
diff changeset
1290 @param forStack flag indicating this is for a stack dump
cc920e534ac0 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7374
diff changeset
1291 @type bool
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1292 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1293 self.ui.raise_()
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1294 self.ui.activateWindow()
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1295 if self.ui.getViewProfile() != "debug":
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1296 self.ui.setDebugProfile()
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1297 self.viewmanager.setFileLine(fn, line)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1298 if not forStack:
7416
6f899e82f9a2 Ironed out some issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7415
diff changeset
1299 self.__getThreadList(debuggerId)
7379
72a72fd56494 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7377
diff changeset
1300 self.__getClientVariables(debuggerId)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1301
4189
283cc9507dcd Fixed some exceptions when pressing a debugger related hotkey, e.g. F9.
T.Rzepka <Tobias.Rzepka@gmail.com>
parents: 4021
diff changeset
1302 self.debugActGrp.setEnabled(True)
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
1303
7932
c4c6b2784eec Debugger: fixed an issue related to multiprocessing on Windows and macOS because these use the 'spawn' method.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7928
diff changeset
1304 @pyqtSlot(str)
c4c6b2784eec Debugger: fixed an issue related to multiprocessing on Windows and macOS because these use the 'spawn' method.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7928
diff changeset
1305 def __clientDisconnected(self, debuggerId):
c4c6b2784eec Debugger: fixed an issue related to multiprocessing on Windows and macOS because these use the 'spawn' method.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7928
diff changeset
1306 """
c4c6b2784eec Debugger: fixed an issue related to multiprocessing on Windows and macOS because these use the 'spawn' method.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7928
diff changeset
1307 Private slot to handle a debug client disconnecting its control
c4c6b2784eec Debugger: fixed an issue related to multiprocessing on Windows and macOS because these use the 'spawn' method.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7928
diff changeset
1308 socket.
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
1309
7932
c4c6b2784eec Debugger: fixed an issue related to multiprocessing on Windows and macOS because these use the 'spawn' method.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7928
diff changeset
1310 @param debuggerId ID of the debugger backend
c4c6b2784eec Debugger: fixed an issue related to multiprocessing on Windows and macOS because these use the 'spawn' method.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7928
diff changeset
1311 @type str
c4c6b2784eec Debugger: fixed an issue related to multiprocessing on Windows and macOS because these use the 'spawn' method.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7928
diff changeset
1312 """
c4c6b2784eec Debugger: fixed an issue related to multiprocessing on Windows and macOS because these use the 'spawn' method.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7928
diff changeset
1313 self.__clientDebuggerIds.discard(debuggerId)
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
1314
7932
c4c6b2784eec Debugger: fixed an issue related to multiprocessing on Windows and macOS because these use the 'spawn' method.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7928
diff changeset
1315 if len(self.__clientDebuggerIds) == 0:
c4c6b2784eec Debugger: fixed an issue related to multiprocessing on Windows and macOS because these use the 'spawn' method.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7928
diff changeset
1316 self.viewmanager.exit()
c4c6b2784eec Debugger: fixed an issue related to multiprocessing on Windows and macOS because these use the 'spawn' method.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7928
diff changeset
1317 self.__resetUI(fullReset=False)
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
1318
7928
a78ce4578fed Debugger: some more fixes
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7923
diff changeset
1319 @pyqtSlot(str, int, str, bool, str)
a78ce4578fed Debugger: some more fixes
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7923
diff changeset
1320 def __clientExit(self, program, status, message, quiet, debuggerId):
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1321 """
7932
c4c6b2784eec Debugger: fixed an issue related to multiprocessing on Windows and macOS because these use the 'spawn' method.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7928
diff changeset
1322 Private slot to handle the debugged program terminating.
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
1323
7421
4a9900aef04e Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7416
diff changeset
1324 @param program name of the exited program
4a9900aef04e Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7416
diff changeset
1325 @type str
5140
01484c0afbc6 Worked on the last TODOs for the modernized debugger protocol.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5136
diff changeset
1326 @param status exit code of the debugged program
01484c0afbc6 Worked on the last TODOs for the modernized debugger protocol.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5136
diff changeset
1327 @type int
01484c0afbc6 Worked on the last TODOs for the modernized debugger protocol.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5136
diff changeset
1328 @param message exit message of the debugged program
01484c0afbc6 Worked on the last TODOs for the modernized debugger protocol.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5136
diff changeset
1329 @type str
6904
3f35037a08d4 Unit Test: added capability to run test with debugger support and to stop the test on the first error or failure.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6645
diff changeset
1330 @param quiet flag indicating to suppress exit info display
3f35037a08d4 Unit Test: added capability to run test with debugger support and to stop the test on the first error or failure.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6645
diff changeset
1331 @type bool
7928
a78ce4578fed Debugger: some more fixes
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7923
diff changeset
1332 @param debuggerId ID of the debugger backend
a78ce4578fed Debugger: some more fixes
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7923
diff changeset
1333 @type str
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1334 """
7932
c4c6b2784eec Debugger: fixed an issue related to multiprocessing on Windows and macOS because these use the 'spawn' method.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7928
diff changeset
1335 self.__clientDisconnected(debuggerId)
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
1336
6904
3f35037a08d4 Unit Test: added capability to run test with debugger support and to stop the test on the first error or failure.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6645
diff changeset
1337 if not quiet:
7421
4a9900aef04e Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7416
diff changeset
1338 if not program:
4a9900aef04e Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7416
diff changeset
1339 program = self.ui.currentProg
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
1340
7962
4614e724b083 DebugUI: removed some obsolete code.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7959
diff changeset
1341 if message:
10928
46651e194fbe Refactored some packages, modules and code to allow extracting the 'EricXxx' packages into a library project.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10806
diff changeset
1342 info = self.tr("Message: {0}").format(
46651e194fbe Refactored some packages, modules and code to allow extracting the 'EricXxx' packages into a library project.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10806
diff changeset
1343 EricUtilities.html_uencode(message)
46651e194fbe Refactored some packages, modules and code to allow extracting the 'EricXxx' packages into a library project.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10806
diff changeset
1344 )
7962
4614e724b083 DebugUI: removed some obsolete code.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7959
diff changeset
1345 else:
4614e724b083 DebugUI: removed some obsolete code.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7959
diff changeset
1346 info = ""
4614e724b083 DebugUI: removed some obsolete code.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7959
diff changeset
1347 if program is None:
4614e724b083 DebugUI: removed some obsolete code.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7959
diff changeset
1348 msg = self.tr(
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
1349 "<p>The program has terminated with an exit status of"
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
1350 " {0}.</p><p>{1}</p>"
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
1351 ).format(status, info)
6904
3f35037a08d4 Unit Test: added capability to run test with debugger support and to stop the test on the first error or failure.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6645
diff changeset
1352 else:
7962
4614e724b083 DebugUI: removed some obsolete code.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7959
diff changeset
1353 msg = self.tr(
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
1354 "<p><b>{0}</b> has terminated with an exit status of"
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
1355 " {1}.</p><p>{2}</p>"
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
1356 ).format(os.path.basename(program), status, info)
7962
4614e724b083 DebugUI: removed some obsolete code.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7959
diff changeset
1357 if status != 0:
4614e724b083 DebugUI: removed some obsolete code.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7959
diff changeset
1358 timeout = 0
8265
0090cfa83159 Converted enum names to use all uppercase letters (except for E5PathPickerModes to keep plug-ins using this compatible with previous eric releases).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8257
diff changeset
1359 kind = NotificationTypes.WARNING
7962
4614e724b083 DebugUI: removed some obsolete code.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7959
diff changeset
1360 else:
4614e724b083 DebugUI: removed some obsolete code.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7959
diff changeset
1361 timeout = None
8265
0090cfa83159 Converted enum names to use all uppercase letters (except for E5PathPickerModes to keep plug-ins using this compatible with previous eric releases).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8257
diff changeset
1362 kind = NotificationTypes.INFORMATION
7962
4614e724b083 DebugUI: removed some obsolete code.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7959
diff changeset
1363 self.ui.showNotification(
9413
80c06d472826 Changed the eric7 import statements to include the package name (i.e. eric7) in order to not fiddle with sys.path.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9409
diff changeset
1364 EricPixmapCache.getPixmap("debug48"),
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
1365 self.tr("Program terminated"),
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
1366 msg,
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
1367 kind=kind,
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
1368 timeout=timeout,
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
1369 )
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
1370
10415
af9a6dac2611 Testing
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10321
diff changeset
1371 def __mainClientExit(self):
7392
b6674724612a Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7389
diff changeset
1372 """
b6674724612a Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7389
diff changeset
1373 Private slot handling the exit of the last client.
b6674724612a Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7389
diff changeset
1374 """
b6674724612a Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7389
diff changeset
1375 self.viewmanager.exit()
b6674724612a Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7389
diff changeset
1376 self.__resetUI()
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
1377
10415
af9a6dac2611 Testing
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10321
diff changeset
1378 self.debuggingFinished.emit()
af9a6dac2611 Testing
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10321
diff changeset
1379
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1380 def __clientSyntaxError(self, message, filename, lineNo, characterNo):
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1381 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1382 Private method to handle a syntax error in the debugged program.
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
1383
10417
c6011e501282 Modernized some code and converted Debug Client and Debugger source code documentation to the new style.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10415
diff changeset
1384 @param message message of the syntax error
c6011e501282 Modernized some code and converted Debug Client and Debugger source code documentation to the new style.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10415
diff changeset
1385 @type str
2988
f53c03574697 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2703
diff changeset
1386 @param filename translated filename of the syntax error position
10417
c6011e501282 Modernized some code and converted Debug Client and Debugger source code documentation to the new style.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10415
diff changeset
1387 @type str
c6011e501282 Modernized some code and converted Debug Client and Debugger source code documentation to the new style.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10415
diff changeset
1388 @param lineNo line number of the syntax error position
c6011e501282 Modernized some code and converted Debug Client and Debugger source code documentation to the new style.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10415
diff changeset
1389 @type int
2988
f53c03574697 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2703
diff changeset
1390 @param characterNo character number of the syntax error position
10417
c6011e501282 Modernized some code and converted Debug Client and Debugger source code documentation to the new style.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10415
diff changeset
1391 @type int
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1392 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1393 self.__resetUI()
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1394 self.ui.raise_()
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1395 self.ui.activateWindow()
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
1396
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1397 if message is None:
8356
68ec9c3d4de5 Renamed the modules and classes of the E5Gui package to have the prefix 'Eric' instead of 'E5'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8336
diff changeset
1398 EricMessageBox.critical(
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
1399 self.ui,
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
1400 Program,
3190
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
1401 self.tr(
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
1402 "The program being debugged contains an unspecified"
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
1403 " syntax error."
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
1404 ),
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
1405 )
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1406 return
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
1407
2430
fd7fa26076d2 Extended DebugUI to better handle reported Syntax errors.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2400
diff changeset
1408 if not os.path.isabs(filename):
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
1409 if os.path.exists(os.path.join(self.project.getProjectPath(), filename)):
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
1410 filename = os.path.join(self.project.getProjectPath(), filename)
2430
fd7fa26076d2 Extended DebugUI to better handle reported Syntax errors.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2400
diff changeset
1411 else:
4256
5c61205c4bd7 Fixed an issue in the Debug UI.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4191
diff changeset
1412 ms = self.project.getMainScript(normalized=True)
5c61205c4bd7 Fixed an issue in the Debug UI.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4191
diff changeset
1413 if ms is not None:
5c61205c4bd7 Fixed an issue in the Debug UI.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4191
diff changeset
1414 d = os.path.dirname(ms)
5c61205c4bd7 Fixed an issue in the Debug UI.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4191
diff changeset
1415 if os.path.exists(os.path.join(d, filename)):
5c61205c4bd7 Fixed an issue in the Debug UI.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4191
diff changeset
1416 filename = os.path.join(d, filename)
10692
9becf9ca115c Changed the source code and the source code documentation to improve the indication of unused method/function arguments.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10690
diff changeset
1417 self.viewmanager.setFileLine(filename, lineNo, error=True)
8356
68ec9c3d4de5 Renamed the modules and classes of the E5Gui package to have the prefix 'Eric' instead of 'E5'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8336
diff changeset
1418 EricMessageBox.critical(
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
1419 self.ui,
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
1420 Program,
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
1421 self.tr(
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
1422 "<p>The file <b>{0}</b> contains the syntax error"
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
1423 " <b>{1}</b> at line <b>{2}</b>, character <b>{3}</b>."
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
1424 "</p>"
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
1425 ).format(filename, message, lineNo, characterNo),
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
1426 )
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
1427
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
1428 def __clientException(
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
1429 self, exceptionType, exceptionMessage, stackTrace, debuggerId
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
1430 ):
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1431 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1432 Private method to handle an exception of the debugged program.
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
1433
7377
cc920e534ac0 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7374
diff changeset
1434 @param exceptionType type of exception raised
cc920e534ac0 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7374
diff changeset
1435 @type str
cc920e534ac0 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7374
diff changeset
1436 @param exceptionMessage message given by the exception
cc920e534ac0 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7374
diff changeset
1437 @type (str
cc920e534ac0 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7374
diff changeset
1438 @param stackTrace list of stack entries
cc920e534ac0 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7374
diff changeset
1439 @type list of str
cc920e534ac0 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7374
diff changeset
1440 @param debuggerId ID of the debugger backend
cc920e534ac0 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7374
diff changeset
1441 @type str
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1442 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1443 self.ui.raise_()
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1444 QApplication.processEvents()
5130
27fe451262bf Fixed two little issues related to wrong parameter types.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5124
diff changeset
1445 if not exceptionType:
8356
68ec9c3d4de5 Renamed the modules and classes of the E5Gui package to have the prefix 'Eric' instead of 'E5'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8336
diff changeset
1446 EricMessageBox.critical(
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
1447 self.ui,
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
1448 Program,
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
1449 self.tr(
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
1450 "An unhandled exception occured."
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
1451 " See the shell window for details."
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
1452 ),
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
1453 )
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1454 return
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
1455
7251
bc5b1b00560a Continued to resolve code style issue M841.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7229
diff changeset
1456 if (
10321
4a017fdf316f Debugger
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10306
diff changeset
1457 self.reportAllExceptions
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
1458 and exceptionType not in self.excIgnoreList
9315
79be00bfe50c Little change to the code to make an 'if' statement clearer.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9291
diff changeset
1459 and (len(self.excList) == 0 or exceptionType in self.excList)
10321
4a017fdf316f Debugger
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10306
diff changeset
1460 ) or exceptionType.startswith("unhandled"):
1310
7fdcfa822e3e Extended debugger to ignore exceptions occuring in lines having a '__IGNORE_EXCEPTION__' line flag set.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1131
diff changeset
1461 res = None
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1462 if stackTrace:
8243
cc717c2ae956 Applied some more code simplifications suggested by the new Simplify checker (Y105: use contextlib.suppress) (batch 2).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8230
diff changeset
1463 with contextlib.suppress(UnicodeError, OSError):
2622
08cc2f31c983 Added a viewer for the call stack leading to the current line.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2430
diff changeset
1464 file, line = stackTrace[0][:2]
10690
fab36645aa7d Changed the source code and the source code documentation to improve the indication of unused method/function arguments.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10689
diff changeset
1465 source, _encoding = Utilities.readEncodedFile(file)
1310
7fdcfa822e3e Extended debugger to ignore exceptions occuring in lines having a '__IGNORE_EXCEPTION__' line flag set.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1131
diff changeset
1466 source = source.splitlines(True)
5586
0e5421d679e7 Added capability to place line flags (e.g. __IGNORE...) on the line following the one to be ignored.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5389
diff changeset
1467 if len(source) >= line:
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
1468 lineFlags = Utilities.extractLineFlags(source[line - 1].strip())
8243
cc717c2ae956 Applied some more code simplifications suggested by the new Simplify checker (Y105: use contextlib.suppress) (batch 2).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8230
diff changeset
1469 with contextlib.suppress(IndexError):
5586
0e5421d679e7 Added capability to place line flags (e.g. __IGNORE...) on the line following the one to be ignored.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5389
diff changeset
1470 lineFlags += Utilities.extractLineFlags(
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
1471 source[line].strip(), flagsLine=True
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
1472 )
5586
0e5421d679e7 Added capability to place line flags (e.g. __IGNORE...) on the line following the one to be ignored.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5389
diff changeset
1473 if "__IGNORE_EXCEPTION__" in lineFlags:
8356
68ec9c3d4de5 Renamed the modules and classes of the E5Gui package to have the prefix 'Eric' instead of 'E5'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8336
diff changeset
1474 res = EricMessageBox.No
68ec9c3d4de5 Renamed the modules and classes of the E5Gui package to have the prefix 'Eric' instead of 'E5'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8336
diff changeset
1475 if res != EricMessageBox.No:
2988
f53c03574697 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2703
diff changeset
1476 self.viewmanager.setFileLine(
10692
9becf9ca115c Changed the source code and the source code documentation to improve the indication of unused method/function arguments.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10690
diff changeset
1477 stackTrace[0][0], stackTrace[0][1], error=True
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
1478 )
8356
68ec9c3d4de5 Renamed the modules and classes of the E5Gui package to have the prefix 'Eric' instead of 'E5'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8336
diff changeset
1479 if res != EricMessageBox.No:
4638
38fb19230a17 Don't steal focus if nothing to show.
T.Rzepka <Tobias.Rzepka@gmail.com>
parents: 4631
diff changeset
1480 self.ui.activateWindow()
1310
7fdcfa822e3e Extended debugger to ignore exceptions occuring in lines having a '__IGNORE_EXCEPTION__' line flag set.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1131
diff changeset
1481 if Preferences.getDebugger("BreakAlways"):
8356
68ec9c3d4de5 Renamed the modules and classes of the E5Gui package to have the prefix 'Eric' instead of 'E5'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8336
diff changeset
1482 res = EricMessageBox.Yes
1310
7fdcfa822e3e Extended debugger to ignore exceptions occuring in lines having a '__IGNORE_EXCEPTION__' line flag set.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1131
diff changeset
1483 else:
7fdcfa822e3e Extended debugger to ignore exceptions occuring in lines having a '__IGNORE_EXCEPTION__' line flag set.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1131
diff changeset
1484 if stackTrace:
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
1485 if exceptionType.startswith("unhandled"):
8356
68ec9c3d4de5 Renamed the modules and classes of the E5Gui package to have the prefix 'Eric' instead of 'E5'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8336
diff changeset
1486 buttons = EricMessageBox.No | EricMessageBox.Yes
1310
7fdcfa822e3e Extended debugger to ignore exceptions occuring in lines having a '__IGNORE_EXCEPTION__' line flag set.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1131
diff changeset
1487 else:
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
1488 buttons = (
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
1489 EricMessageBox.No
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
1490 | EricMessageBox.Yes
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
1491 | EricMessageBox.Ignore
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
1492 )
10988
729202700a5a Fixed an issue where eric recommends to brake in a non text file when an exception was raised (see issue 464).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10928
diff changeset
1493 filename = stackTrace[0][0]
729202700a5a Fixed an issue where eric recommends to brake in a non text file when an exception was raised (see issue 464).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10928
diff changeset
1494 res = (
729202700a5a Fixed an issue where eric recommends to brake in a non text file when an exception was raised (see issue 464).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10928
diff changeset
1495 EricMessageBox.critical(
729202700a5a Fixed an issue where eric recommends to brake in a non text file when an exception was raised (see issue 464).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10928
diff changeset
1496 self.ui,
729202700a5a Fixed an issue where eric recommends to brake in a non text file when an exception was raised (see issue 464).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10928
diff changeset
1497 Program,
729202700a5a Fixed an issue where eric recommends to brake in a non text file when an exception was raised (see issue 464).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10928
diff changeset
1498 self.tr(
729202700a5a Fixed an issue where eric recommends to brake in a non text file when an exception was raised (see issue 464).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10928
diff changeset
1499 "<p>The debugged program raised the exception"
729202700a5a Fixed an issue where eric recommends to brake in a non text file when an exception was raised (see issue 464).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10928
diff changeset
1500 ' <b>{0}</b><br>"<b>{1}</b>"<br>'
729202700a5a Fixed an issue where eric recommends to brake in a non text file when an exception was raised (see issue 464).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10928
diff changeset
1501 "File: <b>{2}</b>, Line: <b>{3}</b></p>"
729202700a5a Fixed an issue where eric recommends to brake in a non text file when an exception was raised (see issue 464).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10928
diff changeset
1502 "<p>Break here?</p>"
729202700a5a Fixed an issue where eric recommends to brake in a non text file when an exception was raised (see issue 464).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10928
diff changeset
1503 ).format(
729202700a5a Fixed an issue where eric recommends to brake in a non text file when an exception was raised (see issue 464).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10928
diff changeset
1504 exceptionType,
729202700a5a Fixed an issue where eric recommends to brake in a non text file when an exception was raised (see issue 464).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10928
diff changeset
1505 EricUtilities.html_encode(exceptionMessage),
729202700a5a Fixed an issue where eric recommends to brake in a non text file when an exception was raised (see issue 464).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10928
diff changeset
1506 filename,
729202700a5a Fixed an issue where eric recommends to brake in a non text file when an exception was raised (see issue 464).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10928
diff changeset
1507 stackTrace[0][1],
729202700a5a Fixed an issue where eric recommends to brake in a non text file when an exception was raised (see issue 464).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10928
diff changeset
1508 ),
729202700a5a Fixed an issue where eric recommends to brake in a non text file when an exception was raised (see issue 464).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10928
diff changeset
1509 buttons,
729202700a5a Fixed an issue where eric recommends to brake in a non text file when an exception was raised (see issue 464).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10928
diff changeset
1510 EricMessageBox.No,
729202700a5a Fixed an issue where eric recommends to brake in a non text file when an exception was raised (see issue 464).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10928
diff changeset
1511 )
729202700a5a Fixed an issue where eric recommends to brake in a non text file when an exception was raised (see issue 464).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10928
diff changeset
1512 if Utilities.MimeTypes.isTextFile(filename)
729202700a5a Fixed an issue where eric recommends to brake in a non text file when an exception was raised (see issue 464).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10928
diff changeset
1513 else EricMessageBox.critical(
729202700a5a Fixed an issue where eric recommends to brake in a non text file when an exception was raised (see issue 464).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10928
diff changeset
1514 self.ui,
729202700a5a Fixed an issue where eric recommends to brake in a non text file when an exception was raised (see issue 464).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10928
diff changeset
1515 Program,
729202700a5a Fixed an issue where eric recommends to brake in a non text file when an exception was raised (see issue 464).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10928
diff changeset
1516 self.tr(
729202700a5a Fixed an issue where eric recommends to brake in a non text file when an exception was raised (see issue 464).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10928
diff changeset
1517 "<p>The debugged program raised the exception"
729202700a5a Fixed an issue where eric recommends to brake in a non text file when an exception was raised (see issue 464).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10928
diff changeset
1518 ' <b>{0}</b><br>"<b>{1}</b>"<br>'
729202700a5a Fixed an issue where eric recommends to brake in a non text file when an exception was raised (see issue 464).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10928
diff changeset
1519 "File: <b>{2}</b>, Line: <b>{3}</b></p>"
729202700a5a Fixed an issue where eric recommends to brake in a non text file when an exception was raised (see issue 464).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10928
diff changeset
1520 ).format(
729202700a5a Fixed an issue where eric recommends to brake in a non text file when an exception was raised (see issue 464).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10928
diff changeset
1521 exceptionType,
729202700a5a Fixed an issue where eric recommends to brake in a non text file when an exception was raised (see issue 464).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10928
diff changeset
1522 EricUtilities.html_encode(exceptionMessage),
729202700a5a Fixed an issue where eric recommends to brake in a non text file when an exception was raised (see issue 464).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10928
diff changeset
1523 filename,
729202700a5a Fixed an issue where eric recommends to brake in a non text file when an exception was raised (see issue 464).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10928
diff changeset
1524 stackTrace[0][1],
729202700a5a Fixed an issue where eric recommends to brake in a non text file when an exception was raised (see issue 464).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10928
diff changeset
1525 ),
729202700a5a Fixed an issue where eric recommends to brake in a non text file when an exception was raised (see issue 464).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10928
diff changeset
1526 )
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
1527 )
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1528 else:
8356
68ec9c3d4de5 Renamed the modules and classes of the E5Gui package to have the prefix 'Eric' instead of 'E5'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8336
diff changeset
1529 res = EricMessageBox.critical(
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
1530 self.ui,
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
1531 Program,
3190
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
1532 self.tr(
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
1533 "<p>The debugged program raised the exception"
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
1534 ' <b>{0}</b><br>"<b>{1}</b>"</p>'
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
1535 ).format(
10928
46651e194fbe Refactored some packages, modules and code to allow extracting the 'EricXxx' packages into a library project.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10806
diff changeset
1536 exceptionType,
46651e194fbe Refactored some packages, modules and code to allow extracting the 'EricXxx' packages into a library project.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10806
diff changeset
1537 EricUtilities.html_encode(exceptionMessage),
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
1538 ),
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
1539 )
8356
68ec9c3d4de5 Renamed the modules and classes of the E5Gui package to have the prefix 'Eric' instead of 'E5'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8336
diff changeset
1540 if res == EricMessageBox.Yes:
6431
1842436770c4 Debugger: changed code to prevent the right side bar or toolbox to be shown when the debugger has exited or was restarted via the shell.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6416
diff changeset
1541 self.debugServer.setDebugging(True)
482
4650a72c307a Continued porting signal/slot usage to the new API.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 481
diff changeset
1542 self.exceptionInterrupt.emit()
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1543 stack = []
2622
08cc2f31c983 Added a viewer for the call stack leading to the current line.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2430
diff changeset
1544 for fn, ln, func, args in stackTrace:
08cc2f31c983 Added a viewer for the call stack leading to the current line.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2430
diff changeset
1545 stack.append((fn, ln, func, args))
7377
cc920e534ac0 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7374
diff changeset
1546 self.clientStack.emit(stack, debuggerId)
7379
72a72fd56494 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7377
diff changeset
1547 self.__getClientVariables(debuggerId)
7802
eefe954f01e8 Merged with default branch.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7646 7780
diff changeset
1548 self.__getClientDisassembly(debuggerId)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1549 self.ui.setDebugProfile()
4191
47341b626127 Fix for last fix: Reenable debugger interface if caught an exception.
T.Rzepka <Tobias.Rzepka@gmail.com>
parents: 4189
diff changeset
1550 self.debugActGrp.setEnabled(True)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1551 return
8222
5994b80b8760 Applied some more code simplifications suggested by the new Simplify checker (Y102: use single if) (batch 1).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8218
diff changeset
1552 elif (
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
1553 res == EricMessageBox.Ignore and exceptionType not in self.excIgnoreList
8222
5994b80b8760 Applied some more code simplifications suggested by the new Simplify checker (Y102: use single if) (batch 1).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8218
diff changeset
1554 ):
5994b80b8760 Applied some more code simplifications suggested by the new Simplify checker (Y102: use single if) (batch 1).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8218
diff changeset
1555 self.excIgnoreList.append(exceptionType)
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
1556
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1557 if self.lastAction != -1:
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1558 if self.lastAction == 2:
7411
6d8dcb3551b3 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7410
diff changeset
1559 self.__specialContinue(debuggerId)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1560 else:
7411
6d8dcb3551b3 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7410
diff changeset
1561 self.debugActions[self.lastAction](debuggerId)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1562 else:
7411
6d8dcb3551b3 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7410
diff changeset
1563 self.__continue(debuggerId)
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
1564
10065
de4ae767b0e3 Corrected and checked some code style issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10044
diff changeset
1565 def __clientSignal(
10683
779cda568acb Changed the source code and the source code documentation to improve the indication of unused method/function arguments.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10540
diff changeset
1566 self, message, filename, lineNo, _funcName, _funcArgs, _debuggerId
10065
de4ae767b0e3 Corrected and checked some code style issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10044
diff changeset
1567 ):
4366
9445c7cb991f Implemented a signal handler for the Python debug clients.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4303
diff changeset
1568 """
9445c7cb991f Implemented a signal handler for the Python debug clients.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4303
diff changeset
1569 Private method to handle a signal generated on the client side.
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
1570
4366
9445c7cb991f Implemented a signal handler for the Python debug clients.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4303
diff changeset
1571 @param message message of the syntax error
9445c7cb991f Implemented a signal handler for the Python debug clients.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4303
diff changeset
1572 @type str
9445c7cb991f Implemented a signal handler for the Python debug clients.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4303
diff changeset
1573 @param filename translated filename of the syntax error position
9445c7cb991f Implemented a signal handler for the Python debug clients.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4303
diff changeset
1574 @type str
9445c7cb991f Implemented a signal handler for the Python debug clients.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4303
diff changeset
1575 @param lineNo line number of the syntax error position
9445c7cb991f Implemented a signal handler for the Python debug clients.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4303
diff changeset
1576 @type int
10683
779cda568acb Changed the source code and the source code documentation to improve the indication of unused method/function arguments.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10540
diff changeset
1577 @param _funcName name of the function causing the signal (unused)
4366
9445c7cb991f Implemented a signal handler for the Python debug clients.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4303
diff changeset
1578 @type str
10683
779cda568acb Changed the source code and the source code documentation to improve the indication of unused method/function arguments.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10540
diff changeset
1579 @param _funcArgs function arguments (unused)
4366
9445c7cb991f Implemented a signal handler for the Python debug clients.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4303
diff changeset
1580 @type str
10683
779cda568acb Changed the source code and the source code documentation to improve the indication of unused method/function arguments.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10540
diff changeset
1581 @param _debuggerId ID of the debugger backend (unused)
7379
72a72fd56494 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7377
diff changeset
1582 @type str
4366
9445c7cb991f Implemented a signal handler for the Python debug clients.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4303
diff changeset
1583 """
9445c7cb991f Implemented a signal handler for the Python debug clients.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4303
diff changeset
1584 self.ui.raise_()
9445c7cb991f Implemented a signal handler for the Python debug clients.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4303
diff changeset
1585 self.ui.activateWindow()
9445c7cb991f Implemented a signal handler for the Python debug clients.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4303
diff changeset
1586 QApplication.processEvents()
10692
9becf9ca115c Changed the source code and the source code documentation to improve the indication of unused method/function arguments.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10690
diff changeset
1587 self.viewmanager.setFileLine(filename, lineNo, error=True)
8356
68ec9c3d4de5 Renamed the modules and classes of the E5Gui package to have the prefix 'Eric' instead of 'E5'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8336
diff changeset
1588 EricMessageBox.critical(
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
1589 self.ui,
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
1590 Program,
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
1591 self.tr(
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
1592 """<p>The program generate the signal "{0}".<br/>"""
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
1593 """File: <b>{1}</b>, Line: <b>{2}</b></p>"""
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
1594 ).format(message, filename, lineNo),
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
1595 )
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
1596
481
ad71812ba395 Continued porting signal/slot usage to the new API.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 461
diff changeset
1597 def __clientGone(self, unplanned):
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1598 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1599 Private method to handle the disconnection of the debugger client.
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
1600
481
ad71812ba395 Continued porting signal/slot usage to the new API.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 461
diff changeset
1601 @param unplanned True if the client died, False otherwise
10417
c6011e501282 Modernized some code and converted Debug Client and Debugger source code documentation to the new style.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10415
diff changeset
1602 @type bool
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1603 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1604 self.__resetUI()
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1605 if unplanned:
8356
68ec9c3d4de5 Renamed the modules and classes of the E5Gui package to have the prefix 'Eric' instead of 'E5'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8336
diff changeset
1606 EricMessageBox.information(
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
1607 self.ui,
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
1608 Program,
9576
be9f8e7e42e0 Corrected some 'wrong' string quotes caused by the Black line merging.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9573
diff changeset
1609 self.tr("The program being debugged has terminated unexpectedly."),
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
1610 )
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
1611
7416
6f899e82f9a2 Ironed out some issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7415
diff changeset
1612 def __getThreadList(self, debuggerId):
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1613 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1614 Private method to get the list of threads from the client.
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
1615
7374
5401ae8ddaa1 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7360
diff changeset
1616 @param debuggerId ID of the debugger backend
5401ae8ddaa1 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7360
diff changeset
1617 @type str
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1618 """
7379
72a72fd56494 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7377
diff changeset
1619 self.debugServer.remoteThreadList(debuggerId)
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
1620
7379
72a72fd56494 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7377
diff changeset
1621 def __clientThreadSet(self, debuggerId):
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1622 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1623 Private method to handle a change of the client's current thread.
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
1624
7379
72a72fd56494 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7377
diff changeset
1625 @param debuggerId ID of the debugger backend
72a72fd56494 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7377
diff changeset
1626 @type str
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1627 """
8363
e0890180e16a Debugger: changed code to not switch to the Debug Viewer when not debugging.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8358
diff changeset
1628 if self.debugServer.isDebugging():
9541
69167c94995f Changed debugger code such, that if a different frame is selected, the globals are updated too.
T.Rzepka@gmail.com
parents: 9517
diff changeset
1629 self.__getClientVariables(debuggerId)
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
1630
7379
72a72fd56494 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7377
diff changeset
1631 def __getClientVariables(self, debuggerId):
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1632 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1633 Private method to request the global and local variables.
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
1634
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1635 In the first step, the global variables are requested from the client.
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1636 Once these have been received, the local variables are requested.
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1637 This happens in the method '__clientVariables'.
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
1638
7374
5401ae8ddaa1 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7360
diff changeset
1639 @param debuggerId ID of the debugger backend
5401ae8ddaa1 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7360
diff changeset
1640 @type str
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1641 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1642 # get globals first
7379
72a72fd56494 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7377
diff changeset
1643 self.debugServer.remoteClientVariables(
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
1644 debuggerId, 1, self.__globalsVarFilterList
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
1645 )
9541
69167c94995f Changed debugger code such, that if a different frame is selected, the globals are updated too.
T.Rzepka@gmail.com
parents: 9517
diff changeset
1646 # get locals second
69167c94995f Changed debugger code such, that if a different frame is selected, the globals are updated too.
T.Rzepka@gmail.com
parents: 9517
diff changeset
1647 self.debugServer.remoteClientVariables(
69167c94995f Changed debugger code such, that if a different frame is selected, the globals are updated too.
T.Rzepka@gmail.com
parents: 9517
diff changeset
1648 debuggerId, 0, self.__localsVarFilterList
69167c94995f Changed debugger code such, that if a different frame is selected, the globals are updated too.
T.Rzepka@gmail.com
parents: 9517
diff changeset
1649 )
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
1650
7379
72a72fd56494 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7377
diff changeset
1651 def __clientVariables(self, scope, variables, debuggerId):
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1652 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1653 Private method to write the clients variables to the user interface.
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
1654
8363
e0890180e16a Debugger: changed code to not switch to the Debug Viewer when not debugging.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8358
diff changeset
1655 @param scope scope of the variables
e0890180e16a Debugger: changed code to not switch to the Debug Viewer when not debugging.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8358
diff changeset
1656 (-2 = no frame found, -1 = empty locals, 1 = global, 0 = local)
7379
72a72fd56494 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7377
diff changeset
1657 @type int
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1658 @param variables the list of variables from the client
7379
72a72fd56494 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7377
diff changeset
1659 @type list
72a72fd56494 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7377
diff changeset
1660 @param debuggerId ID of the debugger backend
72a72fd56494 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7377
diff changeset
1661 @type str
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1662 """
8366
2a9f5153c438 Corrected some code style issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8363
diff changeset
1663 if debuggerId == self.getSelectedDebuggerId() and scope > -2:
2a9f5153c438 Corrected some code style issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8363
diff changeset
1664 self.ui.activateDebugViewer()
2a9f5153c438 Corrected some code style issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8363
diff changeset
1665 if scope > 0:
2a9f5153c438 Corrected some code style issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8363
diff changeset
1666 self.debugViewer.showVariables(variables, True)
2a9f5153c438 Corrected some code style issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8363
diff changeset
1667 elif scope == 0:
2a9f5153c438 Corrected some code style issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8363
diff changeset
1668 self.debugViewer.showVariables(variables, False)
2a9f5153c438 Corrected some code style issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8363
diff changeset
1669 elif scope == -1:
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
1670 vlist = [(self.tr("No locals available."), "", "", False, -2, "")]
8366
2a9f5153c438 Corrected some code style issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8363
diff changeset
1671 self.debugViewer.showVariables(vlist, False)
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
1672
7379
72a72fd56494 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7377
diff changeset
1673 def __clientVariable(self, scope, variables, debuggerId):
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1674 """
2988
f53c03574697 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2703
diff changeset
1675 Private method to write the contents of a clients classvariable to
f53c03574697 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2703
diff changeset
1676 the user interface.
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
1677
7379
72a72fd56494 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7377
diff changeset
1678 @param scope scope of the variables (-1 = empty locals, 1 = global,
2988
f53c03574697 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2703
diff changeset
1679 0 = local)
7379
72a72fd56494 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7377
diff changeset
1680 @type int
72a72fd56494 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7377
diff changeset
1681 @param variables the list of variables from the client
72a72fd56494 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7377
diff changeset
1682 @type list
72a72fd56494 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7377
diff changeset
1683 @param debuggerId ID of the debugger backend
72a72fd56494 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7377
diff changeset
1684 @type str
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1685 """
7379
72a72fd56494 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7377
diff changeset
1686 if debuggerId == self.getSelectedDebuggerId():
72a72fd56494 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7377
diff changeset
1687 self.ui.activateDebugViewer()
72a72fd56494 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7377
diff changeset
1688 if scope == 1:
72a72fd56494 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7377
diff changeset
1689 self.debugViewer.showVariable(variables, True)
72a72fd56494 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7377
diff changeset
1690 elif scope == 0:
72a72fd56494 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7377
diff changeset
1691 self.debugViewer.showVariable(variables, False)
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
1692
7802
eefe954f01e8 Merged with default branch.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7646 7780
diff changeset
1693 def __getClientDisassembly(self, debuggerId):
7707
6abcf4275d0e Added a viewer to visualize Python byte code generated from a Python traceback of an exception as an additional tab of the debug viewer.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7635
diff changeset
1694 """
6abcf4275d0e Added a viewer to visualize Python byte code generated from a Python traceback of an exception as an additional tab of the debug viewer.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7635
diff changeset
1695 Private method to ask the client for the latest traceback disassembly.
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
1696
7802
eefe954f01e8 Merged with default branch.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7646 7780
diff changeset
1697 @param debuggerId ID of the debugger backend
eefe954f01e8 Merged with default branch.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7646 7780
diff changeset
1698 @type str
7707
6abcf4275d0e Added a viewer to visualize Python byte code generated from a Python traceback of an exception as an additional tab of the debug viewer.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7635
diff changeset
1699 """
7802
eefe954f01e8 Merged with default branch.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7646 7780
diff changeset
1700 self.debugServer.remoteClientDisassembly(debuggerId)
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
1701
10683
779cda568acb Changed the source code and the source code documentation to improve the indication of unused method/function arguments.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10540
diff changeset
1702 def __clientBreakConditionError(self, filename, lineno, _debuggerId):
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1703 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1704 Private method to handle a condition error of a breakpoint.
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
1705
7389
770ffcb88be5 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7379
diff changeset
1706 @param filename filename of the breakpoint
770ffcb88be5 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7379
diff changeset
1707 @type str
770ffcb88be5 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7379
diff changeset
1708 @param lineno line umber of the breakpoint
770ffcb88be5 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7379
diff changeset
1709 @type int
10683
779cda568acb Changed the source code and the source code documentation to improve the indication of unused method/function arguments.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10540
diff changeset
1710 @param _debuggerId ID of the debugger backend (unused)
7389
770ffcb88be5 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7379
diff changeset
1711 @type str
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1712 """
9482
a2bc06a54d9d Corrected/acknowledged some bad import style and removed some obsolete code.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9473
diff changeset
1713 from .EditBreakpointDialog import EditBreakpointDialog
a2bc06a54d9d Corrected/acknowledged some bad import style and removed some obsolete code.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9473
diff changeset
1714
8356
68ec9c3d4de5 Renamed the modules and classes of the E5Gui package to have the prefix 'Eric' instead of 'E5'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8336
diff changeset
1715 EricMessageBox.critical(
3020
542e97d4ecb3 Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2991
diff changeset
1716 self.ui,
3190
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
1717 self.tr("Breakpoint Condition Error"),
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
1718 self.tr(
2988
f53c03574697 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2703
diff changeset
1719 """<p>The condition of the breakpoint <b>{0}, {1}</b>"""
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
1720 """ contains a syntax error.</p>"""
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
1721 ).format(filename, lineno),
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
1722 )
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
1723
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1724 model = self.debugServer.getBreakPointModel()
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1725 index = model.getBreakPointIndex(filename, lineno)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1726 if not index.isValid():
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1727 return
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
1728
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1729 bp = model.getBreakPointByIndex(index)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1730 if not bp:
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1731 return
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
1732
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1733 fn, line, cond, temp, enabled, count = bp[:6]
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
1734
8524
595547ab8d6f Debugger: added code to remember the list of recently used breakpoint conditions in the editor and the breakpoint viewer
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8366
diff changeset
1735 # get recently used breakpoint conditions
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
1736 rs = Preferences.Prefs.rsettings.value(recentNameBreakpointConditions)
8524
595547ab8d6f Debugger: added code to remember the list of recently used breakpoint conditions in the editor and the breakpoint viewer
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8366
diff changeset
1737 condHistory = (
10806
2f6df822e3b9 Moved some functions to the EricUtilities package for consistency and adapted the code base accordingly.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10704
diff changeset
1738 EricUtilities.toList(rs)[: Preferences.getDebugger("RecentNumber")]
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
1739 if rs is not None
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
1740 else []
8524
595547ab8d6f Debugger: added code to remember the list of recently used breakpoint conditions in the editor and the breakpoint viewer
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8366
diff changeset
1741 )
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
1742
3021
801289962f4e Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3020
diff changeset
1743 dlg = EditBreakpointDialog(
11006
a671918232f3 Modified modal dialog usage to always include a valid parent (needed for Wayland).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10988
diff changeset
1744 (fn, line),
a671918232f3 Modified modal dialog usage to always include a valid parent (needed for Wayland).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10988
diff changeset
1745 (cond, temp, enabled, count),
a671918232f3 Modified modal dialog usage to always include a valid parent (needed for Wayland).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10988
diff changeset
1746 condHistory,
a671918232f3 Modified modal dialog usage to always include a valid parent (needed for Wayland).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10988
diff changeset
1747 parent=self.ui,
a671918232f3 Modified modal dialog usage to always include a valid parent (needed for Wayland).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10988
diff changeset
1748 modal=True,
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
1749 )
8143
2c730d5fd177 Changed the use of PyQt enums because the way they were used previously is deprecated since two years and replaced some deprecated Qt stuff.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8010
diff changeset
1750 if dlg.exec() == QDialog.DialogCode.Accepted:
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1751 cond, temp, enabled, count = dlg.getData()
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
1752 model.setBreakPointByIndex(index, fn, line, (cond, temp, enabled, count))
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
1753
8524
595547ab8d6f Debugger: added code to remember the list of recently used breakpoint conditions in the editor and the breakpoint viewer
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8366
diff changeset
1754 if cond:
595547ab8d6f Debugger: added code to remember the list of recently used breakpoint conditions in the editor and the breakpoint viewer
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8366
diff changeset
1755 # save the recently used breakpoint condition
595547ab8d6f Debugger: added code to remember the list of recently used breakpoint conditions in the editor and the breakpoint viewer
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8366
diff changeset
1756 if cond in condHistory:
595547ab8d6f Debugger: added code to remember the list of recently used breakpoint conditions in the editor and the breakpoint viewer
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8366
diff changeset
1757 condHistory.remove(cond)
595547ab8d6f Debugger: added code to remember the list of recently used breakpoint conditions in the editor and the breakpoint viewer
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8366
diff changeset
1758 condHistory.insert(0, cond)
595547ab8d6f Debugger: added code to remember the list of recently used breakpoint conditions in the editor and the breakpoint viewer
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8366
diff changeset
1759 Preferences.Prefs.rsettings.setValue(
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
1760 recentNameBreakpointConditions, condHistory
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
1761 )
8524
595547ab8d6f Debugger: added code to remember the list of recently used breakpoint conditions in the editor and the breakpoint viewer
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8366
diff changeset
1762 Preferences.Prefs.rsettings.sync()
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
1763
10683
779cda568acb Changed the source code and the source code documentation to improve the indication of unused method/function arguments.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10540
diff changeset
1764 def __clientWatchConditionError(self, cond, _debuggerId):
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1765 """
3591
2f2a4a76dd22 Corrected a bunch of source docu issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3484
diff changeset
1766 Private method to handle a expression error of a watch expression.
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
1767
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1768 Note: This can only happen for normal watch expressions
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
1769
7389
770ffcb88be5 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7379
diff changeset
1770 @param cond expression of the watch expression
770ffcb88be5 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7379
diff changeset
1771 @type str
10683
779cda568acb Changed the source code and the source code documentation to improve the indication of unused method/function arguments.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10540
diff changeset
1772 @param _debuggerId ID of the debugger backend (unused)
7389
770ffcb88be5 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7379
diff changeset
1773 @type str
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1774 """
9482
a2bc06a54d9d Corrected/acknowledged some bad import style and removed some obsolete code.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9473
diff changeset
1775 from .EditWatchpointDialog import EditWatchpointDialog
a2bc06a54d9d Corrected/acknowledged some bad import style and removed some obsolete code.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9473
diff changeset
1776
8356
68ec9c3d4de5 Renamed the modules and classes of the E5Gui package to have the prefix 'Eric' instead of 'E5'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8336
diff changeset
1777 EricMessageBox.critical(
3020
542e97d4ecb3 Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2991
diff changeset
1778 self.ui,
3190
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
1779 self.tr("Watch Expression Error"),
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
1780 self.tr(
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
1781 """<p>The watch expression <b>{0}</b>"""
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
1782 """ contains a syntax error.</p>"""
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
1783 ).format(cond),
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
1784 )
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
1785
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1786 model = self.debugServer.getWatchPointModel()
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1787 index = model.getWatchPointIndex(cond)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1788 if not index.isValid():
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1789 return
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
1790
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1791 wp = model.getWatchPointByIndex(index)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1792 if not wp:
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1793 return
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
1794
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1795 cond, special, temp, enabled, count = wp[:5]
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
1796
11006
a671918232f3 Modified modal dialog usage to always include a valid parent (needed for Wayland).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10988
diff changeset
1797 dlg = EditWatchpointDialog(
a671918232f3 Modified modal dialog usage to always include a valid parent (needed for Wayland).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10988
diff changeset
1798 (cond, temp, enabled, count, special), parent=self.ui
a671918232f3 Modified modal dialog usage to always include a valid parent (needed for Wayland).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10988
diff changeset
1799 )
8143
2c730d5fd177 Changed the use of PyQt enums because the way they were used previously is deprecated since two years and replaced some deprecated Qt stuff.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8010
diff changeset
1800 if dlg.exec() == QDialog.DialogCode.Accepted:
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1801 cond, temp, enabled, count, special = dlg.getData()
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
1802
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1803 # check for duplicates
7388
e4f3948920a6 DebugUI: fixed an issue the __clientWatchConditionError() slot.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7360
diff changeset
1804 idx = model.getWatchPointIndex(cond, special)
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
1805 duplicate = (
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
1806 idx.isValid() and idx.internalPointer() != index.internalPointer()
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
1807 )
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1808 if duplicate:
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1809 if not special:
7251
bc5b1b00560a Continued to resolve code style issue M841.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7229
diff changeset
1810 msg = self.tr(
bc5b1b00560a Continued to resolve code style issue M841.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7229
diff changeset
1811 """<p>A watch expression '<b>{0}</b>'"""
bc5b1b00560a Continued to resolve code style issue M841.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7229
diff changeset
1812 """ already exists.</p>"""
10928
46651e194fbe Refactored some packages, modules and code to allow extracting the 'EricXxx' packages into a library project.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10806
diff changeset
1813 ).format(EricUtilities.html_encode(cond))
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1814 else:
3190
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
1815 msg = self.tr(
3021
801289962f4e Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3020
diff changeset
1816 """<p>A watch expression '<b>{0}</b>'"""
801289962f4e Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3020
diff changeset
1817 """ for the variable <b>{1}</b> already"""
7251
bc5b1b00560a Continued to resolve code style issue M841.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7229
diff changeset
1818 """ exists.</p>"""
10928
46651e194fbe Refactored some packages, modules and code to allow extracting the 'EricXxx' packages into a library project.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10806
diff changeset
1819 ).format(special, EricUtilities.html_encode(cond))
8356
68ec9c3d4de5 Renamed the modules and classes of the E5Gui package to have the prefix 'Eric' instead of 'E5'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8336
diff changeset
1820 EricMessageBox.warning(
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
1821 self.ui, self.tr("Watch expression already exists"), msg
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
1822 )
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1823 model.deleteWatchPointByIndex(index)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1824 else:
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
1825 model.setWatchPointByIndex(index, cond, special, (temp, enabled, count))
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
1826
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1827 def __configureVariablesFilters(self):
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1828 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1829 Private slot for displaying the variables filter configuration dialog.
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1830 """
2400
c1726b754f96 Started with delaying the import upon the time it is needed.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2302
diff changeset
1831 from .VariablesFilterDialog import VariablesFilterDialog
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
1832
11006
a671918232f3 Modified modal dialog usage to always include a valid parent (needed for Wayland).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10988
diff changeset
1833 dlg = VariablesFilterDialog(parent=self.ui, name="Filter Dialog", modal=True)
9382
fb89c1dc9825 Debugger
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9377
diff changeset
1834 dlg.applyFilterLists.connect(self.__applyVariablesFilters)
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
1835 dlg.setSelection(self.__localsVarFilterList, self.__globalsVarFilterList)
8143
2c730d5fd177 Changed the use of PyQt enums because the way they were used previously is deprecated since two years and replaced some deprecated Qt stuff.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8010
diff changeset
1836 if dlg.exec() == QDialog.DialogCode.Accepted:
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
1837 self.__localsVarFilterList, self.__globalsVarFilterList = dlg.getSelection()
9382
fb89c1dc9825 Debugger
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9377
diff changeset
1838 self.__applyVariablesFilters(
fb89c1dc9825 Debugger
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9377
diff changeset
1839 self.__localsVarFilterList, self.__globalsVarFilterList
fb89c1dc9825 Debugger
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9377
diff changeset
1840 )
fb89c1dc9825 Debugger
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9377
diff changeset
1841
fb89c1dc9825 Debugger
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9377
diff changeset
1842 @pyqtSlot(list, list)
fb89c1dc9825 Debugger
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9377
diff changeset
1843 def __applyVariablesFilters(self, localsFilter, globalsFilter):
fb89c1dc9825 Debugger
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9377
diff changeset
1844 """
fb89c1dc9825 Debugger
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9377
diff changeset
1845 Private slot to apply the given variables filter lists.
fb89c1dc9825 Debugger
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9377
diff changeset
1846
fb89c1dc9825 Debugger
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9377
diff changeset
1847 @param localsFilter variables filter for the local variables
fb89c1dc9825 Debugger
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9377
diff changeset
1848 @type list of str
fb89c1dc9825 Debugger
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9377
diff changeset
1849 @param globalsFilter variables filter for the global variables
fb89c1dc9825 Debugger
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9377
diff changeset
1850 @type list of str
fb89c1dc9825 Debugger
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9377
diff changeset
1851 """
fb89c1dc9825 Debugger
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9377
diff changeset
1852 self.debugViewer.setVariablesFilter(globalsFilter, localsFilter)
fb89c1dc9825 Debugger
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9377
diff changeset
1853 self.debugViewer.refreshVariablesLists()
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1854
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1855 def __configureExceptionsFilter(self):
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1856 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1857 Private slot for displaying the exception filter dialog.
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1858 """
2400
c1726b754f96 Started with delaying the import upon the time it is needed.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2302
diff changeset
1859 from .ExceptionsFilterDialog import ExceptionsFilterDialog
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
1860
11006
a671918232f3 Modified modal dialog usage to always include a valid parent (needed for Wayland).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10988
diff changeset
1861 dlg = ExceptionsFilterDialog(self.excList, ignore=False, parent=self.ui)
8143
2c730d5fd177 Changed the use of PyQt enums because the way they were used previously is deprecated since two years and replaced some deprecated Qt stuff.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8010
diff changeset
1862 if dlg.exec() == QDialog.DialogCode.Accepted:
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
1863 self.excList = dlg.getExceptionsList()[:] # keep a copy
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
1864
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1865 def __configureIgnoredExceptions(self):
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1866 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1867 Private slot for displaying the ignored exceptions dialog.
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1868 """
2400
c1726b754f96 Started with delaying the import upon the time it is needed.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2302
diff changeset
1869 from .ExceptionsFilterDialog import ExceptionsFilterDialog
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
1870
11006
a671918232f3 Modified modal dialog usage to always include a valid parent (needed for Wayland).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10988
diff changeset
1871 dlg = ExceptionsFilterDialog(self.excIgnoreList, ignore=True, parent=self.ui)
8143
2c730d5fd177 Changed the use of PyQt enums because the way they were used previously is deprecated since two years and replaced some deprecated Qt stuff.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8010
diff changeset
1872 if dlg.exec() == QDialog.DialogCode.Accepted:
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
1873 self.excIgnoreList = dlg.getExceptionsList()[:] # keep a copy
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
1874
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1875 def __toggleBreakpoint(self):
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1876 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1877 Private slot to handle the 'Set/Reset breakpoint' action.
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1878 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1879 self.viewmanager.activeWindow().menuToggleBreakpoint()
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
1880
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1881 def __editBreakpoint(self):
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1882 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1883 Private slot to handle the 'Edit breakpoint' action.
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1884 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1885 self.viewmanager.activeWindow().menuEditBreakpoint()
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
1886
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1887 def __nextBreakpoint(self):
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1888 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1889 Private slot to handle the 'Next breakpoint' action.
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1890 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1891 self.viewmanager.activeWindow().menuNextBreakpoint()
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
1892
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1893 def __previousBreakpoint(self):
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1894 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1895 Private slot to handle the 'Previous breakpoint' action.
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1896 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1897 self.viewmanager.activeWindow().menuPreviousBreakpoint()
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
1898
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1899 def __clearBreakpoints(self):
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1900 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1901 Private slot to handle the 'Clear breakpoints' action.
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1902 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1903 self.debugServer.getBreakPointModel().deleteAll()
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
1904
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1905 def __showDebugMenu(self):
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1906 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1907 Private method to set up the debug menu.
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1908 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1909 bpCount = self.debugServer.getBreakPointModel().rowCount()
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1910 self.menuBreakpointsAct.setEnabled(bpCount > 0)
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
1911
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1912 def __showBreakpointsMenu(self):
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1913 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1914 Private method to handle the show breakpoints menu signal.
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1915 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1916 self.breakpointsMenu.clear()
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
1917
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1918 model = self.debugServer.getBreakPointModel()
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1919 for row in range(model.rowCount()):
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1920 index = model.index(row, 0)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1921 filename, line, cond = model.getBreakPointByIndex(index)[:3]
8230
8b5c6896655b Applied some more code simplifications suggested by the new Simplify checker (Y108: use ternary operator) (batch 1).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8222
diff changeset
1922 formattedCond = " : {0}".format(cond[:20]) if cond else ""
406
eacf81fad150 Started converting the string formatting stuff.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 112
diff changeset
1923 bpSuffix = " : {0:d}{1}".format(line, formattedCond)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1924 act = self.breakpointsMenu.addAction(
406
eacf81fad150 Started converting the string formatting stuff.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 112
diff changeset
1925 "{0}{1}".format(
9624
b47dfa7a137d Refactored the Utilities and Globals modules in order to enhance the maintainability.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9576
diff changeset
1926 FileSystemUtilities.compactPath(
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
1927 filename, self.ui.maxMenuFilePathLen - len(bpSuffix)
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
1928 ),
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
1929 bpSuffix,
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
1930 )
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
1931 )
7
c679fb30c8f3 Change code dealing with QVariant (and QSettings) to use the PyQt4 QVariant v2 API.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 0
diff changeset
1932 act.setData([filename, line])
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
1933
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1934 def __breakpointSelected(self, act):
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1935 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1936 Private method to handle the breakpoint selected signal.
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
1937
10417
c6011e501282 Modernized some code and converted Debug Client and Debugger source code documentation to the new style.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10415
diff changeset
1938 @param act reference to the action that triggered
c6011e501282 Modernized some code and converted Debug Client and Debugger source code documentation to the new style.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10415
diff changeset
1939 @type QAction
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1940 """
7
c679fb30c8f3 Change code dealing with QVariant (and QSettings) to use the PyQt4 QVariant v2 API.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 0
diff changeset
1941 qvList = act.data()
c679fb30c8f3 Change code dealing with QVariant (and QSettings) to use the PyQt4 QVariant v2 API.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 0
diff changeset
1942 filename = qvList[0]
c679fb30c8f3 Change code dealing with QVariant (and QSettings) to use the PyQt4 QVariant v2 API.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 0
diff changeset
1943 line = qvList[1]
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1944 self.viewmanager.openSourceFile(filename, line)
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
1945
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1946 def __coverageScript(self):
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1947 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1948 Private slot to handle the coverage of script action.
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1949 """
8529
569623270e29 Finished implementing an extension to the debug/run/... start dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8524
diff changeset
1950 self.doCoverage(False)
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
1951
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1952 def __coverageProject(self):
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1953 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1954 Private slot to handle the coverage of project action.
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1955 """
9517
d73c3a1e432b Continued refactoring of the project browser related code in order to extract some as plugins later on.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9482
diff changeset
1956 self.processChangedProjectFiles.emit()
8529
569623270e29 Finished implementing an extension to the debug/run/... start dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8524
diff changeset
1957 self.doCoverage(True)
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
1958
8529
569623270e29 Finished implementing an extension to the debug/run/... start dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8524
diff changeset
1959 def doCoverage(self, runProject, script=""):
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1960 """
8529
569623270e29 Finished implementing an extension to the debug/run/... start dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8524
diff changeset
1961 Public method to handle the coverage actions.
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
1962
2988
f53c03574697 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2703
diff changeset
1963 @param runProject flag indicating coverage of the current project
f53c03574697 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2703
diff changeset
1964 (True) or script (false)
8529
569623270e29 Finished implementing an extension to the debug/run/... start dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8524
diff changeset
1965 @type bool
569623270e29 Finished implementing an extension to the debug/run/... start dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8524
diff changeset
1966 @param script name of a script (optional)
569623270e29 Finished implementing an extension to the debug/run/... start dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8524
diff changeset
1967 @type str
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1968 """
10306
904f4c7da759 Modified the 'Start' dialog to enhance maintainability.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10065
diff changeset
1969 from .StartDialog import StartDialog, StartDialogMode
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
1970
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1971 self.__resetUI()
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1972 doNotStart = False
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
1973
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1974 # Get the command line arguments, the working directory and the
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1975 # exception reporting flag.
8257
28146736bbfc Applied some more code simplifications suggested by the new Simplify checker (Y108: use ternary operator).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8243
diff changeset
1976 cap = (
10306
904f4c7da759 Modified the 'Start' dialog to enhance maintainability.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10065
diff changeset
1977 self.tr("Coverage Run of Project")
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
1978 if runProject
10306
904f4c7da759 Modified the 'Start' dialog to enhance maintainability.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10065
diff changeset
1979 else self.tr("Coverage Run of Script")
8257
28146736bbfc Applied some more code simplifications suggested by the new Simplify checker (Y108: use ternary operator).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8243
diff changeset
1980 )
8529
569623270e29 Finished implementing an extension to the debug/run/... start dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8524
diff changeset
1981 if runProject:
569623270e29 Finished implementing an extension to the debug/run/... start dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8524
diff changeset
1982 scriptName = self.project.getMainScript(True)
10044
fd95315b1c26 Corrected an issue in the debugger UI causing a traceback when trying to run/debug/... a project without a main script defined (see issue 504).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9695
diff changeset
1983 if not scriptName:
fd95315b1c26 Corrected an issue in the debugger UI causing a traceback when trying to run/debug/... a project without a main script defined (see issue 504).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9695
diff changeset
1984 EricMessageBox.critical(
fd95315b1c26 Corrected an issue in the debugger UI causing a traceback when trying to run/debug/... a project without a main script defined (see issue 504).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9695
diff changeset
1985 self.ui,
10306
904f4c7da759 Modified the 'Start' dialog to enhance maintainability.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10065
diff changeset
1986 self.tr("Coverage Run of Project"),
10044
fd95315b1c26 Corrected an issue in the debugger UI causing a traceback when trying to run/debug/... a project without a main script defined (see issue 504).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9695
diff changeset
1987 self.tr(
fd95315b1c26 Corrected an issue in the debugger UI causing a traceback when trying to run/debug/... a project without a main script defined (see issue 504).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9695
diff changeset
1988 "There is no main script defined for the"
fd95315b1c26 Corrected an issue in the debugger UI causing a traceback when trying to run/debug/... a project without a main script defined (see issue 504).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9695
diff changeset
1989 " current project. Aborting"
fd95315b1c26 Corrected an issue in the debugger UI causing a traceback when trying to run/debug/... a project without a main script defined (see issue 504).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9695
diff changeset
1990 ),
fd95315b1c26 Corrected an issue in the debugger UI causing a traceback when trying to run/debug/... a project without a main script defined (see issue 504).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9695
diff changeset
1991 )
fd95315b1c26 Corrected an issue in the debugger UI causing a traceback when trying to run/debug/... a project without a main script defined (see issue 504).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9695
diff changeset
1992 return
8529
569623270e29 Finished implementing an extension to the debug/run/... start dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8524
diff changeset
1993 elif script:
569623270e29 Finished implementing an extension to the debug/run/... start dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8524
diff changeset
1994 scriptName = script
569623270e29 Finished implementing an extension to the debug/run/... start dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8524
diff changeset
1995 elif self.lastDebuggedFile:
569623270e29 Finished implementing an extension to the debug/run/... start dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8524
diff changeset
1996 scriptName = self.lastDebuggedFile
569623270e29 Finished implementing an extension to the debug/run/... start dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8524
diff changeset
1997 else:
569623270e29 Finished implementing an extension to the debug/run/... start dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8524
diff changeset
1998 scriptName = ""
3021
801289962f4e Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3020
diff changeset
1999 dlg = StartDialog(
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
2000 cap,
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
2001 self.lastUsedVenvName,
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
2002 self.argvHistory,
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
2003 self.wdHistory,
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
2004 self.envHistory,
11006
a671918232f3 Modified modal dialog usage to always include a valid parent (needed for Wayland).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10988
diff changeset
2005 parent=self.ui,
a671918232f3 Modified modal dialog usage to always include a valid parent (needed for Wayland).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10988
diff changeset
2006 dialogMode=StartDialogMode.Coverage,
8163
29fb6d420a25 Debugger
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8162
diff changeset
2007 autoClearShell=self.autoClearShell,
8529
569623270e29 Finished implementing an extension to the debug/run/... start dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8524
diff changeset
2008 configOverride=self.overrideGlobalConfig,
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
2009 forProject=runProject,
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
2010 scriptName=scriptName,
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
2011 scriptsList=self.scriptsHistory,
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
2012 )
8143
2c730d5fd177 Changed the use of PyQt enums because the way they were used previously is deprecated since two years and replaced some deprecated Qt stuff.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8010
diff changeset
2013 if dlg.exec() == QDialog.DialogCode.Accepted:
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
2014 (
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
2015 lastUsedVenvName,
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
2016 scriptName,
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
2017 argv,
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
2018 wd,
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
2019 env,
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
2020 clearShell,
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
2021 console,
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
2022 ) = dlg.getData()
8163
29fb6d420a25 Debugger
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8162
diff changeset
2023 configOverride = dlg.getGlobalOverrideData()
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2024 eraseCoverage = dlg.getCoverageData()
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
2025
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2026 if runProject:
3156
86a6528fea9f Fixed a bug in Project.getMainScript.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3032
diff changeset
2027 fn = self.project.getMainScript(True)
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
2028
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
2029 if Preferences.getDebugger(
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
2030 "Autosave"
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
2031 ) and not self.project.saveAllScripts(reportSyntaxErrors=True):
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2032 doNotStart = True
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
2033
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2034 # save the info for later use
2988
f53c03574697 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2703
diff changeset
2035 self.project.setDbgInfo(
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
2036 lastUsedVenvName,
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
2037 argv,
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
2038 wd,
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
2039 env,
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
2040 self.excList,
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
2041 self.excIgnoreList,
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
2042 clearShell,
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
2043 configOverride=configOverride,
8008
ae9ab1e150dc Extended the session functionality to support the new multi process debugging.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7986
diff changeset
2044 )
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
2045
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2046 self.lastStartAction = 6
991
5ec5e707dfa5 Changed algorithm to determine the debugger backend type to be used by analysing a first line starting with '#!'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 945
diff changeset
2047 self.clientType = self.project.getProjectLanguage()
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2048 else:
8529
569623270e29 Finished implementing an extension to the debug/run/... start dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8524
diff changeset
2049 if scriptName:
569623270e29 Finished implementing an extension to the debug/run/... start dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8524
diff changeset
2050 fn = scriptName
569623270e29 Finished implementing an extension to the debug/run/... start dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8524
diff changeset
2051 self.clientType = "Python3"
9285
d697b03e3bcc DebugUI: fixed an issue causing a changed file not being saved before it is run/debugged/...
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9221
diff changeset
2052 editor = self.viewmanager.getOpenEditor(scriptName)
d697b03e3bcc DebugUI: fixed an issue causing a changed file not being saved before it is run/debugged/...
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9221
diff changeset
2053 if editor and not self.viewmanager.checkDirty(
d697b03e3bcc DebugUI: fixed an issue causing a changed file not being saved before it is run/debugged/...
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9221
diff changeset
2054 editor, Preferences.getDebugger("Autosave")
d697b03e3bcc DebugUI: fixed an issue causing a changed file not being saved before it is run/debugged/...
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9221
diff changeset
2055 ):
d697b03e3bcc DebugUI: fixed an issue causing a changed file not being saved before it is run/debugged/...
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9221
diff changeset
2056 return
8529
569623270e29 Finished implementing an extension to the debug/run/... start dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8524
diff changeset
2057 else:
569623270e29 Finished implementing an extension to the debug/run/... start dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8524
diff changeset
2058 # run current editor
569623270e29 Finished implementing an extension to the debug/run/... start dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8524
diff changeset
2059 editor = self.viewmanager.activeWindow()
569623270e29 Finished implementing an extension to the debug/run/... start dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8524
diff changeset
2060 if editor is None:
569623270e29 Finished implementing an extension to the debug/run/... start dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8524
diff changeset
2061 return
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
2062
8529
569623270e29 Finished implementing an extension to the debug/run/... start dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8524
diff changeset
2063 if (
569623270e29 Finished implementing an extension to the debug/run/... start dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8524
diff changeset
2064 not self.viewmanager.checkDirty(
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
2065 editor, Preferences.getDebugger("Autosave")
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
2066 )
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
2067 or editor.getFileName() is None
8529
569623270e29 Finished implementing an extension to the debug/run/... start dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8524
diff changeset
2068 ):
569623270e29 Finished implementing an extension to the debug/run/... start dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8524
diff changeset
2069 return
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
2070
8529
569623270e29 Finished implementing an extension to the debug/run/... start dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8524
diff changeset
2071 fn = editor.getFileName()
569623270e29 Finished implementing an extension to the debug/run/... start dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8524
diff changeset
2072 self.clientType = editor.determineFileType()
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2073 self.lastStartAction = 5
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
2074
10564
0de57f082daa Integrated the 'run', 'profile' and 'coverage' and the restart debugging functions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10540
diff changeset
2075 if (
0de57f082daa Integrated the 'run', 'profile' and 'coverage' and the restart debugging functions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10540
diff changeset
2076 FileSystemUtilities.isRemoteFileName(fn)
0de57f082daa Integrated the 'run', 'profile' and 'coverage' and the restart debugging functions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10540
diff changeset
2077 and not self.ui.isEricServerConnected()
0de57f082daa Integrated the 'run', 'profile' and 'coverage' and the restart debugging functions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10540
diff changeset
2078 ):
0de57f082daa Integrated the 'run', 'profile' and 'coverage' and the restart debugging functions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10540
diff changeset
2079 self.__showNotConnectedWarning(title=cap)
0de57f082daa Integrated the 'run', 'profile' and 'coverage' and the restart debugging functions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10540
diff changeset
2080 return
0de57f082daa Integrated the 'run', 'profile' and 'coverage' and the restart debugging functions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10540
diff changeset
2081
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2082 # save the filename for use by the restart method
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2083 self.lastDebuggedFile = fn
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2084 self.restartAct.setEnabled(True)
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
2085
6352
4bdc6503df81 Continued to remove all explicit references to Python interpreters and replace them by references to virtual environments.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6241
diff changeset
2086 # save the most recently used virtual environment
4bdc6503df81 Continued to remove all explicit references to Python interpreters and replace them by references to virtual environments.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6241
diff changeset
2087 self.lastUsedVenvName = lastUsedVenvName
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
2088
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2089 # This moves any previous occurrence of these arguments to the head
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2090 # of the list.
8529
569623270e29 Finished implementing an extension to the debug/run/... start dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8524
diff changeset
2091 self.setScriptsHistory(scriptName)
5374
c18d759b6b86 Improved the histories handling of the debugger UI.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5373
diff changeset
2092 self.setArgvHistory(argv)
c18d759b6b86 Improved the histories handling of the debugger UI.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5373
diff changeset
2093 self.setWdHistory(wd)
c18d759b6b86 Improved the histories handling of the debugger UI.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5373
diff changeset
2094 self.setEnvHistory(env)
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
2095
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2096 # Save the erase coverage flag
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2097 self.eraseCoverage = eraseCoverage
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
2098
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2099 # Save the clear interpreter flag
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2100 self.autoClearShell = clearShell
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
2101
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2102 # Save the run in console flag
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2103 self.runInConsole = console
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
2104
8163
29fb6d420a25 Debugger
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8162
diff changeset
2105 # Save the global config override data
29fb6d420a25 Debugger
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8162
diff changeset
2106 self.overrideGlobalConfig = copy.deepcopy(configOverride)
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
2107
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2108 # Hide all error highlights
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2109 self.viewmanager.unhighlight()
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
2110
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2111 if not doNotStart:
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
2112 if runProject and self.project.getProjectType() in ["E7Plugin"]:
768
df2dbf3072be Fixed an issue with blanks in pathname of eric plug-ins when developing them.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 761
diff changeset
2113 argv = '--plugin="{0}" {1}'.format(fn, argv)
9409
fab36282c912 Changed the way the IDE script is determined for debugging/running/... an eric IDE plug-in.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9382
diff changeset
2114 fn = "" # script name of the eric IDE is set in debug client
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
2115
2622
08cc2f31c983 Added a viewer for the call stack leading to the current line.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2430
diff changeset
2116 self.debugViewer.initCallStackViewer(runProject)
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
2117
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2118 # Ask the client to open the new program.
3021
801289962f4e Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3020
diff changeset
2119 self.debugServer.remoteCoverage(
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
2120 lastUsedVenvName,
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
2121 fn,
10417
c6011e501282 Modernized some code and converted Debug Client and Debugger source code documentation to the new style.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10415
diff changeset
2122 Utilities.parseOptionString(argv),
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
2123 wd,
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
2124 env,
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
2125 autoClearShell=self.autoClearShell,
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
2126 erase=eraseCoverage,
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
2127 forProject=runProject,
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
2128 runInConsole=console,
8163
29fb6d420a25 Debugger
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8162
diff changeset
2129 clientType=self.clientType,
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
2130 configOverride=self.overrideGlobalConfig,
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
2131 )
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
2132
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2133 self.stopAct.setEnabled(True)
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
2134
5374
c18d759b6b86 Improved the histories handling of the debugger UI.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5373
diff changeset
2135 if dlg.clearHistories():
8529
569623270e29 Finished implementing an extension to the debug/run/... start dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8524
diff changeset
2136 self.setScriptsHistory("", clearHistories=True)
5374
c18d759b6b86 Improved the histories handling of the debugger UI.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5373
diff changeset
2137 self.setArgvHistory("", clearHistories=True)
c18d759b6b86 Improved the histories handling of the debugger UI.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5373
diff changeset
2138 self.setWdHistory("", clearHistories=True)
c18d759b6b86 Improved the histories handling of the debugger UI.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5373
diff changeset
2139 self.setEnvHistory("", clearHistories=True)
7411
6d8dcb3551b3 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7410
diff changeset
2140 self.setMultiprocessNoDebugHistory("", clearHistories=True)
5374
c18d759b6b86 Improved the histories handling of the debugger UI.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5373
diff changeset
2141 elif dlg.historiesModified():
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
2142 (scriptsHistory, argvHistory, wdHistory, envHistory, _) = dlg.getHistories()
8529
569623270e29 Finished implementing an extension to the debug/run/... start dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8524
diff changeset
2143 self.setScriptsHistory("", history=scriptsHistory)
5374
c18d759b6b86 Improved the histories handling of the debugger UI.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5373
diff changeset
2144 self.setArgvHistory("", history=argvHistory)
c18d759b6b86 Improved the histories handling of the debugger UI.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5373
diff changeset
2145 self.setWdHistory("", history=wdHistory)
c18d759b6b86 Improved the histories handling of the debugger UI.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5373
diff changeset
2146 self.setEnvHistory("", history=envHistory)
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
2147
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2148 def __profileScript(self):
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2149 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2150 Private slot to handle the profile script action.
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2151 """
8529
569623270e29 Finished implementing an extension to the debug/run/... start dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8524
diff changeset
2152 self.doProfile(False)
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
2153
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2154 def __profileProject(self):
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2155 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2156 Private slot to handle the profile project action.
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2157 """
9517
d73c3a1e432b Continued refactoring of the project browser related code in order to extract some as plugins later on.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9482
diff changeset
2158 self.processChangedProjectFiles.emit()
8529
569623270e29 Finished implementing an extension to the debug/run/... start dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8524
diff changeset
2159 self.doProfile(True)
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
2160
8529
569623270e29 Finished implementing an extension to the debug/run/... start dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8524
diff changeset
2161 def doProfile(self, runProject, script=""):
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2162 """
8529
569623270e29 Finished implementing an extension to the debug/run/... start dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8524
diff changeset
2163 Public method to handle the profile actions.
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
2164
2988
f53c03574697 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2703
diff changeset
2165 @param runProject flag indicating profiling of the current project
f53c03574697 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2703
diff changeset
2166 (True) or script (False)
8529
569623270e29 Finished implementing an extension to the debug/run/... start dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8524
diff changeset
2167 @type bool
569623270e29 Finished implementing an extension to the debug/run/... start dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8524
diff changeset
2168 @param script name of a script (optional)
569623270e29 Finished implementing an extension to the debug/run/... start dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8524
diff changeset
2169 @type str
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2170 """
10306
904f4c7da759 Modified the 'Start' dialog to enhance maintainability.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10065
diff changeset
2171 from .StartDialog import StartDialog, StartDialogMode
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
2172
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2173 self.__resetUI()
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2174 doNotStart = False
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
2175
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2176 # Get the command line arguments, the working directory and the
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2177 # exception reporting flag.
8257
28146736bbfc Applied some more code simplifications suggested by the new Simplify checker (Y108: use ternary operator).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8243
diff changeset
2178 cap = (
10306
904f4c7da759 Modified the 'Start' dialog to enhance maintainability.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10065
diff changeset
2179 self.tr("Profile Run of Project")
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
2180 if runProject
10306
904f4c7da759 Modified the 'Start' dialog to enhance maintainability.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10065
diff changeset
2181 else self.tr("Profile Run of Script")
8257
28146736bbfc Applied some more code simplifications suggested by the new Simplify checker (Y108: use ternary operator).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8243
diff changeset
2182 )
8529
569623270e29 Finished implementing an extension to the debug/run/... start dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8524
diff changeset
2183 if runProject:
569623270e29 Finished implementing an extension to the debug/run/... start dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8524
diff changeset
2184 scriptName = self.project.getMainScript(True)
10044
fd95315b1c26 Corrected an issue in the debugger UI causing a traceback when trying to run/debug/... a project without a main script defined (see issue 504).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9695
diff changeset
2185 if not scriptName:
fd95315b1c26 Corrected an issue in the debugger UI causing a traceback when trying to run/debug/... a project without a main script defined (see issue 504).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9695
diff changeset
2186 EricMessageBox.critical(
fd95315b1c26 Corrected an issue in the debugger UI causing a traceback when trying to run/debug/... a project without a main script defined (see issue 504).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9695
diff changeset
2187 self.ui,
10306
904f4c7da759 Modified the 'Start' dialog to enhance maintainability.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10065
diff changeset
2188 self.tr("Profile Run of Project"),
10044
fd95315b1c26 Corrected an issue in the debugger UI causing a traceback when trying to run/debug/... a project without a main script defined (see issue 504).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9695
diff changeset
2189 self.tr(
fd95315b1c26 Corrected an issue in the debugger UI causing a traceback when trying to run/debug/... a project without a main script defined (see issue 504).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9695
diff changeset
2190 "There is no main script defined for the"
fd95315b1c26 Corrected an issue in the debugger UI causing a traceback when trying to run/debug/... a project without a main script defined (see issue 504).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9695
diff changeset
2191 " current project. Aborting"
fd95315b1c26 Corrected an issue in the debugger UI causing a traceback when trying to run/debug/... a project without a main script defined (see issue 504).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9695
diff changeset
2192 ),
fd95315b1c26 Corrected an issue in the debugger UI causing a traceback when trying to run/debug/... a project without a main script defined (see issue 504).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9695
diff changeset
2193 )
fd95315b1c26 Corrected an issue in the debugger UI causing a traceback when trying to run/debug/... a project without a main script defined (see issue 504).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9695
diff changeset
2194 return
8529
569623270e29 Finished implementing an extension to the debug/run/... start dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8524
diff changeset
2195 elif script:
569623270e29 Finished implementing an extension to the debug/run/... start dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8524
diff changeset
2196 scriptName = script
569623270e29 Finished implementing an extension to the debug/run/... start dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8524
diff changeset
2197 elif self.lastDebuggedFile:
569623270e29 Finished implementing an extension to the debug/run/... start dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8524
diff changeset
2198 scriptName = self.lastDebuggedFile
569623270e29 Finished implementing an extension to the debug/run/... start dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8524
diff changeset
2199 else:
569623270e29 Finished implementing an extension to the debug/run/... start dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8524
diff changeset
2200 scriptName = ""
2988
f53c03574697 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2703
diff changeset
2201 dlg = StartDialog(
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
2202 cap,
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
2203 self.lastUsedVenvName,
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
2204 self.argvHistory,
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
2205 self.wdHistory,
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
2206 self.envHistory,
11006
a671918232f3 Modified modal dialog usage to always include a valid parent (needed for Wayland).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10988
diff changeset
2207 parent=self.ui,
a671918232f3 Modified modal dialog usage to always include a valid parent (needed for Wayland).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10988
diff changeset
2208 dialogMode=StartDialogMode.Profile,
8163
29fb6d420a25 Debugger
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8162
diff changeset
2209 autoClearShell=self.autoClearShell,
8529
569623270e29 Finished implementing an extension to the debug/run/... start dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8524
diff changeset
2210 configOverride=self.overrideGlobalConfig,
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
2211 forProject=runProject,
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
2212 scriptName=scriptName,
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
2213 scriptsList=self.scriptsHistory,
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
2214 )
8143
2c730d5fd177 Changed the use of PyQt enums because the way they were used previously is deprecated since two years and replaced some deprecated Qt stuff.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8010
diff changeset
2215 if dlg.exec() == QDialog.DialogCode.Accepted:
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
2216 (
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
2217 lastUsedVenvName,
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
2218 scriptName,
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
2219 argv,
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
2220 wd,
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
2221 env,
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
2222 clearShell,
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
2223 console,
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
2224 ) = dlg.getData()
8163
29fb6d420a25 Debugger
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8162
diff changeset
2225 configOverride = dlg.getGlobalOverrideData()
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2226 eraseTimings = dlg.getProfilingData()
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
2227
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2228 if runProject:
3156
86a6528fea9f Fixed a bug in Project.getMainScript.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3032
diff changeset
2229 fn = self.project.getMainScript(True)
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
2230
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
2231 if Preferences.getDebugger(
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
2232 "Autosave"
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
2233 ) and not self.project.saveAllScripts(reportSyntaxErrors=True):
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2234 doNotStart = True
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
2235
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2236 # save the info for later use
2988
f53c03574697 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2703
diff changeset
2237 self.project.setDbgInfo(
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
2238 lastUsedVenvName,
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
2239 argv,
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
2240 wd,
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
2241 env,
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
2242 self.excList,
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
2243 self.excIgnoreList,
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
2244 clearShell,
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
2245 configOverride=configOverride,
8008
ae9ab1e150dc Extended the session functionality to support the new multi process debugging.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7986
diff changeset
2246 )
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
2247
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2248 self.lastStartAction = 8
991
5ec5e707dfa5 Changed algorithm to determine the debugger backend type to be used by analysing a first line starting with '#!'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 945
diff changeset
2249 self.clientType = self.project.getProjectLanguage()
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2250 else:
8529
569623270e29 Finished implementing an extension to the debug/run/... start dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8524
diff changeset
2251 if scriptName:
569623270e29 Finished implementing an extension to the debug/run/... start dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8524
diff changeset
2252 fn = scriptName
569623270e29 Finished implementing an extension to the debug/run/... start dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8524
diff changeset
2253 self.clientType = "Python3"
9285
d697b03e3bcc DebugUI: fixed an issue causing a changed file not being saved before it is run/debugged/...
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9221
diff changeset
2254 editor = self.viewmanager.getOpenEditor(scriptName)
d697b03e3bcc DebugUI: fixed an issue causing a changed file not being saved before it is run/debugged/...
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9221
diff changeset
2255 if editor and not self.viewmanager.checkDirty(
d697b03e3bcc DebugUI: fixed an issue causing a changed file not being saved before it is run/debugged/...
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9221
diff changeset
2256 editor, Preferences.getDebugger("Autosave")
d697b03e3bcc DebugUI: fixed an issue causing a changed file not being saved before it is run/debugged/...
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9221
diff changeset
2257 ):
d697b03e3bcc DebugUI: fixed an issue causing a changed file not being saved before it is run/debugged/...
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9221
diff changeset
2258 return
8529
569623270e29 Finished implementing an extension to the debug/run/... start dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8524
diff changeset
2259 else:
569623270e29 Finished implementing an extension to the debug/run/... start dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8524
diff changeset
2260 # run current editor
569623270e29 Finished implementing an extension to the debug/run/... start dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8524
diff changeset
2261 editor = self.viewmanager.activeWindow()
569623270e29 Finished implementing an extension to the debug/run/... start dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8524
diff changeset
2262 if editor is None:
569623270e29 Finished implementing an extension to the debug/run/... start dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8524
diff changeset
2263 return
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
2264
8529
569623270e29 Finished implementing an extension to the debug/run/... start dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8524
diff changeset
2265 if (
569623270e29 Finished implementing an extension to the debug/run/... start dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8524
diff changeset
2266 not self.viewmanager.checkDirty(
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
2267 editor, Preferences.getDebugger("Autosave")
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
2268 )
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
2269 or editor.getFileName() is None
8529
569623270e29 Finished implementing an extension to the debug/run/... start dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8524
diff changeset
2270 ):
569623270e29 Finished implementing an extension to the debug/run/... start dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8524
diff changeset
2271 return
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
2272
8529
569623270e29 Finished implementing an extension to the debug/run/... start dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8524
diff changeset
2273 fn = editor.getFileName()
569623270e29 Finished implementing an extension to the debug/run/... start dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8524
diff changeset
2274 self.clientType = editor.determineFileType()
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2275 self.lastStartAction = 7
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
2276
10564
0de57f082daa Integrated the 'run', 'profile' and 'coverage' and the restart debugging functions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10540
diff changeset
2277 if (
0de57f082daa Integrated the 'run', 'profile' and 'coverage' and the restart debugging functions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10540
diff changeset
2278 FileSystemUtilities.isRemoteFileName(fn)
0de57f082daa Integrated the 'run', 'profile' and 'coverage' and the restart debugging functions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10540
diff changeset
2279 and not self.ui.isEricServerConnected()
0de57f082daa Integrated the 'run', 'profile' and 'coverage' and the restart debugging functions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10540
diff changeset
2280 ):
0de57f082daa Integrated the 'run', 'profile' and 'coverage' and the restart debugging functions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10540
diff changeset
2281 self.__showNotConnectedWarning(title=cap)
0de57f082daa Integrated the 'run', 'profile' and 'coverage' and the restart debugging functions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10540
diff changeset
2282 return
0de57f082daa Integrated the 'run', 'profile' and 'coverage' and the restart debugging functions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10540
diff changeset
2283
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2284 # save the filename for use by the restart method
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2285 self.lastDebuggedFile = fn
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2286 self.restartAct.setEnabled(True)
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
2287
6352
4bdc6503df81 Continued to remove all explicit references to Python interpreters and replace them by references to virtual environments.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6241
diff changeset
2288 # save the most recently used virtual environment
4bdc6503df81 Continued to remove all explicit references to Python interpreters and replace them by references to virtual environments.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6241
diff changeset
2289 self.lastUsedVenvName = lastUsedVenvName
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
2290
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2291 # This moves any previous occurrence of these arguments to the head
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2292 # of the list.
8529
569623270e29 Finished implementing an extension to the debug/run/... start dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8524
diff changeset
2293 self.setScriptsHistory(scriptName)
5374
c18d759b6b86 Improved the histories handling of the debugger UI.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5373
diff changeset
2294 self.setArgvHistory(argv)
c18d759b6b86 Improved the histories handling of the debugger UI.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5373
diff changeset
2295 self.setWdHistory(wd)
c18d759b6b86 Improved the histories handling of the debugger UI.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5373
diff changeset
2296 self.setEnvHistory(env)
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
2297
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2298 # Save the erase timing flag
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2299 self.eraseTimings = eraseTimings
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
2300
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2301 # Save the clear interpreter flag
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2302 self.autoClearShell = clearShell
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
2303
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2304 # Save the run in console flag
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2305 self.runInConsole = console
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
2306
8163
29fb6d420a25 Debugger
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8162
diff changeset
2307 # Save the global config override data
29fb6d420a25 Debugger
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8162
diff changeset
2308 self.overrideGlobalConfig = copy.deepcopy(configOverride)
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
2309
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2310 # Hide all error highlights
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2311 self.viewmanager.unhighlight()
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
2312
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2313 if not doNotStart:
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
2314 if runProject and self.project.getProjectType() in ["E7Plugin"]:
768
df2dbf3072be Fixed an issue with blanks in pathname of eric plug-ins when developing them.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 761
diff changeset
2315 argv = '--plugin="{0}" {1}'.format(fn, argv)
9409
fab36282c912 Changed the way the IDE script is determined for debugging/running/... an eric IDE plug-in.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9382
diff changeset
2316 fn = "" # script name of the eric IDE is set in debug client
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
2317
2622
08cc2f31c983 Added a viewer for the call stack leading to the current line.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2430
diff changeset
2318 self.debugViewer.initCallStackViewer(runProject)
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
2319
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2320 # Ask the client to open the new program.
3021
801289962f4e Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3020
diff changeset
2321 self.debugServer.remoteProfile(
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
2322 lastUsedVenvName,
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
2323 fn,
10417
c6011e501282 Modernized some code and converted Debug Client and Debugger source code documentation to the new style.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10415
diff changeset
2324 Utilities.parseOptionString(argv),
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
2325 wd,
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
2326 env,
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
2327 autoClearShell=self.autoClearShell,
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
2328 erase=eraseTimings,
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
2329 forProject=runProject,
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
2330 runInConsole=console,
8163
29fb6d420a25 Debugger
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8162
diff changeset
2331 clientType=self.clientType,
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
2332 configOverride=self.overrideGlobalConfig,
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
2333 )
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
2334
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2335 self.stopAct.setEnabled(True)
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
2336
5374
c18d759b6b86 Improved the histories handling of the debugger UI.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5373
diff changeset
2337 if dlg.clearHistories():
8529
569623270e29 Finished implementing an extension to the debug/run/... start dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8524
diff changeset
2338 self.setScriptsHistory("", clearHistories=True)
5374
c18d759b6b86 Improved the histories handling of the debugger UI.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5373
diff changeset
2339 self.setArgvHistory("", clearHistories=True)
c18d759b6b86 Improved the histories handling of the debugger UI.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5373
diff changeset
2340 self.setWdHistory("", clearHistories=True)
c18d759b6b86 Improved the histories handling of the debugger UI.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5373
diff changeset
2341 self.setEnvHistory("", clearHistories=True)
7411
6d8dcb3551b3 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7410
diff changeset
2342 self.setMultiprocessNoDebugHistory("", clearHistories=True)
5374
c18d759b6b86 Improved the histories handling of the debugger UI.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5373
diff changeset
2343 elif dlg.historiesModified():
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
2344 (scriptsHistory, argvHistory, wdHistory, envHistory, _) = dlg.getHistories()
8529
569623270e29 Finished implementing an extension to the debug/run/... start dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8524
diff changeset
2345 self.setScriptsHistory("", history=scriptsHistory)
5374
c18d759b6b86 Improved the histories handling of the debugger UI.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5373
diff changeset
2346 self.setArgvHistory("", history=argvHistory)
c18d759b6b86 Improved the histories handling of the debugger UI.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5373
diff changeset
2347 self.setWdHistory("", history=wdHistory)
c18d759b6b86 Improved the histories handling of the debugger UI.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5373
diff changeset
2348 self.setEnvHistory("", history=envHistory)
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
2349
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2350 def __runScript(self):
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2351 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2352 Private slot to handle the run script action.
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2353 """
8529
569623270e29 Finished implementing an extension to the debug/run/... start dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8524
diff changeset
2354 self.doRun(False)
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
2355
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2356 def __runProject(self):
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2357 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2358 Private slot to handle the run project action.
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2359 """
9517
d73c3a1e432b Continued refactoring of the project browser related code in order to extract some as plugins later on.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9482
diff changeset
2360 self.processChangedProjectFiles.emit()
8529
569623270e29 Finished implementing an extension to the debug/run/... start dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8524
diff changeset
2361 self.doRun(True)
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
2362
8529
569623270e29 Finished implementing an extension to the debug/run/... start dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8524
diff changeset
2363 def doRun(self, runProject, script=""):
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2364 """
8529
569623270e29 Finished implementing an extension to the debug/run/... start dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8524
diff changeset
2365 Public method to handle the run actions.
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
2366
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2367 @param runProject flag indicating running the current project (True)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2368 or script (False)
8529
569623270e29 Finished implementing an extension to the debug/run/... start dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8524
diff changeset
2369 @type bool
569623270e29 Finished implementing an extension to the debug/run/... start dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8524
diff changeset
2370 @param script name of a script (optional)
569623270e29 Finished implementing an extension to the debug/run/... start dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8524
diff changeset
2371 @type str
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2372 """
10306
904f4c7da759 Modified the 'Start' dialog to enhance maintainability.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10065
diff changeset
2373 from .StartDialog import StartDialog, StartDialogMode
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
2374
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2375 self.__resetUI()
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2376 doNotStart = False
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
2377
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2378 # Get the command line arguments, the working directory and the
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2379 # exception reporting flag.
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
2380 cap = self.tr("Run Project") if runProject else self.tr("Run Script")
8529
569623270e29 Finished implementing an extension to the debug/run/... start dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8524
diff changeset
2381 if runProject:
569623270e29 Finished implementing an extension to the debug/run/... start dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8524
diff changeset
2382 scriptName = self.project.getMainScript(True)
10044
fd95315b1c26 Corrected an issue in the debugger UI causing a traceback when trying to run/debug/... a project without a main script defined (see issue 504).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9695
diff changeset
2383 if not scriptName:
fd95315b1c26 Corrected an issue in the debugger UI causing a traceback when trying to run/debug/... a project without a main script defined (see issue 504).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9695
diff changeset
2384 EricMessageBox.critical(
fd95315b1c26 Corrected an issue in the debugger UI causing a traceback when trying to run/debug/... a project without a main script defined (see issue 504).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9695
diff changeset
2385 self.ui,
fd95315b1c26 Corrected an issue in the debugger UI causing a traceback when trying to run/debug/... a project without a main script defined (see issue 504).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9695
diff changeset
2386 self.tr("Run Project"),
fd95315b1c26 Corrected an issue in the debugger UI causing a traceback when trying to run/debug/... a project without a main script defined (see issue 504).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9695
diff changeset
2387 self.tr(
fd95315b1c26 Corrected an issue in the debugger UI causing a traceback when trying to run/debug/... a project without a main script defined (see issue 504).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9695
diff changeset
2388 "There is no main script defined for the"
fd95315b1c26 Corrected an issue in the debugger UI causing a traceback when trying to run/debug/... a project without a main script defined (see issue 504).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9695
diff changeset
2389 " current project. Aborting"
fd95315b1c26 Corrected an issue in the debugger UI causing a traceback when trying to run/debug/... a project without a main script defined (see issue 504).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9695
diff changeset
2390 ),
fd95315b1c26 Corrected an issue in the debugger UI causing a traceback when trying to run/debug/... a project without a main script defined (see issue 504).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9695
diff changeset
2391 )
fd95315b1c26 Corrected an issue in the debugger UI causing a traceback when trying to run/debug/... a project without a main script defined (see issue 504).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9695
diff changeset
2392 return
8529
569623270e29 Finished implementing an extension to the debug/run/... start dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8524
diff changeset
2393 elif script:
569623270e29 Finished implementing an extension to the debug/run/... start dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8524
diff changeset
2394 scriptName = script
569623270e29 Finished implementing an extension to the debug/run/... start dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8524
diff changeset
2395 elif self.lastDebuggedFile:
569623270e29 Finished implementing an extension to the debug/run/... start dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8524
diff changeset
2396 scriptName = self.lastDebuggedFile
569623270e29 Finished implementing an extension to the debug/run/... start dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8524
diff changeset
2397 else:
569623270e29 Finished implementing an extension to the debug/run/... start dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8524
diff changeset
2398 scriptName = ""
2988
f53c03574697 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2703
diff changeset
2399 dlg = StartDialog(
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
2400 cap,
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
2401 self.lastUsedVenvName,
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
2402 self.argvHistory,
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
2403 self.wdHistory,
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
2404 self.envHistory,
11006
a671918232f3 Modified modal dialog usage to always include a valid parent (needed for Wayland).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10988
diff changeset
2405 parent=self.ui,
a671918232f3 Modified modal dialog usage to always include a valid parent (needed for Wayland).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10988
diff changeset
2406 dialogMode=StartDialogMode.Run,
8162
8358c3c95841 Started implementing functionality to override some global configuration per debug run.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8143
diff changeset
2407 autoClearShell=self.autoClearShell,
8529
569623270e29 Finished implementing an extension to the debug/run/... start dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8524
diff changeset
2408 configOverride=self.overrideGlobalConfig,
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
2409 forProject=runProject,
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
2410 scriptName=scriptName,
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
2411 scriptsList=self.scriptsHistory,
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
2412 )
8143
2c730d5fd177 Changed the use of PyQt enums because the way they were used previously is deprecated since two years and replaced some deprecated Qt stuff.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8010
diff changeset
2413 if dlg.exec() == QDialog.DialogCode.Accepted:
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
2414 (
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
2415 lastUsedVenvName,
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
2416 scriptName,
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
2417 argv,
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
2418 wd,
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
2419 env,
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
2420 clearShell,
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
2421 console,
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
2422 ) = dlg.getData()
8163
29fb6d420a25 Debugger
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8162
diff changeset
2423 configOverride = dlg.getGlobalOverrideData()
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
2424
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2425 if runProject:
3156
86a6528fea9f Fixed a bug in Project.getMainScript.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3032
diff changeset
2426 fn = self.project.getMainScript(True)
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
2427
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
2428 if Preferences.getDebugger(
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
2429 "Autosave"
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
2430 ) and not self.project.saveAllScripts(reportSyntaxErrors=True):
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2431 doNotStart = True
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
2432
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2433 # save the info for later use
2988
f53c03574697 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2703
diff changeset
2434 self.project.setDbgInfo(
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
2435 lastUsedVenvName,
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
2436 argv,
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
2437 wd,
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
2438 env,
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
2439 self.excList,
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
2440 self.excIgnoreList,
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
2441 clearShell,
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
2442 configOverride=configOverride,
8008
ae9ab1e150dc Extended the session functionality to support the new multi process debugging.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7986
diff changeset
2443 )
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
2444
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2445 self.lastStartAction = 4
991
5ec5e707dfa5 Changed algorithm to determine the debugger backend type to be used by analysing a first line starting with '#!'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 945
diff changeset
2446 self.clientType = self.project.getProjectLanguage()
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2447 else:
8529
569623270e29 Finished implementing an extension to the debug/run/... start dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8524
diff changeset
2448 if scriptName:
569623270e29 Finished implementing an extension to the debug/run/... start dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8524
diff changeset
2449 fn = scriptName
569623270e29 Finished implementing an extension to the debug/run/... start dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8524
diff changeset
2450 self.clientType = "Python3"
9285
d697b03e3bcc DebugUI: fixed an issue causing a changed file not being saved before it is run/debugged/...
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9221
diff changeset
2451 editor = self.viewmanager.getOpenEditor(scriptName)
d697b03e3bcc DebugUI: fixed an issue causing a changed file not being saved before it is run/debugged/...
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9221
diff changeset
2452 if editor and not self.viewmanager.checkDirty(
d697b03e3bcc DebugUI: fixed an issue causing a changed file not being saved before it is run/debugged/...
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9221
diff changeset
2453 editor, Preferences.getDebugger("Autosave")
d697b03e3bcc DebugUI: fixed an issue causing a changed file not being saved before it is run/debugged/...
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9221
diff changeset
2454 ):
d697b03e3bcc DebugUI: fixed an issue causing a changed file not being saved before it is run/debugged/...
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9221
diff changeset
2455 return
8529
569623270e29 Finished implementing an extension to the debug/run/... start dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8524
diff changeset
2456 else:
569623270e29 Finished implementing an extension to the debug/run/... start dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8524
diff changeset
2457 # run current editor
569623270e29 Finished implementing an extension to the debug/run/... start dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8524
diff changeset
2458 editor = self.viewmanager.activeWindow()
569623270e29 Finished implementing an extension to the debug/run/... start dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8524
diff changeset
2459 if editor is None:
569623270e29 Finished implementing an extension to the debug/run/... start dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8524
diff changeset
2460 return
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
2461
8529
569623270e29 Finished implementing an extension to the debug/run/... start dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8524
diff changeset
2462 if (
569623270e29 Finished implementing an extension to the debug/run/... start dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8524
diff changeset
2463 not self.viewmanager.checkDirty(
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
2464 editor, Preferences.getDebugger("Autosave")
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
2465 )
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
2466 or editor.getFileName() is None
8529
569623270e29 Finished implementing an extension to the debug/run/... start dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8524
diff changeset
2467 ):
569623270e29 Finished implementing an extension to the debug/run/... start dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8524
diff changeset
2468 return
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
2469
8529
569623270e29 Finished implementing an extension to the debug/run/... start dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8524
diff changeset
2470 fn = editor.getFileName()
569623270e29 Finished implementing an extension to the debug/run/... start dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8524
diff changeset
2471 self.clientType = editor.determineFileType()
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2472 self.lastStartAction = 3
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
2473
10564
0de57f082daa Integrated the 'run', 'profile' and 'coverage' and the restart debugging functions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10540
diff changeset
2474 if (
0de57f082daa Integrated the 'run', 'profile' and 'coverage' and the restart debugging functions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10540
diff changeset
2475 FileSystemUtilities.isRemoteFileName(fn)
0de57f082daa Integrated the 'run', 'profile' and 'coverage' and the restart debugging functions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10540
diff changeset
2476 and not self.ui.isEricServerConnected()
0de57f082daa Integrated the 'run', 'profile' and 'coverage' and the restart debugging functions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10540
diff changeset
2477 ):
0de57f082daa Integrated the 'run', 'profile' and 'coverage' and the restart debugging functions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10540
diff changeset
2478 self.__showNotConnectedWarning(title=cap)
0de57f082daa Integrated the 'run', 'profile' and 'coverage' and the restart debugging functions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10540
diff changeset
2479 return
0de57f082daa Integrated the 'run', 'profile' and 'coverage' and the restart debugging functions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10540
diff changeset
2480
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2481 # save the filename for use by the restart method
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2482 self.lastDebuggedFile = fn
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2483 self.restartAct.setEnabled(True)
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
2484
6352
4bdc6503df81 Continued to remove all explicit references to Python interpreters and replace them by references to virtual environments.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6241
diff changeset
2485 # save the most recently used virtual environment
4bdc6503df81 Continued to remove all explicit references to Python interpreters and replace them by references to virtual environments.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6241
diff changeset
2486 self.lastUsedVenvName = lastUsedVenvName
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
2487
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2488 # This moves any previous occurrence of these arguments to the head
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2489 # of the list.
8529
569623270e29 Finished implementing an extension to the debug/run/... start dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8524
diff changeset
2490 self.setScriptsHistory(scriptName)
5374
c18d759b6b86 Improved the histories handling of the debugger UI.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5373
diff changeset
2491 self.setArgvHistory(argv)
c18d759b6b86 Improved the histories handling of the debugger UI.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5373
diff changeset
2492 self.setWdHistory(wd)
c18d759b6b86 Improved the histories handling of the debugger UI.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5373
diff changeset
2493 self.setEnvHistory(env)
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
2494
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2495 # Save the clear interpreter flag
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2496 self.autoClearShell = clearShell
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
2497
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2498 # Save the run in console flag
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2499 self.runInConsole = console
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
2500
8162
8358c3c95841 Started implementing functionality to override some global configuration per debug run.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8143
diff changeset
2501 # Save the global config override data
8163
29fb6d420a25 Debugger
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8162
diff changeset
2502 self.overrideGlobalConfig = copy.deepcopy(configOverride)
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
2503
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2504 # Hide all error highlights
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2505 self.viewmanager.unhighlight()
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
2506
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2507 if not doNotStart:
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
2508 if runProject and self.project.getProjectType() in ["E7Plugin"]:
768
df2dbf3072be Fixed an issue with blanks in pathname of eric plug-ins when developing them.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 761
diff changeset
2509 argv = '--plugin="{0}" {1}'.format(fn, argv)
9409
fab36282c912 Changed the way the IDE script is determined for debugging/running/... an eric IDE plug-in.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9382
diff changeset
2510 fn = "" # script name of the eric IDE is set in debug client
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
2511
2622
08cc2f31c983 Added a viewer for the call stack leading to the current line.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2430
diff changeset
2512 self.debugViewer.initCallStackViewer(runProject)
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
2513
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2514 # Ask the client to open the new program.
3021
801289962f4e Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3020
diff changeset
2515 self.debugServer.remoteRun(
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
2516 lastUsedVenvName,
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
2517 fn,
10417
c6011e501282 Modernized some code and converted Debug Client and Debugger source code documentation to the new style.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10415
diff changeset
2518 Utilities.parseOptionString(argv),
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
2519 wd,
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
2520 env,
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
2521 autoClearShell=self.autoClearShell,
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
2522 forProject=runProject,
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
2523 runInConsole=console,
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
2524 clientType=self.clientType,
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
2525 configOverride=self.overrideGlobalConfig,
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
2526 )
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
2527
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2528 self.stopAct.setEnabled(True)
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
2529
5374
c18d759b6b86 Improved the histories handling of the debugger UI.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5373
diff changeset
2530 if dlg.clearHistories():
8529
569623270e29 Finished implementing an extension to the debug/run/... start dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8524
diff changeset
2531 self.setScriptsHistory("", clearHistories=True)
5374
c18d759b6b86 Improved the histories handling of the debugger UI.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5373
diff changeset
2532 self.setArgvHistory("", clearHistories=True)
c18d759b6b86 Improved the histories handling of the debugger UI.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5373
diff changeset
2533 self.setWdHistory("", clearHistories=True)
c18d759b6b86 Improved the histories handling of the debugger UI.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5373
diff changeset
2534 self.setEnvHistory("", clearHistories=True)
7411
6d8dcb3551b3 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7410
diff changeset
2535 self.setMultiprocessNoDebugHistory("", clearHistories=True)
5374
c18d759b6b86 Improved the histories handling of the debugger UI.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5373
diff changeset
2536 elif dlg.historiesModified():
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
2537 (scriptsHistory, argvHistory, wdHistory, envHistory, _) = dlg.getHistories()
8529
569623270e29 Finished implementing an extension to the debug/run/... start dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8524
diff changeset
2538 self.setScriptsHistory("", history=scriptsHistory)
5374
c18d759b6b86 Improved the histories handling of the debugger UI.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5373
diff changeset
2539 self.setArgvHistory("", history=argvHistory)
c18d759b6b86 Improved the histories handling of the debugger UI.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5373
diff changeset
2540 self.setWdHistory("", history=wdHistory)
c18d759b6b86 Improved the histories handling of the debugger UI.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5373
diff changeset
2541 self.setEnvHistory("", history=envHistory)
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
2542
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2543 def __debugScript(self):
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2544 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2545 Private slot to handle the debug script action.
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2546 """
8529
569623270e29 Finished implementing an extension to the debug/run/... start dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8524
diff changeset
2547 self.doDebug(False)
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
2548
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2549 def __debugProject(self):
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2550 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2551 Private slot to handle the debug project action.
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2552 """
9517
d73c3a1e432b Continued refactoring of the project browser related code in order to extract some as plugins later on.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9482
diff changeset
2553 self.processChangedProjectFiles.emit()
8529
569623270e29 Finished implementing an extension to the debug/run/... start dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8524
diff changeset
2554 self.doDebug(True)
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
2555
8529
569623270e29 Finished implementing an extension to the debug/run/... start dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8524
diff changeset
2556 def doDebug(self, debugProject, script=""):
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2557 """
8529
569623270e29 Finished implementing an extension to the debug/run/... start dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8524
diff changeset
2558 Public method to handle the debug actions.
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
2559
2988
f53c03574697 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2703
diff changeset
2560 @param debugProject flag indicating debugging the current project
f53c03574697 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2703
diff changeset
2561 (True) or script (False)
8529
569623270e29 Finished implementing an extension to the debug/run/... start dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8524
diff changeset
2562 @type bool
10564
0de57f082daa Integrated the 'run', 'profile' and 'coverage' and the restart debugging functions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10540
diff changeset
2563 @param script name of a script (defaults to "")
0de57f082daa Integrated the 'run', 'profile' and 'coverage' and the restart debugging functions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10540
diff changeset
2564 @type str (optional)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2565 """
10306
904f4c7da759 Modified the 'Start' dialog to enhance maintainability.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10065
diff changeset
2566 from .StartDialog import StartDialog, StartDialogMode
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
2567
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2568 self.__resetUI()
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2569 doNotStart = False
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
2570
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2571 # Get the command line arguments, the working directory and the
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2572 # exception reporting flag.
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
2573 cap = self.tr("Debug Project") if debugProject else self.tr("Debug Script")
8529
569623270e29 Finished implementing an extension to the debug/run/... start dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8524
diff changeset
2574 if debugProject:
569623270e29 Finished implementing an extension to the debug/run/... start dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8524
diff changeset
2575 scriptName = self.project.getMainScript(True)
10044
fd95315b1c26 Corrected an issue in the debugger UI causing a traceback when trying to run/debug/... a project without a main script defined (see issue 504).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9695
diff changeset
2576 if not scriptName:
fd95315b1c26 Corrected an issue in the debugger UI causing a traceback when trying to run/debug/... a project without a main script defined (see issue 504).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9695
diff changeset
2577 EricMessageBox.critical(
fd95315b1c26 Corrected an issue in the debugger UI causing a traceback when trying to run/debug/... a project without a main script defined (see issue 504).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9695
diff changeset
2578 self.ui,
fd95315b1c26 Corrected an issue in the debugger UI causing a traceback when trying to run/debug/... a project without a main script defined (see issue 504).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9695
diff changeset
2579 self.tr("Debug Project"),
fd95315b1c26 Corrected an issue in the debugger UI causing a traceback when trying to run/debug/... a project without a main script defined (see issue 504).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9695
diff changeset
2580 self.tr(
fd95315b1c26 Corrected an issue in the debugger UI causing a traceback when trying to run/debug/... a project without a main script defined (see issue 504).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9695
diff changeset
2581 "There is no main script defined for the"
fd95315b1c26 Corrected an issue in the debugger UI causing a traceback when trying to run/debug/... a project without a main script defined (see issue 504).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9695
diff changeset
2582 " current project. No debugging possible."
fd95315b1c26 Corrected an issue in the debugger UI causing a traceback when trying to run/debug/... a project without a main script defined (see issue 504).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9695
diff changeset
2583 ),
fd95315b1c26 Corrected an issue in the debugger UI causing a traceback when trying to run/debug/... a project without a main script defined (see issue 504).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9695
diff changeset
2584 )
fd95315b1c26 Corrected an issue in the debugger UI causing a traceback when trying to run/debug/... a project without a main script defined (see issue 504).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9695
diff changeset
2585 return
8529
569623270e29 Finished implementing an extension to the debug/run/... start dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8524
diff changeset
2586 elif script:
569623270e29 Finished implementing an extension to the debug/run/... start dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8524
diff changeset
2587 scriptName = script
569623270e29 Finished implementing an extension to the debug/run/... start dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8524
diff changeset
2588 elif self.lastDebuggedFile:
569623270e29 Finished implementing an extension to the debug/run/... start dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8524
diff changeset
2589 scriptName = self.lastDebuggedFile
569623270e29 Finished implementing an extension to the debug/run/... start dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8524
diff changeset
2590 else:
569623270e29 Finished implementing an extension to the debug/run/... start dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8524
diff changeset
2591 scriptName = ""
10630
552a790fd9bc Corrected some issues and improved some existing code with respect to eric-ide server use.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10597
diff changeset
2592 if (
552a790fd9bc Corrected some issues and improved some existing code with respect to eric-ide server use.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10597
diff changeset
2593 scriptName
552a790fd9bc Corrected some issues and improved some existing code with respect to eric-ide server use.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10597
diff changeset
2594 and FileSystemUtilities.isRemoteFileName(scriptName)
552a790fd9bc Corrected some issues and improved some existing code with respect to eric-ide server use.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10597
diff changeset
2595 and not self.ui.isEricServerConnected()
552a790fd9bc Corrected some issues and improved some existing code with respect to eric-ide server use.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10597
diff changeset
2596 ):
552a790fd9bc Corrected some issues and improved some existing code with respect to eric-ide server use.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10597
diff changeset
2597 self.__showNotConnectedWarning(title=cap, name=scriptName)
552a790fd9bc Corrected some issues and improved some existing code with respect to eric-ide server use.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10597
diff changeset
2598 return
552a790fd9bc Corrected some issues and improved some existing code with respect to eric-ide server use.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10597
diff changeset
2599
2988
f53c03574697 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2703
diff changeset
2600 dlg = StartDialog(
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
2601 cap,
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
2602 self.lastUsedVenvName,
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
2603 self.argvHistory,
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
2604 self.wdHistory,
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
2605 self.envHistory,
11006
a671918232f3 Modified modal dialog usage to always include a valid parent (needed for Wayland).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10988
diff changeset
2606 parent=self.ui,
a671918232f3 Modified modal dialog usage to always include a valid parent (needed for Wayland).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10988
diff changeset
2607 dialogMode=StartDialogMode.Debug,
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
2608 tracePython=self.tracePython,
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
2609 autoClearShell=self.autoClearShell,
7874
8dcb77600690 Debugger: removed the 'fork' options for the Run and Debug start options because they are obsolete.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7863
diff changeset
2610 autoContinue=self.autoContinue,
10321
4a017fdf316f Debugger
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10306
diff changeset
2611 reportAllExceptions=self.reportAllExceptions,
7411
6d8dcb3551b3 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7410
diff changeset
2612 enableMultiprocess=self.enableMultiprocess,
8163
29fb6d420a25 Debugger
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8162
diff changeset
2613 multiprocessNoDebugHistory=self.multiprocessNoDebugHistory,
8529
569623270e29 Finished implementing an extension to the debug/run/... start dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8524
diff changeset
2614 configOverride=self.overrideGlobalConfig,
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
2615 forProject=debugProject,
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
2616 scriptName=scriptName,
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
2617 scriptsList=self.scriptsHistory,
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
2618 )
8143
2c730d5fd177 Changed the use of PyQt enums because the way they were used previously is deprecated since two years and replaced some deprecated Qt stuff.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8010
diff changeset
2619 if dlg.exec() == QDialog.DialogCode.Accepted:
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
2620 (
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
2621 lastUsedVenvName,
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
2622 scriptName,
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
2623 argv,
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
2624 wd,
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
2625 env,
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
2626 clearShell,
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
2627 console,
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
2628 ) = dlg.getData()
8163
29fb6d420a25 Debugger
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8162
diff changeset
2629 configOverride = dlg.getGlobalOverrideData()
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
2630 (
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
2631 tracePython,
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
2632 autoContinue,
10321
4a017fdf316f Debugger
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10306
diff changeset
2633 reportAllExceptions,
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
2634 enableMultiprocess,
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
2635 multiprocessNoDebug,
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
2636 ) = dlg.getDebugData()
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
2637
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2638 if debugProject:
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2639 fn = self.project.getMainScript(True)
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
2640
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
2641 if Preferences.getDebugger(
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
2642 "Autosave"
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
2643 ) and not self.project.saveAllScripts(reportSyntaxErrors=True):
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2644 doNotStart = True
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
2645
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2646 # save the info for later use
2988
f53c03574697 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2703
diff changeset
2647 self.project.setDbgInfo(
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
2648 lastUsedVenvName,
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
2649 argv,
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
2650 wd,
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
2651 env,
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
2652 self.excList,
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
2653 self.excIgnoreList,
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
2654 clearShell,
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
2655 tracePython=tracePython,
8008
ae9ab1e150dc Extended the session functionality to support the new multi process debugging.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7986
diff changeset
2656 autoContinue=autoContinue,
10321
4a017fdf316f Debugger
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10306
diff changeset
2657 reportAllExceptions=reportAllExceptions,
8008
ae9ab1e150dc Extended the session functionality to support the new multi process debugging.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7986
diff changeset
2658 enableMultiprocess=enableMultiprocess,
8163
29fb6d420a25 Debugger
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8162
diff changeset
2659 multiprocessNoDebug=multiprocessNoDebug,
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
2660 configOverride=configOverride,
8008
ae9ab1e150dc Extended the session functionality to support the new multi process debugging.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7986
diff changeset
2661 )
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
2662
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2663 self.lastStartAction = 2
991
5ec5e707dfa5 Changed algorithm to determine the debugger backend type to be used by analysing a first line starting with '#!'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 945
diff changeset
2664 self.clientType = self.project.getProjectLanguage()
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2665 else:
8529
569623270e29 Finished implementing an extension to the debug/run/... start dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8524
diff changeset
2666 if scriptName:
569623270e29 Finished implementing an extension to the debug/run/... start dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8524
diff changeset
2667 fn = scriptName
569623270e29 Finished implementing an extension to the debug/run/... start dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8524
diff changeset
2668 self.clientType = "Python3"
9285
d697b03e3bcc DebugUI: fixed an issue causing a changed file not being saved before it is run/debugged/...
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9221
diff changeset
2669 editor = self.viewmanager.getOpenEditor(scriptName)
d697b03e3bcc DebugUI: fixed an issue causing a changed file not being saved before it is run/debugged/...
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9221
diff changeset
2670 if editor and not self.viewmanager.checkDirty(
d697b03e3bcc DebugUI: fixed an issue causing a changed file not being saved before it is run/debugged/...
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9221
diff changeset
2671 editor, Preferences.getDebugger("Autosave")
d697b03e3bcc DebugUI: fixed an issue causing a changed file not being saved before it is run/debugged/...
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9221
diff changeset
2672 ):
d697b03e3bcc DebugUI: fixed an issue causing a changed file not being saved before it is run/debugged/...
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9221
diff changeset
2673 return
8529
569623270e29 Finished implementing an extension to the debug/run/... start dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8524
diff changeset
2674 else:
569623270e29 Finished implementing an extension to the debug/run/... start dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8524
diff changeset
2675 # debug current editor
569623270e29 Finished implementing an extension to the debug/run/... start dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8524
diff changeset
2676 editor = self.viewmanager.activeWindow()
569623270e29 Finished implementing an extension to the debug/run/... start dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8524
diff changeset
2677 if editor is None:
569623270e29 Finished implementing an extension to the debug/run/... start dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8524
diff changeset
2678 return
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
2679
8529
569623270e29 Finished implementing an extension to the debug/run/... start dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8524
diff changeset
2680 if (
569623270e29 Finished implementing an extension to the debug/run/... start dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8524
diff changeset
2681 not self.viewmanager.checkDirty(
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
2682 editor, Preferences.getDebugger("Autosave")
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
2683 )
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
2684 or editor.getFileName() is None
8529
569623270e29 Finished implementing an extension to the debug/run/... start dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8524
diff changeset
2685 ):
569623270e29 Finished implementing an extension to the debug/run/... start dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8524
diff changeset
2686 return
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
2687
8529
569623270e29 Finished implementing an extension to the debug/run/... start dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8524
diff changeset
2688 fn = editor.getFileName()
569623270e29 Finished implementing an extension to the debug/run/... start dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8524
diff changeset
2689 self.clientType = editor.determineFileType()
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2690 self.lastStartAction = 1
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
2691
10564
0de57f082daa Integrated the 'run', 'profile' and 'coverage' and the restart debugging functions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10540
diff changeset
2692 if (
0de57f082daa Integrated the 'run', 'profile' and 'coverage' and the restart debugging functions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10540
diff changeset
2693 FileSystemUtilities.isRemoteFileName(fn)
0de57f082daa Integrated the 'run', 'profile' and 'coverage' and the restart debugging functions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10540
diff changeset
2694 and not self.ui.isEricServerConnected()
0de57f082daa Integrated the 'run', 'profile' and 'coverage' and the restart debugging functions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10540
diff changeset
2695 ):
10630
552a790fd9bc Corrected some issues and improved some existing code with respect to eric-ide server use.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10597
diff changeset
2696 self.__showNotConnectedWarning(title=cap, name=fn)
10564
0de57f082daa Integrated the 'run', 'profile' and 'coverage' and the restart debugging functions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10540
diff changeset
2697 return
0de57f082daa Integrated the 'run', 'profile' and 'coverage' and the restart debugging functions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10540
diff changeset
2698
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2699 # save the filename for use by the restart method
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2700 self.lastDebuggedFile = fn
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2701 self.restartAct.setEnabled(True)
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
2702
6352
4bdc6503df81 Continued to remove all explicit references to Python interpreters and replace them by references to virtual environments.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6241
diff changeset
2703 # save the most recently used virtual environment
4bdc6503df81 Continued to remove all explicit references to Python interpreters and replace them by references to virtual environments.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6241
diff changeset
2704 self.lastUsedVenvName = lastUsedVenvName
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
2705
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2706 # This moves any previous occurrence of these arguments to the head
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2707 # of the list.
8529
569623270e29 Finished implementing an extension to the debug/run/... start dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8524
diff changeset
2708 self.setScriptsHistory(scriptName)
5374
c18d759b6b86 Improved the histories handling of the debugger UI.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5373
diff changeset
2709 self.setArgvHistory(argv)
c18d759b6b86 Improved the histories handling of the debugger UI.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5373
diff changeset
2710 self.setWdHistory(wd)
c18d759b6b86 Improved the histories handling of the debugger UI.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5373
diff changeset
2711 self.setEnvHistory(env)
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
2712
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2713 # Save the tracePython flag
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2714 self.tracePython = tracePython
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
2715
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2716 # Save the clear interpreter flag
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2717 self.autoClearShell = clearShell
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
2718
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2719 # Save the run in console flag
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2720 self.runInConsole = console
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
2721
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2722 # Save the auto continue flag
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2723 self.autoContinue = autoContinue
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
2724
10321
4a017fdf316f Debugger
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10306
diff changeset
2725 # Save the exception reporting flag
4a017fdf316f Debugger
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10306
diff changeset
2726 self.reportAllExceptions = reportAllExceptions
4a017fdf316f Debugger
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10306
diff changeset
2727
7411
6d8dcb3551b3 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7410
diff changeset
2728 # Save the multiprocess debugging data
7409
1413bfe73d41 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7408
diff changeset
2729 self.enableMultiprocess = enableMultiprocess
7411
6d8dcb3551b3 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7410
diff changeset
2730 self.setMultiprocessNoDebugHistory(multiprocessNoDebug)
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
2731
8163
29fb6d420a25 Debugger
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8162
diff changeset
2732 # Save the global config override data
29fb6d420a25 Debugger
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8162
diff changeset
2733 self.overrideGlobalConfig = copy.deepcopy(configOverride)
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
2734
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2735 # Hide all error highlights
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2736 self.viewmanager.unhighlight()
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
2737
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2738 if not doNotStart:
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
2739 if debugProject and self.project.getProjectType() in ["E7Plugin"]:
768
df2dbf3072be Fixed an issue with blanks in pathname of eric plug-ins when developing them.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 761
diff changeset
2740 argv = '--plugin="{0}" {1}'.format(fn, argv)
9409
fab36282c912 Changed the way the IDE script is determined for debugging/running/... an eric IDE plug-in.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9382
diff changeset
2741 fn = "" # script name of the eric IDE is set in debug client
945
8cd4d08fa9f6 Made code mostly PEP 8 compliant (except all whitespace and line length).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 816
diff changeset
2742 tracePython = True # override flag because it must be true
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
2743
2622
08cc2f31c983 Added a viewer for the call stack leading to the current line.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2430
diff changeset
2744 self.debugViewer.initCallStackViewer(debugProject)
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
2745
2170
f4e0f6133ace Started implementing the call trace functionality.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2021
diff changeset
2746 # Ask the client to send call trace info
f4e0f6133ace Started implementing the call trace functionality.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2021
diff changeset
2747 enableCallTrace = self.debugViewer.isCallTraceEnabled()
2171
c7dd548d67d8 Finished the coding part of the call trace functionality.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2170
diff changeset
2748 self.debugViewer.clearCallTrace()
c7dd548d67d8 Finished the coding part of the call trace functionality.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2170
diff changeset
2749 self.debugViewer.setCallTraceToProjectMode(debugProject)
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
2750
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2751 # Ask the client to open the new program.
3021
801289962f4e Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3020
diff changeset
2752 self.debugServer.remoteLoad(
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
2753 lastUsedVenvName,
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
2754 fn,
10417
c6011e501282 Modernized some code and converted Debug Client and Debugger source code documentation to the new style.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10415
diff changeset
2755 Utilities.parseOptionString(argv),
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
2756 wd,
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
2757 env,
2988
f53c03574697 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2703
diff changeset
2758 autoClearShell=self.autoClearShell,
f53c03574697 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2703
diff changeset
2759 tracePython=tracePython,
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
2760 autoContinue=autoContinue,
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
2761 forProject=debugProject,
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
2762 runInConsole=console,
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
2763 clientType=self.clientType,
7409
1413bfe73d41 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7408
diff changeset
2764 enableCallTrace=enableCallTrace,
7411
6d8dcb3551b3 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7410
diff changeset
2765 enableMultiprocess=enableMultiprocess,
8163
29fb6d420a25 Debugger
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8162
diff changeset
2766 multiprocessNoDebug=multiprocessNoDebug,
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
2767 configOverride=self.overrideGlobalConfig,
10321
4a017fdf316f Debugger
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10306
diff changeset
2768 reportAllExceptions=self.reportAllExceptions,
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
2769 )
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
2770
7251
bc5b1b00560a Continued to resolve code style issue M841.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7229
diff changeset
2771 if (
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
2772 self.debugServer.isClientProcessUp()
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
2773 and self.debugServer.getClientType() == self.clientType
7251
bc5b1b00560a Continued to resolve code style issue M841.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7229
diff changeset
2774 ):
6376
201067699041 Debugger: fixed some more cases, where the debugger is not supported or configured.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6352
diff changeset
2775 # Signal that we have started a debugging session
201067699041 Debugger: fixed some more cases, where the debugger is not supported or configured.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6352
diff changeset
2776 self.debuggingStarted.emit(fn)
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
2777
6376
201067699041 Debugger: fixed some more cases, where the debugger is not supported or configured.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6352
diff changeset
2778 self.stopAct.setEnabled(True)
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
2779
5374
c18d759b6b86 Improved the histories handling of the debugger UI.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5373
diff changeset
2780 if dlg.clearHistories():
8529
569623270e29 Finished implementing an extension to the debug/run/... start dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8524
diff changeset
2781 self.setScriptsHistory("", clearHistories=True)
5374
c18d759b6b86 Improved the histories handling of the debugger UI.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5373
diff changeset
2782 self.setArgvHistory("", clearHistories=True)
c18d759b6b86 Improved the histories handling of the debugger UI.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5373
diff changeset
2783 self.setWdHistory("", clearHistories=True)
c18d759b6b86 Improved the histories handling of the debugger UI.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5373
diff changeset
2784 self.setEnvHistory("", clearHistories=True)
7411
6d8dcb3551b3 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7410
diff changeset
2785 self.setMultiprocessNoDebugHistory("", clearHistories=True)
5374
c18d759b6b86 Improved the histories handling of the debugger UI.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5373
diff changeset
2786 elif dlg.historiesModified():
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
2787 (
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
2788 scriptsHistory,
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
2789 argvHistory,
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
2790 wdHistory,
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
2791 envHistory,
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
2792 noDebugHistory,
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
2793 ) = dlg.getHistories()
8529
569623270e29 Finished implementing an extension to the debug/run/... start dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8524
diff changeset
2794 self.setScriptsHistory("", history=scriptsHistory)
5374
c18d759b6b86 Improved the histories handling of the debugger UI.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5373
diff changeset
2795 self.setArgvHistory("", history=argvHistory)
c18d759b6b86 Improved the histories handling of the debugger UI.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5373
diff changeset
2796 self.setWdHistory("", history=wdHistory)
c18d759b6b86 Improved the histories handling of the debugger UI.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5373
diff changeset
2797 self.setEnvHistory("", history=envHistory)
7411
6d8dcb3551b3 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7410
diff changeset
2798 self.setMultiprocessNoDebugHistory("", history=noDebugHistory)
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
2799
10415
af9a6dac2611 Testing
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10321
diff changeset
2800 def debugInternalScript(
af9a6dac2611 Testing
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10321
diff changeset
2801 self, venvName, scriptName, argv, workDir, environment, clientType, forProject
af9a6dac2611 Testing
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10321
diff changeset
2802 ):
af9a6dac2611 Testing
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10321
diff changeset
2803 """
af9a6dac2611 Testing
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10321
diff changeset
2804 Public method to run an internal script with debugger support.
af9a6dac2611 Testing
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10321
diff changeset
2805
af9a6dac2611 Testing
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10321
diff changeset
2806 @param venvName name of the environment for the debug tests run
af9a6dac2611 Testing
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10321
diff changeset
2807 @type str
af9a6dac2611 Testing
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10321
diff changeset
2808 @param scriptName name of the internal script to be run
af9a6dac2611 Testing
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10321
diff changeset
2809 @type str
af9a6dac2611 Testing
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10321
diff changeset
2810 @param argv string or list containing the parameters for the script
af9a6dac2611 Testing
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10321
diff changeset
2811 @type str or list of str
af9a6dac2611 Testing
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10321
diff changeset
2812 @param workDir working directory for the script
af9a6dac2611 Testing
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10321
diff changeset
2813 @type str
10417
c6011e501282 Modernized some code and converted Debug Client and Debugger source code documentation to the new style.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10415
diff changeset
2814 @param environment environment parameter override for the debug run
c6011e501282 Modernized some code and converted Debug Client and Debugger source code documentation to the new style.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10415
diff changeset
2815 @type str or dict
10415
af9a6dac2611 Testing
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10321
diff changeset
2816 @param clientType type (language) of the debug client to be used
af9a6dac2611 Testing
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10321
diff changeset
2817 @type str
af9a6dac2611 Testing
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10321
diff changeset
2818 @param forProject flag indicating a project related debug session
af9a6dac2611 Testing
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10321
diff changeset
2819 @type bool
af9a6dac2611 Testing
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10321
diff changeset
2820 """
af9a6dac2611 Testing
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10321
diff changeset
2821 self.__resetUI()
af9a6dac2611 Testing
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10321
diff changeset
2822
af9a6dac2611 Testing
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10321
diff changeset
2823 # Hide all error highlights
af9a6dac2611 Testing
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10321
diff changeset
2824 self.viewmanager.unhighlight()
af9a6dac2611 Testing
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10321
diff changeset
2825
af9a6dac2611 Testing
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10321
diff changeset
2826 self.debugViewer.initCallStackViewer(forProject)
af9a6dac2611 Testing
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10321
diff changeset
2827
af9a6dac2611 Testing
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10321
diff changeset
2828 # Ask the client to send call trace info
af9a6dac2611 Testing
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10321
diff changeset
2829 enableCallTrace = self.debugViewer.isCallTraceEnabled()
af9a6dac2611 Testing
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10321
diff changeset
2830 self.debugViewer.clearCallTrace()
af9a6dac2611 Testing
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10321
diff changeset
2831 self.debugViewer.setCallTraceToProjectMode(forProject)
af9a6dac2611 Testing
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10321
diff changeset
2832
10417
c6011e501282 Modernized some code and converted Debug Client and Debugger source code documentation to the new style.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10415
diff changeset
2833 args = argv if isinstance(argv, list) else shlex.split(argv)
10415
af9a6dac2611 Testing
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10321
diff changeset
2834 # Ask the client to open the new program.
af9a6dac2611 Testing
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10321
diff changeset
2835 self.debugServer.remoteLoad(
af9a6dac2611 Testing
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10321
diff changeset
2836 venvName,
af9a6dac2611 Testing
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10321
diff changeset
2837 scriptName,
af9a6dac2611 Testing
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10321
diff changeset
2838 args,
af9a6dac2611 Testing
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10321
diff changeset
2839 workDir,
af9a6dac2611 Testing
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10321
diff changeset
2840 environment,
af9a6dac2611 Testing
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10321
diff changeset
2841 clientType=clientType,
af9a6dac2611 Testing
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10321
diff changeset
2842 enableCallTrace=enableCallTrace,
af9a6dac2611 Testing
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10321
diff changeset
2843 )
af9a6dac2611 Testing
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10321
diff changeset
2844
af9a6dac2611 Testing
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10321
diff changeset
2845 if (
af9a6dac2611 Testing
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10321
diff changeset
2846 self.debugServer.isClientProcessUp()
af9a6dac2611 Testing
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10321
diff changeset
2847 and self.debugServer.getClientType() == clientType
af9a6dac2611 Testing
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10321
diff changeset
2848 ):
af9a6dac2611 Testing
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10321
diff changeset
2849 # Signal that we have started a debugging session
af9a6dac2611 Testing
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10321
diff changeset
2850 self.debuggingStarted.emit(scriptName)
af9a6dac2611 Testing
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10321
diff changeset
2851
af9a6dac2611 Testing
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10321
diff changeset
2852 self.stopAct.setEnabled(True)
af9a6dac2611 Testing
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10321
diff changeset
2853
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2854 def __doRestart(self):
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2855 """
2988
f53c03574697 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2703
diff changeset
2856 Private slot to handle the restart action to restart the last
f53c03574697 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2703
diff changeset
2857 debugged file.
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2858 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2859 self.__resetUI()
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2860 doNotStart = False
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
2861
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2862 # first save any changes
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2863 if self.lastStartAction in [1, 3, 5, 7, 9]:
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2864 editor = self.viewmanager.getOpenEditor(self.lastDebuggedFile)
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
2865 if editor and not self.viewmanager.checkDirty(
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
2866 editor, Preferences.getDebugger("Autosave")
7251
bc5b1b00560a Continued to resolve code style issue M841.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7229
diff changeset
2867 ):
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2868 return
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2869 forProject = False
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2870 elif self.lastStartAction in [2, 4, 6, 8, 10]:
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
2871 if Preferences.getDebugger("Autosave") and not self.project.saveAllScripts(
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
2872 reportSyntaxErrors=True
7251
bc5b1b00560a Continued to resolve code style issue M841.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7229
diff changeset
2873 ):
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2874 doNotStart = True
9517
d73c3a1e432b Continued refactoring of the project browser related code in order to extract some as plugins later on.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9482
diff changeset
2875 self.processChangedProjectFiles.emit()
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2876 forProject = True
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2877 else:
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
2878 return # should not happen
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
2879
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2880 # get the saved stuff
6352
4bdc6503df81 Continued to remove all explicit references to Python interpreters and replace them by references to virtual environments.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6241
diff changeset
2881 venvName = self.lastUsedVenvName
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2882 wd = self.wdHistory[0]
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2883 argv = self.argvHistory[0]
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2884 fn = self.lastDebuggedFile
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2885 env = self.envHistory[0]
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
2886
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2887 # Hide all error highlights
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2888 self.viewmanager.unhighlight()
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
2889
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2890 if not doNotStart:
10564
0de57f082daa Integrated the 'run', 'profile' and 'coverage' and the restart debugging functions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10540
diff changeset
2891 if (
0de57f082daa Integrated the 'run', 'profile' and 'coverage' and the restart debugging functions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10540
diff changeset
2892 FileSystemUtilities.isRemoteFileName(fn)
0de57f082daa Integrated the 'run', 'profile' and 'coverage' and the restart debugging functions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10540
diff changeset
2893 and not self.ui.isEricServerConnected()
0de57f082daa Integrated the 'run', 'profile' and 'coverage' and the restart debugging functions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10540
diff changeset
2894 ):
0de57f082daa Integrated the 'run', 'profile' and 'coverage' and the restart debugging functions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10540
diff changeset
2895 self.__showNotConnectedWarning(title=self.tr("Restart"))
0de57f082daa Integrated the 'run', 'profile' and 'coverage' and the restart debugging functions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10540
diff changeset
2896 return
0de57f082daa Integrated the 'run', 'profile' and 'coverage' and the restart debugging functions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10540
diff changeset
2897
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
2898 if forProject and self.project.getProjectType() in ["E7Plugin"]:
768
df2dbf3072be Fixed an issue with blanks in pathname of eric plug-ins when developing them.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 761
diff changeset
2899 argv = '--plugin="{0}" {1}'.format(fn, argv)
9409
fab36282c912 Changed the way the IDE script is determined for debugging/running/... an eric IDE plug-in.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9382
diff changeset
2900 fn = "" # script name of the eric IDE is set in debug client
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
2901
2622
08cc2f31c983 Added a viewer for the call stack leading to the current line.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2430
diff changeset
2902 self.debugViewer.initCallStackViewer(forProject)
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
2903
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2904 if self.lastStartAction in [1, 2]:
2170
f4e0f6133ace Started implementing the call trace functionality.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2021
diff changeset
2905 # Ask the client to send call trace info
f4e0f6133ace Started implementing the call trace functionality.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2021
diff changeset
2906 enableCallTrace = self.debugViewer.isCallTraceEnabled()
2171
c7dd548d67d8 Finished the coding part of the call trace functionality.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2170
diff changeset
2907 self.debugViewer.clearCallTrace()
c7dd548d67d8 Finished the coding part of the call trace functionality.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2170
diff changeset
2908 self.debugViewer.setCallTraceToProjectMode(forProject)
7411
6d8dcb3551b3 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7410
diff changeset
2909 multiprocessNoDebug = self.multiprocessNoDebugHistory[0]
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
2910
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2911 # Ask the client to debug the new program.
2988
f53c03574697 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2703
diff changeset
2912 self.debugServer.remoteLoad(
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
2913 venvName,
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
2914 fn,
10417
c6011e501282 Modernized some code and converted Debug Client and Debugger source code documentation to the new style.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10415
diff changeset
2915 Utilities.parseOptionString(argv),
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
2916 wd,
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
2917 env,
2988
f53c03574697 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2703
diff changeset
2918 autoClearShell=self.autoClearShell,
f53c03574697 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2703
diff changeset
2919 tracePython=self.tracePython,
f53c03574697 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2703
diff changeset
2920 autoContinue=self.autoContinue,
f53c03574697 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2703
diff changeset
2921 forProject=forProject,
f53c03574697 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2703
diff changeset
2922 runInConsole=self.runInConsole,
f53c03574697 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2703
diff changeset
2923 clientType=self.clientType,
7409
1413bfe73d41 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7408
diff changeset
2924 enableCallTrace=enableCallTrace,
7411
6d8dcb3551b3 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7410
diff changeset
2925 enableMultiprocess=self.enableMultiprocess,
8163
29fb6d420a25 Debugger
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8162
diff changeset
2926 multiprocessNoDebug=multiprocessNoDebug,
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
2927 configOverride=self.overrideGlobalConfig,
10540
7631c0ba2877 DebugUI
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10439
diff changeset
2928 reportAllExceptions=self.reportAllExceptions,
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
2929 )
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
2930
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2931 # Signal that we have started a debugging session
482
4650a72c307a Continued porting signal/slot usage to the new API.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 481
diff changeset
2932 self.debuggingStarted.emit(fn)
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
2933
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2934 elif self.lastStartAction in [3, 4]:
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2935 # Ask the client to run the new program.
2988
f53c03574697 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2703
diff changeset
2936 self.debugServer.remoteRun(
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
2937 venvName,
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
2938 fn,
10417
c6011e501282 Modernized some code and converted Debug Client and Debugger source code documentation to the new style.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10415
diff changeset
2939 Utilities.parseOptionString(argv),
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
2940 wd,
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
2941 env,
2988
f53c03574697 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2703
diff changeset
2942 autoClearShell=self.autoClearShell,
f53c03574697 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2703
diff changeset
2943 forProject=forProject,
f53c03574697 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2703
diff changeset
2944 runInConsole=self.runInConsole,
8163
29fb6d420a25 Debugger
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8162
diff changeset
2945 clientType=self.clientType,
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
2946 configOverride=self.overrideGlobalConfig,
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
2947 )
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
2948
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2949 elif self.lastStartAction in [5, 6]:
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2950 # Ask the client to coverage run the new program.
2988
f53c03574697 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2703
diff changeset
2951 self.debugServer.remoteCoverage(
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
2952 venvName,
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
2953 fn,
10417
c6011e501282 Modernized some code and converted Debug Client and Debugger source code documentation to the new style.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10415
diff changeset
2954 Utilities.parseOptionString(argv),
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
2955 wd,
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
2956 env,
2988
f53c03574697 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2703
diff changeset
2957 autoClearShell=self.autoClearShell,
f53c03574697 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2703
diff changeset
2958 erase=self.eraseCoverage,
f53c03574697 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2703
diff changeset
2959 forProject=forProject,
f53c03574697 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2703
diff changeset
2960 runInConsole=self.runInConsole,
8163
29fb6d420a25 Debugger
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8162
diff changeset
2961 clientType=self.clientType,
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
2962 configOverride=self.overrideGlobalConfig,
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
2963 )
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
2964
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2965 elif self.lastStartAction in [7, 8]:
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2966 # Ask the client to profile run the new program.
2988
f53c03574697 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2703
diff changeset
2967 self.debugServer.remoteProfile(
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
2968 venvName,
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
2969 fn,
10417
c6011e501282 Modernized some code and converted Debug Client and Debugger source code documentation to the new style.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10415
diff changeset
2970 Utilities.parseOptionString(argv),
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
2971 wd,
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
2972 env,
2988
f53c03574697 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2703
diff changeset
2973 autoClearShell=self.autoClearShell,
f53c03574697 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2703
diff changeset
2974 erase=self.eraseTimings,
f53c03574697 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2703
diff changeset
2975 forProject=forProject,
f53c03574697 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2703
diff changeset
2976 runInConsole=self.runInConsole,
8163
29fb6d420a25 Debugger
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8162
diff changeset
2977 clientType=self.clientType,
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
2978 configOverride=self.overrideGlobalConfig,
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
2979 )
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
2980
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2981 self.stopAct.setEnabled(True)
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
2982
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2983 def __stopScript(self):
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2984 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2985 Private slot to stop the running script.
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2986 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2987 self.debugServer.startClient(False)
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
2988
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2989 def __passiveDebugStarted(self, fn, exc):
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2990 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2991 Private slot to handle a passive debug session start.
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
2992
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2993 @param fn filename of the debugged script
10417
c6011e501282 Modernized some code and converted Debug Client and Debugger source code documentation to the new style.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10415
diff changeset
2994 @type str
c6011e501282 Modernized some code and converted Debug Client and Debugger source code documentation to the new style.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10415
diff changeset
2995 @param exc flag to enable exception reporting of the IDE
c6011e501282 Modernized some code and converted Debug Client and Debugger source code documentation to the new style.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10415
diff changeset
2996 @type bool
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2997 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2998 # Hide all error highlights
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2999 self.viewmanager.unhighlight()
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
3000
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
3001 # Set filename of script being debugged
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
3002 self.ui.currentProg = fn
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
3003
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
3004 # Set exception reporting
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
3005 self.setExceptionReporting(exc)
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
3006
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
3007 # Signal that we have started a debugging session
482
4650a72c307a Continued porting signal/slot usage to the new API.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 481
diff changeset
3008 self.debuggingStarted.emit(fn)
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
3009
2622
08cc2f31c983 Added a viewer for the call stack leading to the current line.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2430
diff changeset
3010 # Initialize the call stack viewer
08cc2f31c983 Added a viewer for the call stack leading to the current line.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2430
diff changeset
3011 self.debugViewer.initCallStackViewer(False)
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
3012
7411
6d8dcb3551b3 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7410
diff changeset
3013 def __continue(self, debuggerId=""):
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
3014 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
3015 Private method to handle the Continue action.
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
3016
7411
6d8dcb3551b3 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7410
diff changeset
3017 @param debuggerId ID of the debugger backend
6d8dcb3551b3 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7410
diff changeset
3018 @type str
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
3019 """
7411
6d8dcb3551b3 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7410
diff changeset
3020 if not debuggerId:
6d8dcb3551b3 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7410
diff changeset
3021 debuggerId = self.getSelectedDebuggerId()
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
3022
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
3023 self.lastAction = 0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
3024 self.__enterRemote()
7411
6d8dcb3551b3 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7410
diff changeset
3025 self.debugServer.remoteContinue(debuggerId)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
3026
7411
6d8dcb3551b3 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7410
diff changeset
3027 def __specialContinue(self, debuggerId=""):
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
3028 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
3029 Private method to handle the Special Continue action.
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
3030
7411
6d8dcb3551b3 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7410
diff changeset
3031 @param debuggerId ID of the debugger backend
6d8dcb3551b3 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7410
diff changeset
3032 @type str
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
3033 """
7411
6d8dcb3551b3 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7410
diff changeset
3034 if not debuggerId:
6d8dcb3551b3 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7410
diff changeset
3035 debuggerId = self.getSelectedDebuggerId()
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
3036
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
3037 self.lastAction = 2
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
3038 self.__enterRemote()
7411
6d8dcb3551b3 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7410
diff changeset
3039 self.debugServer.remoteContinue(debuggerId, 1)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
3040
7411
6d8dcb3551b3 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7410
diff changeset
3041 def __step(self, debuggerId=""):
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
3042 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
3043 Private method to handle the Step action.
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
3044
7411
6d8dcb3551b3 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7410
diff changeset
3045 @param debuggerId ID of the debugger backend
6d8dcb3551b3 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7410
diff changeset
3046 @type str
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
3047 """
7411
6d8dcb3551b3 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7410
diff changeset
3048 if not debuggerId:
6d8dcb3551b3 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7410
diff changeset
3049 debuggerId = self.getSelectedDebuggerId()
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
3050
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
3051 self.lastAction = 1
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
3052 self.__enterRemote()
7411
6d8dcb3551b3 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7410
diff changeset
3053 self.debugServer.remoteStep(debuggerId)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
3054
7411
6d8dcb3551b3 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7410
diff changeset
3055 def __stepOver(self, debuggerId=""):
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
3056 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
3057 Private method to handle the Step Over action.
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
3058
7411
6d8dcb3551b3 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7410
diff changeset
3059 @param debuggerId ID of the debugger backend
6d8dcb3551b3 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7410
diff changeset
3060 @type str
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
3061 """
7411
6d8dcb3551b3 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7410
diff changeset
3062 if not debuggerId:
6d8dcb3551b3 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7410
diff changeset
3063 debuggerId = self.getSelectedDebuggerId()
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
3064
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
3065 self.lastAction = 2
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
3066 self.__enterRemote()
7411
6d8dcb3551b3 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7410
diff changeset
3067 self.debugServer.remoteStepOver(debuggerId)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
3068
7411
6d8dcb3551b3 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7410
diff changeset
3069 def __stepOut(self, debuggerId=""):
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
3070 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
3071 Private method to handle the Step Out action.
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
3072
7411
6d8dcb3551b3 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7410
diff changeset
3073 @param debuggerId ID of the debugger backend
6d8dcb3551b3 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7410
diff changeset
3074 @type str
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
3075 """
7411
6d8dcb3551b3 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7410
diff changeset
3076 if not debuggerId:
6d8dcb3551b3 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7410
diff changeset
3077 debuggerId = self.getSelectedDebuggerId()
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
3078
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
3079 self.lastAction = 3
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
3080 self.__enterRemote()
7411
6d8dcb3551b3 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7410
diff changeset
3081 self.debugServer.remoteStepOut(debuggerId)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
3082
7411
6d8dcb3551b3 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7410
diff changeset
3083 def __stepQuit(self, debuggerId=""):
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
3084 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
3085 Private method to handle the Step Quit action.
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
3086
7411
6d8dcb3551b3 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7410
diff changeset
3087 @param debuggerId ID of the debugger backend
6d8dcb3551b3 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7410
diff changeset
3088 @type str
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
3089 """
7411
6d8dcb3551b3 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7410
diff changeset
3090 if not debuggerId:
6d8dcb3551b3 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7410
diff changeset
3091 debuggerId = self.getSelectedDebuggerId()
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
3092
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
3093 self.lastAction = 4
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
3094 self.__enterRemote()
7411
6d8dcb3551b3 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7410
diff changeset
3095 self.debugServer.remoteStepQuit(debuggerId)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
3096 self.__resetUI()
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
3097
7411
6d8dcb3551b3 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7410
diff changeset
3098 def __runToCursor(self, debuggerId=""):
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
3099 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
3100 Private method to handle the Run to Cursor action.
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
3101
7411
6d8dcb3551b3 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7410
diff changeset
3102 @param debuggerId ID of the debugger backend
6d8dcb3551b3 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7410
diff changeset
3103 @type str
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
3104 """
7411
6d8dcb3551b3 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7410
diff changeset
3105 if not debuggerId:
6d8dcb3551b3 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7410
diff changeset
3106 debuggerId = self.getSelectedDebuggerId()
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
3107
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
3108 self.lastAction = 0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
3109 aw = self.viewmanager.activeWindow()
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
3110 line = aw.getCursorPosition()[0] + 1
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
3111 self.__enterRemote()
3021
801289962f4e Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3020
diff changeset
3112 self.debugServer.remoteBreakpoint(
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
3113 self.getSelectedDebuggerId(), aw.getFileName(), line, 1, None, 1
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
3114 )
7411
6d8dcb3551b3 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7410
diff changeset
3115 self.debugServer.remoteContinue(debuggerId)
5658
e5f6fe5855fd move the instruction pointer within the current function (Hotkey: F12)
T.Rzepka <Tobias.Rzepka@gmail.com>
parents: 5590
diff changeset
3116
7897
9acc015ea443 Debugger: added support for the "Continue Until" debug action.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7876
diff changeset
3117 def __runUntil(self, debuggerId=""):
9acc015ea443 Debugger: added support for the "Continue Until" debug action.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7876
diff changeset
3118 """
9acc015ea443 Debugger: added support for the "Continue Until" debug action.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7876
diff changeset
3119 Private method to handle the Run Until action.
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
3120
7897
9acc015ea443 Debugger: added support for the "Continue Until" debug action.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7876
diff changeset
3121 @param debuggerId ID of the debugger backend
9acc015ea443 Debugger: added support for the "Continue Until" debug action.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7876
diff changeset
3122 @type str
9acc015ea443 Debugger: added support for the "Continue Until" debug action.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7876
diff changeset
3123 """
9acc015ea443 Debugger: added support for the "Continue Until" debug action.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7876
diff changeset
3124 if not debuggerId:
9acc015ea443 Debugger: added support for the "Continue Until" debug action.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7876
diff changeset
3125 debuggerId = self.getSelectedDebuggerId()
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
3126
7897
9acc015ea443 Debugger: added support for the "Continue Until" debug action.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7876
diff changeset
3127 self.lastAction = 0
9acc015ea443 Debugger: added support for the "Continue Until" debug action.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7876
diff changeset
3128 aw = self.viewmanager.activeWindow()
9acc015ea443 Debugger: added support for the "Continue Until" debug action.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7876
diff changeset
3129 line = aw.getCursorPosition()[0] + 1
9acc015ea443 Debugger: added support for the "Continue Until" debug action.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7876
diff changeset
3130 self.__enterRemote()
9acc015ea443 Debugger: added support for the "Continue Until" debug action.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7876
diff changeset
3131 self.debugServer.remoteContinueUntil(debuggerId, line)
9acc015ea443 Debugger: added support for the "Continue Until" debug action.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7876
diff changeset
3132
7411
6d8dcb3551b3 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7410
diff changeset
3133 def __moveInstructionPointer(self, debuggerId=""):
5658
e5f6fe5855fd move the instruction pointer within the current function (Hotkey: F12)
T.Rzepka <Tobias.Rzepka@gmail.com>
parents: 5590
diff changeset
3134 """
e5f6fe5855fd move the instruction pointer within the current function (Hotkey: F12)
T.Rzepka <Tobias.Rzepka@gmail.com>
parents: 5590
diff changeset
3135 Private method to move the instruction pointer to a different line.
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
3136
7411
6d8dcb3551b3 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7410
diff changeset
3137 @param debuggerId ID of the debugger backend
6d8dcb3551b3 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7410
diff changeset
3138 @type str
5658
e5f6fe5855fd move the instruction pointer within the current function (Hotkey: F12)
T.Rzepka <Tobias.Rzepka@gmail.com>
parents: 5590
diff changeset
3139 """
7411
6d8dcb3551b3 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7410
diff changeset
3140 if not debuggerId:
6d8dcb3551b3 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7410
diff changeset
3141 debuggerId = self.getSelectedDebuggerId()
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
3142
5658
e5f6fe5855fd move the instruction pointer within the current function (Hotkey: F12)
T.Rzepka <Tobias.Rzepka@gmail.com>
parents: 5590
diff changeset
3143 self.lastAction = 0
e5f6fe5855fd move the instruction pointer within the current function (Hotkey: F12)
T.Rzepka <Tobias.Rzepka@gmail.com>
parents: 5590
diff changeset
3144 aw = self.viewmanager.activeWindow()
e5f6fe5855fd move the instruction pointer within the current function (Hotkey: F12)
T.Rzepka <Tobias.Rzepka@gmail.com>
parents: 5590
diff changeset
3145 line = aw.getCursorPosition()[0] + 1
7411
6d8dcb3551b3 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7410
diff changeset
3146 self.debugServer.remoteMoveIP(debuggerId, line)
5658
e5f6fe5855fd move the instruction pointer within the current function (Hotkey: F12)
T.Rzepka <Tobias.Rzepka@gmail.com>
parents: 5590
diff changeset
3147
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
3148 def __enterRemote(self):
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
3149 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
3150 Private method to update the user interface.
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
3151
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
3152 This method is called just prior to executing some of
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
3153 the program being debugged.
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
3154 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
3155 # Disable further debug commands from the user.
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
3156 self.debugActGrp.setEnabled(False)
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
3157
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
3158 self.viewmanager.unhighlight(True)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
3159
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
3160 def getActions(self):
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
3161 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
3162 Public method to get a list of all actions.
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
3163
10417
c6011e501282 Modernized some code and converted Debug Client and Debugger source code documentation to the new style.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10415
diff changeset
3164 @return list of all actions
c6011e501282 Modernized some code and converted Debug Client and Debugger source code documentation to the new style.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10415
diff changeset
3165 @rtype list of EricAction
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
3166 """
755
e81e1f8d7874 Added display of suppressed client termination messages.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 564
diff changeset
3167 return self.actions[:]
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
3168
7379
72a72fd56494 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7377
diff changeset
3169 def getSelectedDebuggerId(self):
72a72fd56494 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7377
diff changeset
3170 """
72a72fd56494 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7377
diff changeset
3171 Public method to get the currently selected debugger ID.
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
3172
7379
72a72fd56494 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7377
diff changeset
3173 @return selected debugger ID
72a72fd56494 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7377
diff changeset
3174 @rtype str
72a72fd56494 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7377
diff changeset
3175 """
72a72fd56494 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7377
diff changeset
3176 return self.debugViewer.getSelectedDebuggerId()
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
3177
7405
bf6be3cff6cf Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7397
diff changeset
3178 def setDebugActionsEnabled(self, enable):
bf6be3cff6cf Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7397
diff changeset
3179 """
bf6be3cff6cf Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7397
diff changeset
3180 Public method to set the enabled state of the debug actions.
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
3181
7405
bf6be3cff6cf Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7397
diff changeset
3182 @param enable enable state to be set
bf6be3cff6cf Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7397
diff changeset
3183 @type bool
bf6be3cff6cf Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7397
diff changeset
3184 """
bf6be3cff6cf Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7397
diff changeset
3185 self.debugActGrp.setEnabled(enable)
7411
6d8dcb3551b3 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7410
diff changeset
3186
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
3187 def setMultiprocessNoDebugHistory(
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
3188 self, noDebugList, clearHistories=False, history=None
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
3189 ):
7411
6d8dcb3551b3 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7410
diff changeset
3190 """
6d8dcb3551b3 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7410
diff changeset
3191 Public slot to initialize the no debug list history.
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
3192
8008
ae9ab1e150dc Extended the session functionality to support the new multi process debugging.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7986
diff changeset
3193 @param noDebugList whitespace separated list of programs not to be
7411
6d8dcb3551b3 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7410
diff changeset
3194 debugged
6d8dcb3551b3 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7410
diff changeset
3195 @type str
6d8dcb3551b3 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7410
diff changeset
3196 @param clearHistories flag indicating, that the list should be cleared
6d8dcb3551b3 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7410
diff changeset
3197 @type bool
6d8dcb3551b3 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7410
diff changeset
3198 @param history list of history entries to be set
6d8dcb3551b3 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7410
diff changeset
3199 @type list of str
6d8dcb3551b3 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7410
diff changeset
3200 """
6d8dcb3551b3 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7410
diff changeset
3201 if clearHistories:
6d8dcb3551b3 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7410
diff changeset
3202 del self.multiprocessNoDebugHistory[1:]
6d8dcb3551b3 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7410
diff changeset
3203 elif history is not None:
6d8dcb3551b3 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7410
diff changeset
3204 self.multiprocessNoDebugHistory = history[:]
6d8dcb3551b3 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7410
diff changeset
3205 else:
6d8dcb3551b3 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7410
diff changeset
3206 if noDebugList in self.multiprocessNoDebugHistory:
6d8dcb3551b3 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7410
diff changeset
3207 self.multiprocessNoDebugHistory.remove(noDebugList)
6d8dcb3551b3 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7410
diff changeset
3208 self.multiprocessNoDebugHistory.insert(0, noDebugList)
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
3209
8008
ae9ab1e150dc Extended the session functionality to support the new multi process debugging.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7986
diff changeset
3210 def setEnableMultiprocess(self, enableMultiprocess):
ae9ab1e150dc Extended the session functionality to support the new multi process debugging.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7986
diff changeset
3211 """
ae9ab1e150dc Extended the session functionality to support the new multi process debugging.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7986
diff changeset
3212 Public slot to initialize the enableMultiprocess flag.
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
3213
8008
ae9ab1e150dc Extended the session functionality to support the new multi process debugging.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7986
diff changeset
3214 @param enableMultiprocess flag indicating, that the debugger should be
ae9ab1e150dc Extended the session functionality to support the new multi process debugging.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7986
diff changeset
3215 run in multi process mode
ae9ab1e150dc Extended the session functionality to support the new multi process debugging.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7986
diff changeset
3216 @type bool
ae9ab1e150dc Extended the session functionality to support the new multi process debugging.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7986
diff changeset
3217 """
ae9ab1e150dc Extended the session functionality to support the new multi process debugging.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7986
diff changeset
3218 self.enableMultiprocess = enableMultiprocess
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
3219
8163
29fb6d420a25 Debugger
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8162
diff changeset
3220 def setEnableGlobalConfigOverride(self, overrideData):
8162
8358c3c95841 Started implementing functionality to override some global configuration per debug run.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8143
diff changeset
3221 """
8358c3c95841 Started implementing functionality to override some global configuration per debug run.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8143
diff changeset
3222 Public method to initialize the global config override data.
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
3223
8163
29fb6d420a25 Debugger
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8162
diff changeset
3224 @param overrideData dictionary containing a flag indicating to enable
29fb6d420a25 Debugger
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8162
diff changeset
3225 global config override and a flag indicating to redirect
29fb6d420a25 Debugger
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8162
diff changeset
3226 stdin/stdout/stderr
29fb6d420a25 Debugger
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8162
diff changeset
3227 @type dict
8162
8358c3c95841 Started implementing functionality to override some global configuration per debug run.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8143
diff changeset
3228 """
8163
29fb6d420a25 Debugger
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8162
diff changeset
3229 self.overrideGlobalConfig = copy.deepcopy(overrideData)
10415
af9a6dac2611 Testing
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10321
diff changeset
3230
af9a6dac2611 Testing
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10321
diff changeset
3231 def getProjectEnvironmentString(self):
af9a6dac2611 Testing
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10321
diff changeset
3232 """
af9a6dac2611 Testing
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10321
diff changeset
3233 Public method to get the string for the project environment.
af9a6dac2611 Testing
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10321
diff changeset
3234
af9a6dac2611 Testing
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10321
diff changeset
3235 @return string for the project environment
af9a6dac2611 Testing
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10321
diff changeset
3236 @rtype str
af9a6dac2611 Testing
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10321
diff changeset
3237 """
af9a6dac2611 Testing
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10321
diff changeset
3238 return self.debugServer.getProjectEnvironmentString()
10564
0de57f082daa Integrated the 'run', 'profile' and 'coverage' and the restart debugging functions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10540
diff changeset
3239
10630
552a790fd9bc Corrected some issues and improved some existing code with respect to eric-ide server use.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10597
diff changeset
3240 def __showNotConnectedWarning(self, title, name=""):
10564
0de57f082daa Integrated the 'run', 'profile' and 'coverage' and the restart debugging functions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10540
diff changeset
3241 """
0de57f082daa Integrated the 'run', 'profile' and 'coverage' and the restart debugging functions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10540
diff changeset
3242 Private method to show a warning about a not connected eric-ide server.
0de57f082daa Integrated the 'run', 'profile' and 'coverage' and the restart debugging functions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10540
diff changeset
3243
0de57f082daa Integrated the 'run', 'profile' and 'coverage' and the restart debugging functions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10540
diff changeset
3244 @param title title for the dialog
0de57f082daa Integrated the 'run', 'profile' and 'coverage' and the restart debugging functions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10540
diff changeset
3245 @type str
10630
552a790fd9bc Corrected some issues and improved some existing code with respect to eric-ide server use.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10597
diff changeset
3246 @param name name of the file (defaults to "")
552a790fd9bc Corrected some issues and improved some existing code with respect to eric-ide server use.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10597
diff changeset
3247 @type str (optional)
10564
0de57f082daa Integrated the 'run', 'profile' and 'coverage' and the restart debugging functions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10540
diff changeset
3248 """
0de57f082daa Integrated the 'run', 'profile' and 'coverage' and the restart debugging functions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10540
diff changeset
3249 EricMessageBox.warning(
0de57f082daa Integrated the 'run', 'profile' and 'coverage' and the restart debugging functions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10540
diff changeset
3250 None,
0de57f082daa Integrated the 'run', 'profile' and 'coverage' and the restart debugging functions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10540
diff changeset
3251 title,
0de57f082daa Integrated the 'run', 'profile' and 'coverage' and the restart debugging functions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10540
diff changeset
3252 self.tr(
10630
552a790fd9bc Corrected some issues and improved some existing code with respect to eric-ide server use.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10597
diff changeset
3253 "<p>The selected file <b>{0}</b> is located on an eric-ide server but"
552a790fd9bc Corrected some issues and improved some existing code with respect to eric-ide server use.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10597
diff changeset
3254 " no such server is connected. Aborting...</p>"
552a790fd9bc Corrected some issues and improved some existing code with respect to eric-ide server use.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10597
diff changeset
3255 ).format(name),
10564
0de57f082daa Integrated the 'run', 'profile' and 'coverage' and the restart debugging functions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10540
diff changeset
3256 )

eric ide

mercurial