src/eric7/Debugger/DebugUI.py

branch
eric7
changeset 10044
fd95315b1c26
parent 9695
ad962e9b904d
child 10065
de4ae767b0e3
equal deleted inserted replaced
10043:f1427d95cfde 10044:fd95315b1c26
1929 if runProject 1929 if runProject
1930 else self.tr("Coverage of Script") 1930 else self.tr("Coverage of Script")
1931 ) 1931 )
1932 if runProject: 1932 if runProject:
1933 scriptName = self.project.getMainScript(True) 1933 scriptName = self.project.getMainScript(True)
1934 if not scriptName:
1935 EricMessageBox.critical(
1936 self.ui,
1937 self.tr("Coverage of Project"),
1938 self.tr(
1939 "There is no main script defined for the"
1940 " current project. Aborting"
1941 ),
1942 )
1943 return
1934 elif script: 1944 elif script:
1935 scriptName = script 1945 scriptName = script
1936 elif self.lastDebuggedFile: 1946 elif self.lastDebuggedFile:
1937 scriptName = self.lastDebuggedFile 1947 scriptName = self.lastDebuggedFile
1938 else: 1948 else:
1968 configOverride = dlg.getGlobalOverrideData() 1978 configOverride = dlg.getGlobalOverrideData()
1969 eraseCoverage = dlg.getCoverageData() 1979 eraseCoverage = dlg.getCoverageData()
1970 1980
1971 if runProject: 1981 if runProject:
1972 fn = self.project.getMainScript(True) 1982 fn = self.project.getMainScript(True)
1973 if fn is None:
1974 EricMessageBox.critical(
1975 self.ui,
1976 self.tr("Coverage of Project"),
1977 self.tr(
1978 "There is no main script defined for the"
1979 " current project. Aborting"
1980 ),
1981 )
1982 return
1983 1983
1984 if Preferences.getDebugger( 1984 if Preferences.getDebugger(
1985 "Autosave" 1985 "Autosave"
1986 ) and not self.project.saveAllScripts(reportSyntaxErrors=True): 1986 ) and not self.project.saveAllScripts(reportSyntaxErrors=True):
1987 doNotStart = True 1987 doNotStart = True
2133 if runProject 2133 if runProject
2134 else self.tr("Profile of Script") 2134 else self.tr("Profile of Script")
2135 ) 2135 )
2136 if runProject: 2136 if runProject:
2137 scriptName = self.project.getMainScript(True) 2137 scriptName = self.project.getMainScript(True)
2138 if not scriptName:
2139 EricMessageBox.critical(
2140 self.ui,
2141 self.tr("Profile of Project"),
2142 self.tr(
2143 "There is no main script defined for the"
2144 " current project. Aborting"
2145 ),
2146 )
2147 return
2138 elif script: 2148 elif script:
2139 scriptName = script 2149 scriptName = script
2140 elif self.lastDebuggedFile: 2150 elif self.lastDebuggedFile:
2141 scriptName = self.lastDebuggedFile 2151 scriptName = self.lastDebuggedFile
2142 else: 2152 else:
2172 configOverride = dlg.getGlobalOverrideData() 2182 configOverride = dlg.getGlobalOverrideData()
2173 eraseTimings = dlg.getProfilingData() 2183 eraseTimings = dlg.getProfilingData()
2174 2184
2175 if runProject: 2185 if runProject:
2176 fn = self.project.getMainScript(True) 2186 fn = self.project.getMainScript(True)
2177 if fn is None:
2178 EricMessageBox.critical(
2179 self.ui,
2180 self.tr("Profile of Project"),
2181 self.tr(
2182 "There is no main script defined for the"
2183 " current project. Aborting"
2184 ),
2185 )
2186 return
2187 2187
2188 if Preferences.getDebugger( 2188 if Preferences.getDebugger(
2189 "Autosave" 2189 "Autosave"
2190 ) and not self.project.saveAllScripts(reportSyntaxErrors=True): 2190 ) and not self.project.saveAllScripts(reportSyntaxErrors=True):
2191 doNotStart = True 2191 doNotStart = True
2333 # Get the command line arguments, the working directory and the 2333 # Get the command line arguments, the working directory and the
2334 # exception reporting flag. 2334 # exception reporting flag.
2335 cap = self.tr("Run Project") if runProject else self.tr("Run Script") 2335 cap = self.tr("Run Project") if runProject else self.tr("Run Script")
2336 if runProject: 2336 if runProject:
2337 scriptName = self.project.getMainScript(True) 2337 scriptName = self.project.getMainScript(True)
2338 if not scriptName:
2339 EricMessageBox.critical(
2340 self.ui,
2341 self.tr("Run Project"),
2342 self.tr(
2343 "There is no main script defined for the"
2344 " current project. Aborting"
2345 ),
2346 )
2347 return
2338 elif script: 2348 elif script:
2339 scriptName = script 2349 scriptName = script
2340 elif self.lastDebuggedFile: 2350 elif self.lastDebuggedFile:
2341 scriptName = self.lastDebuggedFile 2351 scriptName = self.lastDebuggedFile
2342 else: 2352 else:
2371 ) = dlg.getData() 2381 ) = dlg.getData()
2372 configOverride = dlg.getGlobalOverrideData() 2382 configOverride = dlg.getGlobalOverrideData()
2373 2383
2374 if runProject: 2384 if runProject:
2375 fn = self.project.getMainScript(True) 2385 fn = self.project.getMainScript(True)
2376 if fn is None:
2377 EricMessageBox.critical(
2378 self.ui,
2379 self.tr("Run Project"),
2380 self.tr(
2381 "There is no main script defined for the"
2382 " current project. Aborting"
2383 ),
2384 )
2385 return
2386 2386
2387 if Preferences.getDebugger( 2387 if Preferences.getDebugger(
2388 "Autosave" 2388 "Autosave"
2389 ) and not self.project.saveAllScripts(reportSyntaxErrors=True): 2389 ) and not self.project.saveAllScripts(reportSyntaxErrors=True):
2390 doNotStart = True 2390 doNotStart = True
2528 # Get the command line arguments, the working directory and the 2528 # Get the command line arguments, the working directory and the
2529 # exception reporting flag. 2529 # exception reporting flag.
2530 cap = self.tr("Debug Project") if debugProject else self.tr("Debug Script") 2530 cap = self.tr("Debug Project") if debugProject else self.tr("Debug Script")
2531 if debugProject: 2531 if debugProject:
2532 scriptName = self.project.getMainScript(True) 2532 scriptName = self.project.getMainScript(True)
2533 if not scriptName:
2534 EricMessageBox.critical(
2535 self.ui,
2536 self.tr("Debug Project"),
2537 self.tr(
2538 "There is no main script defined for the"
2539 " current project. No debugging possible."
2540 ),
2541 )
2542 return
2533 elif script: 2543 elif script:
2534 scriptName = script 2544 scriptName = script
2535 elif self.lastDebuggedFile: 2545 elif self.lastDebuggedFile:
2536 scriptName = self.lastDebuggedFile 2546 scriptName = self.lastDebuggedFile
2537 else: 2547 else:
2576 multiprocessNoDebug, 2586 multiprocessNoDebug,
2577 ) = dlg.getDebugData() 2587 ) = dlg.getDebugData()
2578 2588
2579 if debugProject: 2589 if debugProject:
2580 fn = self.project.getMainScript(True) 2590 fn = self.project.getMainScript(True)
2581 if fn is None:
2582 EricMessageBox.critical(
2583 self.ui,
2584 self.tr("Debug Project"),
2585 self.tr(
2586 "There is no main script defined for the"
2587 " current project. No debugging possible."
2588 ),
2589 )
2590 return
2591 2591
2592 if Preferences.getDebugger( 2592 if Preferences.getDebugger(
2593 "Autosave" 2593 "Autosave"
2594 ) and not self.project.saveAllScripts(reportSyntaxErrors=True): 2594 ) and not self.project.saveAllScripts(reportSyntaxErrors=True):
2595 doNotStart = True 2595 doNotStart = True

eric ide

mercurial