eric6/Debugger/DebugUI.py

changeset 7251
bc5b1b00560a
parent 7229
53054eb5b15a
child 7360
9190402e4505
diff -r d8bdc55aee1a -r bc5b1b00560a eric6/Debugger/DebugUI.py
--- a/eric6/Debugger/DebugUI.py	Sat Sep 21 13:03:17 2019 +0200
+++ b/eric6/Debugger/DebugUI.py	Sat Sep 21 13:37:58 2019 +0200
@@ -16,8 +16,9 @@
 
 from UI.Info import Program
 
-from .DebugClientCapabilities import HasDebugger, HasInterpreter, \
-    HasProfiler, HasCoverage
+from .DebugClientCapabilities import (
+    HasDebugger, HasInterpreter, HasProfiler, HasCoverage
+)
 import Preferences
 import Utilities
 import UI.PixmapCache
@@ -115,8 +116,8 @@
             self.__continue, self.__step, self.__stepOver, self.__stepOut,
             self.__stepQuit, self.__runToCursor, self.__moveInstructionPointer
         ]
-        self.localsVarFilter, self.globalsVarFilter = \
-            Preferences.getVarFilters()
+        self.localsVarFilter, self.globalsVarFilter = (
+            Preferences.getVarFilters())
         self.debugViewer.setVariablesFilter(
             self.globalsVarFilter, self.localsVarFilter)
         
@@ -984,8 +985,10 @@
             self.runProjectAct.setEnabled(self.projectOpen)
             self.profileProjectAct.setEnabled(self.projectOpen)
             self.coverageProjectAct.setEnabled(self.projectOpen)
-            if self.lastDebuggedFile is not None and \
-                    (self.editorOpen or self.projectOpen):
+            if (
+                self.lastDebuggedFile is not None and
+                (self.editorOpen or self.projectOpen)
+            ):
                 self.restartAct.setEnabled(True)
             else:
                 self.restartAct.setEnabled(False)
@@ -1027,8 +1030,10 @@
         self.__resetUI()
         
         if not quiet:
-            if not Preferences.getDebugger("SuppressClientExit") or \
-               status != 0:
+            if (
+                not Preferences.getDebugger("SuppressClientExit") or
+                status != 0
+            ):
                 if message:
                     info = self.tr("<p>Message: {0}</p>").format(
                         Utilities.html_uencode(message))
@@ -1137,11 +1142,14 @@
                         ' See the shell window for details.'))
             return
         
-        if (self.exceptions and
-            exceptionType not in self.excIgnoreList and
-            (not len(self.excList) or
-             (len(self.excList) and exceptionType in self.excList)))\
-           or exceptionType.startswith('unhandled'):
+        if (
+            (self.exceptions and
+             exceptionType not in self.excIgnoreList and
+             (not len(self.excList) or
+              (len(self.excList) and exceptionType in self.excList)
+              )
+             ) or exceptionType.startswith('unhandled')
+        ):
             res = None
             if stackTrace:
                 try:
@@ -1390,20 +1398,20 @@
             
             # check for duplicates
             idx = self.__model.getWatchPointIndex(cond, special)
-            duplicate = idx.isValid() and \
-                idx.internalPointer() != index.internalPointer()
+            duplicate = (idx.isValid() and
+                         idx.internalPointer() != index.internalPointer())
             if duplicate:
                 if not special:
-                    msg = self.tr("""<p>A watch expression '<b>{0}</b>'"""
-                                  """ already exists.</p>""")\
-                        .format(Utilities.html_encode(cond))
+                    msg = self.tr(
+                        """<p>A watch expression '<b>{0}</b>'"""
+                        """ already exists.</p>"""
+                    ).format(Utilities.html_encode(cond))
                 else:
                     msg = self.tr(
                         """<p>A watch expression '<b>{0}</b>'"""
                         """ for the variable <b>{1}</b> already"""
-                        """ exists.</p>""")\
-                        .format(special,
-                                Utilities.html_encode(cond))
+                        """ exists.</p>"""
+                    ).format(special, Utilities.html_encode(cond))
                 E5MessageBox.warning(
                     self.ui,
                     self.tr("Watch expression already exists"),
@@ -1578,8 +1586,10 @@
                             " current project. Aborting"))
                     return
                     
-                if Preferences.getDebugger("Autosave") and \
-                   not self.project.saveAllScripts(reportSyntaxErrors=True):
+                if (
+                    Preferences.getDebugger("Autosave") and
+                    not self.project.saveAllScripts(reportSyntaxErrors=True)
+                ):
                     doNotStart = True
                 
                 # save the info for later use
@@ -1594,10 +1604,11 @@
                 if editor is None:
                     return
                 
-                if not self.viewmanager.checkDirty(
-                        editor,
-                        Preferences.getDebugger("Autosave")) or \
-                        editor.getFileName() is None:
+                if (
+                    not self.viewmanager.checkDirty(
+                        editor, Preferences.getDebugger("Autosave")) or
+                    editor.getFileName() is None
+                ):
                     return
                     
                 fn = editor.getFileName()
@@ -1710,8 +1721,10 @@
                             " current project. Aborting"))
                     return
                     
-                if Preferences.getDebugger("Autosave") and \
-                   not self.project.saveAllScripts(reportSyntaxErrors=True):
+                if (
+                    Preferences.getDebugger("Autosave") and
+                    not self.project.saveAllScripts(reportSyntaxErrors=True)
+                ):
                     doNotStart = True
                 
                 # save the info for later use
@@ -1726,10 +1739,11 @@
                 if editor is None:
                     return
                 
-                if not self.viewmanager.checkDirty(
-                        editor,
-                        Preferences.getDebugger("Autosave")) or \
-                        editor.getFileName() is None:
+                if (
+                    not self.viewmanager.checkDirty(
+                        editor, Preferences.getDebugger("Autosave")) or
+                    editor.getFileName() is None
+                ):
                     return
                     
                 fn = editor.getFileName()
@@ -1844,8 +1858,10 @@
                             " current project. Aborting"))
                     return
                     
-                if Preferences.getDebugger("Autosave") and \
-                   not self.project.saveAllScripts(reportSyntaxErrors=True):
+                if (
+                    Preferences.getDebugger("Autosave") and
+                    not self.project.saveAllScripts(reportSyntaxErrors=True)
+                ):
                     doNotStart = True
                 
                 # save the info for later use
@@ -1860,10 +1876,12 @@
                 if editor is None:
                     return
                 
-                if not self.viewmanager.checkDirty(
+                if (
+                    not self.viewmanager.checkDirty(
                         editor,
-                        Preferences.getDebugger("Autosave")) or \
-                        editor.getFileName() is None:
+                        Preferences.getDebugger("Autosave")) or
+                    editor.getFileName() is None
+                ):
                     return
                     
                 fn = editor.getFileName()
@@ -1966,8 +1984,8 @@
         if dlg.exec_() == QDialog.Accepted:
             (lastUsedVenvName, argv, wd, env, exceptions, clearShell,
              console) = dlg.getData()
-            tracePython, autoContinue, forkAutomatically, forkIntoChild = \
-                dlg.getDebugData()
+            tracePython, autoContinue, forkAutomatically, forkIntoChild = (
+                dlg.getDebugData())
             
             if debugProject:
                 fn = self.project.getMainScript(True)
@@ -1980,8 +1998,10 @@
                             " current project. No debugging possible."))
                     return
                     
-                if Preferences.getDebugger("Autosave") and \
-                   not self.project.saveAllScripts(reportSyntaxErrors=True):
+                if (
+                    Preferences.getDebugger("Autosave") and
+                    not self.project.saveAllScripts(reportSyntaxErrors=True)
+                ):
                     doNotStart = True
                 
                 # save the info for later use
@@ -1997,10 +2017,11 @@
                 if editor is None:
                     return
                 
-                if not self.viewmanager.checkDirty(
-                        editor,
-                        Preferences.getDebugger("Autosave")) or \
-                        editor.getFileName() is None:
+                if (
+                    not self.viewmanager.checkDirty(
+                        editor, Preferences.getDebugger("Autosave")) or
+                    editor.getFileName() is None
+                ):
                     return
                     
                 fn = editor.getFileName()
@@ -2066,8 +2087,10 @@
                     forkChild=forkIntoChild, clientType=self.clientType,
                     enableCallTrace=enableCallTrace)
                 
-                if self.debugServer.isClientProcessUp() and \
-                   self.debugServer.getClientType() == self.clientType:
+                if (
+                    self.debugServer.isClientProcessUp() and
+                    self.debugServer.getClientType() == self.clientType
+                ):
                     # Signal that we have started a debugging session
                     self.debuggingStarted.emit(fn)
                     
@@ -2094,14 +2117,18 @@
         # first save any changes
         if self.lastStartAction in [1, 3, 5, 7, 9]:
             editor = self.viewmanager.getOpenEditor(self.lastDebuggedFile)
-            if editor and \
-               not self.viewmanager.checkDirty(
-                    editor, Preferences.getDebugger("Autosave")):
+            if (
+                editor and
+                not self.viewmanager.checkDirty(
+                    editor, Preferences.getDebugger("Autosave"))
+            ):
                 return
             forProject = False
         elif self.lastStartAction in [2, 4, 6, 8, 10]:
-            if Preferences.getDebugger("Autosave") and \
-               not self.project.saveAllScripts(reportSyntaxErrors=True):
+            if (
+                Preferences.getDebugger("Autosave") and
+                not self.project.saveAllScripts(reportSyntaxErrors=True)
+            ):
                 doNotStart = True
             self.__compileChangedProjectFiles()
             forProject = True

eric ide

mercurial