eric6/Debugger/DebugUI.py

branch
multi_processing
changeset 7874
8dcb77600690
parent 7863
6725d2549801
child 7876
9164a5c0d4a6
equal deleted inserted replaced
7873:cb2badbdf26c 7874:8dcb77600690
100 Preferences.Prefs.settings.value('DebugInfo/AutoClearShell', True)) 100 Preferences.Prefs.settings.value('DebugInfo/AutoClearShell', True))
101 self.tracePython = Preferences.toBool( 101 self.tracePython = Preferences.toBool(
102 Preferences.Prefs.settings.value('DebugInfo/TracePython', False)) 102 Preferences.Prefs.settings.value('DebugInfo/TracePython', False))
103 self.autoContinue = Preferences.toBool( 103 self.autoContinue = Preferences.toBool(
104 Preferences.Prefs.settings.value('DebugInfo/AutoContinue', True)) 104 Preferences.Prefs.settings.value('DebugInfo/AutoContinue', True))
105 self.forkAutomatically = Preferences.toBool(
106 Preferences.Prefs.settings.value(
107 'DebugInfo/ForkAutomatically', False))
108 self.forkIntoChild = Preferences.toBool(
109 Preferences.Prefs.settings.value('DebugInfo/ForkIntoChild', False))
110 self.enableMultiprocess = Preferences.toBool( 105 self.enableMultiprocess = Preferences.toBool(
111 Preferences.Prefs.settings.value( 106 Preferences.Prefs.settings.value(
112 'DebugInfo/EnableMultiprocess', False)) 107 'DebugInfo/EnableMultiprocess', False))
113 self.multiprocessNoDebugHistory = Preferences.toList( 108 self.multiprocessNoDebugHistory = Preferences.toList(
114 Preferences.Prefs.settings.value( 109 Preferences.Prefs.settings.value(
958 'DebugInfo/AutoClearShell', self.autoClearShell) 953 'DebugInfo/AutoClearShell', self.autoClearShell)
959 Preferences.Prefs.settings.setValue( 954 Preferences.Prefs.settings.setValue(
960 'DebugInfo/TracePython', self.tracePython) 955 'DebugInfo/TracePython', self.tracePython)
961 Preferences.Prefs.settings.setValue( 956 Preferences.Prefs.settings.setValue(
962 'DebugInfo/AutoContinue', self.autoContinue) 957 'DebugInfo/AutoContinue', self.autoContinue)
963 Preferences.Prefs.settings.setValue(
964 'DebugInfo/ForkAutomatically', self.forkAutomatically)
965 Preferences.Prefs.settings.setValue(
966 'DebugInfo/ForkIntoChild', self.forkIntoChild)
967 Preferences.Prefs.settings.setValue( 958 Preferences.Prefs.settings.setValue(
968 'DebugInfo/EnableMultiprocess', self.enableMultiprocess) 959 'DebugInfo/EnableMultiprocess', self.enableMultiprocess)
969 Preferences.Prefs.settings.setValue( 960 Preferences.Prefs.settings.setValue(
970 'DebugInfo/MultiprocessNoDebugHistory', 961 'DebugInfo/MultiprocessNoDebugHistory',
971 self.multiprocessNoDebugHistory) 962 self.multiprocessNoDebugHistory)
1920 else: 1911 else:
1921 cap = self.tr("Run Script") 1912 cap = self.tr("Run Script")
1922 dlg = StartDialog( 1913 dlg = StartDialog(
1923 cap, self.lastUsedVenvName, self.argvHistory, self.wdHistory, 1914 cap, self.lastUsedVenvName, self.argvHistory, self.wdHistory,
1924 self.envHistory, self.exceptions, self.ui, 1, 1915 self.envHistory, self.exceptions, self.ui, 1,
1925 autoClearShell=self.autoClearShell, 1916 autoClearShell=self.autoClearShell)
1926 autoFork=self.forkAutomatically,
1927 forkChild=self.forkIntoChild)
1928 if dlg.exec() == QDialog.Accepted: 1917 if dlg.exec() == QDialog.Accepted:
1929 (lastUsedVenvName, argv, wd, env, exceptions, clearShell, 1918 (lastUsedVenvName, argv, wd, env, exceptions, clearShell,
1930 console) = dlg.getData() 1919 console) = dlg.getData()
1931 forkAutomatically, forkIntoChild = dlg.getRunData()
1932 1920
1933 if runProject: 1921 if runProject:
1934 fn = self.project.getMainScript(True) 1922 fn = self.project.getMainScript(True)
1935 if fn is None: 1923 if fn is None:
1936 E5MessageBox.critical( 1924 E5MessageBox.critical(
1991 self.autoClearShell = clearShell 1979 self.autoClearShell = clearShell
1992 1980
1993 # Save the run in console flag 1981 # Save the run in console flag
1994 self.runInConsole = console 1982 self.runInConsole = console
1995 1983
1996 # Save the forking flags
1997 self.forkAutomatically = forkAutomatically
1998 self.forkIntoChild = forkIntoChild
1999
2000 # Hide all error highlights 1984 # Hide all error highlights
2001 self.viewmanager.unhighlight() 1985 self.viewmanager.unhighlight()
2002 1986
2003 if not doNotStart: 1987 if not doNotStart:
2004 if runProject and self.project.getProjectType() in [ 1988 if runProject and self.project.getProjectType() in [
2010 1994
2011 # Ask the client to open the new program. 1995 # Ask the client to open the new program.
2012 self.debugServer.remoteRun( 1996 self.debugServer.remoteRun(
2013 lastUsedVenvName, fn, argv, wd, env, 1997 lastUsedVenvName, fn, argv, wd, env,
2014 autoClearShell=self.autoClearShell, forProject=runProject, 1998 autoClearShell=self.autoClearShell, forProject=runProject,
2015 runInConsole=console, autoFork=forkAutomatically, 1999 runInConsole=console, clientType=self.clientType)
2016 forkChild=forkIntoChild, clientType=self.clientType)
2017 2000
2018 self.stopAct.setEnabled(True) 2001 self.stopAct.setEnabled(True)
2019 2002
2020 if dlg.clearHistories(): 2003 if dlg.clearHistories():
2021 self.setArgvHistory("", clearHistories=True) 2004 self.setArgvHistory("", clearHistories=True)
2061 cap = self.tr("Debug Script") 2044 cap = self.tr("Debug Script")
2062 dlg = StartDialog( 2045 dlg = StartDialog(
2063 cap, self.lastUsedVenvName, self.argvHistory, self.wdHistory, 2046 cap, self.lastUsedVenvName, self.argvHistory, self.wdHistory,
2064 self.envHistory, self.exceptions, self.ui, 0, 2047 self.envHistory, self.exceptions, self.ui, 0,
2065 tracePython=self.tracePython, autoClearShell=self.autoClearShell, 2048 tracePython=self.tracePython, autoClearShell=self.autoClearShell,
2066 autoContinue=self.autoContinue, autoFork=self.forkAutomatically, 2049 autoContinue=self.autoContinue,
2067 forkChild=self.forkIntoChild,
2068 enableMultiprocess=self.enableMultiprocess, 2050 enableMultiprocess=self.enableMultiprocess,
2069 multiprocessNoDebugHistory=self.multiprocessNoDebugHistory) 2051 multiprocessNoDebugHistory=self.multiprocessNoDebugHistory)
2070 if dlg.exec() == QDialog.Accepted: 2052 if dlg.exec() == QDialog.Accepted:
2071 (lastUsedVenvName, argv, wd, env, exceptions, clearShell, 2053 (lastUsedVenvName, argv, wd, env, exceptions, clearShell,
2072 console) = dlg.getData() 2054 console) = dlg.getData()
2073 (tracePython, autoContinue, forkAutomatically, forkIntoChild, 2055 (tracePython, autoContinue, enableMultiprocess,
2074 enableMultiprocess, multiprocessNoDebug, 2056 multiprocessNoDebug) = dlg.getDebugData()
2075 ) = dlg.getDebugData()
2076 2057
2077 if debugProject: 2058 if debugProject:
2078 fn = self.project.getMainScript(True) 2059 fn = self.project.getMainScript(True)
2079 if fn is None: 2060 if fn is None:
2080 E5MessageBox.critical( 2061 E5MessageBox.critical(
2141 self.runInConsole = console 2122 self.runInConsole = console
2142 2123
2143 # Save the auto continue flag 2124 # Save the auto continue flag
2144 self.autoContinue = autoContinue 2125 self.autoContinue = autoContinue
2145 2126
2146 # Save the forking flags
2147 self.forkAutomatically = forkAutomatically
2148 self.forkIntoChild = forkIntoChild
2149
2150 # Save the multiprocess debugging data 2127 # Save the multiprocess debugging data
2151 self.enableMultiprocess = enableMultiprocess 2128 self.enableMultiprocess = enableMultiprocess
2152 self.setMultiprocessNoDebugHistory(multiprocessNoDebug) 2129 self.setMultiprocessNoDebugHistory(multiprocessNoDebug)
2153 2130
2154 # Hide all error highlights 2131 # Hide all error highlights
2172 self.debugServer.remoteLoad( 2149 self.debugServer.remoteLoad(
2173 lastUsedVenvName, fn, argv, wd, env, 2150 lastUsedVenvName, fn, argv, wd, env,
2174 autoClearShell=self.autoClearShell, 2151 autoClearShell=self.autoClearShell,
2175 tracePython=tracePython, 2152 tracePython=tracePython,
2176 autoContinue=autoContinue, forProject=debugProject, 2153 autoContinue=autoContinue, forProject=debugProject,
2177 runInConsole=console, autoFork=forkAutomatically, 2154 runInConsole=console, clientType=self.clientType,
2178 forkChild=forkIntoChild, clientType=self.clientType,
2179 enableCallTrace=enableCallTrace, 2155 enableCallTrace=enableCallTrace,
2180 enableMultiprocess=enableMultiprocess, 2156 enableMultiprocess=enableMultiprocess,
2181 multiprocessNoDebug=multiprocessNoDebug) 2157 multiprocessNoDebug=multiprocessNoDebug)
2182 2158
2183 if ( 2159 if (
2262 autoClearShell=self.autoClearShell, 2238 autoClearShell=self.autoClearShell,
2263 tracePython=self.tracePython, 2239 tracePython=self.tracePython,
2264 autoContinue=self.autoContinue, 2240 autoContinue=self.autoContinue,
2265 forProject=forProject, 2241 forProject=forProject,
2266 runInConsole=self.runInConsole, 2242 runInConsole=self.runInConsole,
2267 autoFork=self.forkAutomatically,
2268 forkChild=self.forkIntoChild,
2269 clientType=self.clientType, 2243 clientType=self.clientType,
2270 enableCallTrace=enableCallTrace, 2244 enableCallTrace=enableCallTrace,
2271 enableMultiprocess=self.enableMultiprocess, 2245 enableMultiprocess=self.enableMultiprocess,
2272 multiprocessNoDebug=multiprocessNoDebug) 2246 multiprocessNoDebug=multiprocessNoDebug)
2273 2247
2279 self.debugServer.remoteRun( 2253 self.debugServer.remoteRun(
2280 venvName, fn, argv, wd, env, 2254 venvName, fn, argv, wd, env,
2281 autoClearShell=self.autoClearShell, 2255 autoClearShell=self.autoClearShell,
2282 forProject=forProject, 2256 forProject=forProject,
2283 runInConsole=self.runInConsole, 2257 runInConsole=self.runInConsole,
2284 autoFork=self.forkAutomatically,
2285 forkChild=self.forkIntoChild,
2286 clientType=self.clientType) 2258 clientType=self.clientType)
2287 2259
2288 elif self.lastStartAction in [5, 6]: 2260 elif self.lastStartAction in [5, 6]:
2289 # Ask the client to coverage run the new program. 2261 # Ask the client to coverage run the new program.
2290 self.debugServer.remoteCoverage( 2262 self.debugServer.remoteCoverage(

eric ide

mercurial