Continued to resolve code style issue M841.

Sat, 21 Sep 2019 13:37:58 +0200

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Sat, 21 Sep 2019 13:37:58 +0200
changeset 7251
bc5b1b00560a
parent 7250
d8bdc55aee1a
child 7252
c5e3705073eb

Continued to resolve code style issue M841.

eric6/Debugger/BreakPointModel.py file | annotate | diff | comparison | revisions
eric6/Debugger/BreakPointViewer.py file | annotate | diff | comparison | revisions
eric6/Debugger/CallTraceViewer.py file | annotate | diff | comparison | revisions
eric6/Debugger/DebugClientCapabilities.py file | annotate | diff | comparison | revisions
eric6/Debugger/DebugServer.py file | annotate | diff | comparison | revisions
eric6/Debugger/DebugUI.py file | annotate | diff | comparison | revisions
eric6/Debugger/DebugViewer.py file | annotate | diff | comparison | revisions
eric6/Debugger/DebuggerInterfacePython.py file | annotate | diff | comparison | revisions
eric6/Debugger/EditWatchpointDialog.py file | annotate | diff | comparison | revisions
eric6/Debugger/ExceptionLogger.py file | annotate | diff | comparison | revisions
eric6/Debugger/VariablesViewer.py file | annotate | diff | comparison | revisions
eric6/Debugger/WatchPointModel.py file | annotate | diff | comparison | revisions
eric6/Debugger/WatchPointViewer.py file | annotate | diff | comparison | revisions
--- a/eric6/Debugger/BreakPointModel.py	Sat Sep 21 13:03:17 2019 +0200
+++ b/eric6/Debugger/BreakPointModel.py	Sat Sep 21 13:37:58 2019 +0200
@@ -106,9 +106,9 @@
         @param role role of the changed data (Qt.ItemDataRole)
         @return flag indicating success (boolean)
         """
-        if not index.isValid() or \
-           index.column() >= len(self.header) or \
-           index.row() >= len(self.breakpoints):
+        if (not index.isValid() or
+            index.column() >= len(self.header) or
+                index.row() >= len(self.breakpoints)):
             return False
         
         self.dataAboutToBeChanged.emit(index, index)
@@ -154,9 +154,9 @@
         @param parent index of the parent item (QModelIndex)
         @return requested index (QModelIndex)
         """
-        if (parent and parent.isValid()) or \
-           row < 0 or row >= len(self.breakpoints) or \
-           column < 0 or column >= len(self.header):
+        if ((parent and parent.isValid()) or
+            row < 0 or row >= len(self.breakpoints) or
+                column < 0 or column >= len(self.header)):
             return QModelIndex()
         
         return self.createIndex(row, column, self.breakpoints[row])
--- a/eric6/Debugger/BreakPointViewer.py	Sat Sep 21 13:03:17 2019 +0200
+++ b/eric6/Debugger/BreakPointViewer.py	Sat Sep 21 13:37:58 2019 +0200
@@ -8,10 +8,12 @@
 """
 
 
-from PyQt5.QtCore import pyqtSignal, Qt, QItemSelectionModel, \
-    QSortFilterProxyModel, QFileInfo
-from PyQt5.QtWidgets import QTreeView, QAbstractItemView, QHeaderView, QMenu, \
-    QDialog
+from PyQt5.QtCore import (
+    pyqtSignal, Qt, QItemSelectionModel, QSortFilterProxyModel, QFileInfo
+)
+from PyQt5.QtWidgets import (
+    QTreeView, QAbstractItemView, QHeaderView, QMenu, QDialog
+)
 
 from E5Gui.E5Application import e5App
 
@@ -167,15 +169,15 @@
         self.backMenuActions = {}
         self.backMenu = QMenu()
         self.backMenu.addAction(self.tr("Add"), self.__addBreak)
-        self.backMenuActions["EnableAll"] = \
-            self.backMenu.addAction(self.tr("Enable all"),
-                                    self.__enableAllBreaks)
-        self.backMenuActions["DisableAll"] = \
-            self.backMenu.addAction(self.tr("Disable all"),
-                                    self.__disableAllBreaks)
-        self.backMenuActions["DeleteAll"] = \
-            self.backMenu.addAction(self.tr("Delete all"),
-                                    self.__deleteAllBreaks)
+        self.backMenuActions["EnableAll"] = self.backMenu.addAction(
+            self.tr("Enable all"),
+            self.__enableAllBreaks)
+        self.backMenuActions["DisableAll"] = self.backMenu.addAction(
+            self.tr("Disable all"),
+            self.__disableAllBreaks)
+        self.backMenuActions["DeleteAll"] = self.backMenu.addAction(
+            self.tr("Delete all"),
+            self.__deleteAllBreaks)
         self.backMenu.aboutToShow.connect(self.__showBackMenu)
         self.backMenu.addSeparator()
         self.backMenu.addAction(self.tr("Configure..."), self.__configure)
@@ -489,9 +491,8 @@
         self.condHistory = []
         rs = Preferences.Prefs.rsettings.value(recentNameBreakpointConditions)
         if rs is not None:
-            self.condHistory = \
-                Preferences.toList(rs)[
-                    :Preferences.getDebugger("RecentNumber")]
+            self.condHistory = Preferences.toList(rs)[
+                :Preferences.getDebugger("RecentNumber")]
     
     def __saveRecent(self):
         """
--- a/eric6/Debugger/CallTraceViewer.py	Sat Sep 21 13:03:17 2019 +0200
+++ b/eric6/Debugger/CallTraceViewer.py	Sat Sep 21 13:37:58 2019 +0200
@@ -245,8 +245,8 @@
             icon = UI.PixmapCache.getIcon("forward.png")
         else:
             icon = UI.PixmapCache.getIcon("back.png")
-        parentItem = \
-            self.__callStack[-1] if self.__callStack else self.callTrace
+        parentItem = (
+            self.__callStack[-1] if self.__callStack else self.callTrace)
         
         if self.__projectMode:
             fromFile = self.__project.getRelativePath(fromFile)
--- a/eric6/Debugger/DebugClientCapabilities.py	Sat Sep 21 13:03:17 2019 +0200
+++ b/eric6/Debugger/DebugClientCapabilities.py	Sat Sep 21 13:37:58 2019 +0200
@@ -15,8 +15,8 @@
 HasUnittest = 0x0020
 HasShell = 0x0040
 
-HasAll = HasDebugger | HasInterpreter | HasProfiler | \
-    HasCoverage | HasCompleter | HasUnittest | HasShell
+HasAll = (HasDebugger | HasInterpreter | HasProfiler |
+          HasCoverage | HasCompleter | HasUnittest | HasShell)
 
 #
 # eflag: noqa = M702
--- a/eric6/Debugger/DebugServer.py	Sat Sep 21 13:03:17 2019 +0200
+++ b/eric6/Debugger/DebugServer.py	Sat Sep 21 13:37:58 2019 +0200
@@ -12,8 +12,9 @@
 import sys
 
 from PyQt5.QtCore import pyqtSignal, QModelIndex
-from PyQt5.QtNetwork import QTcpServer, QHostAddress, QHostInfo, \
-    QNetworkInterface
+from PyQt5.QtNetwork import (
+    QTcpServer, QHostAddress, QHostInfo, QNetworkInterface
+)
 
 from E5Gui.E5Application import e5App
 from E5Gui import E5MessageBox
@@ -180,10 +181,10 @@
         # create our models
         self.breakpointModel = BreakPointModel(self)
         self.watchpointModel = WatchPointModel(self)
-        self.watchSpecialCreated = \
-            self.tr("created", "must be same as in EditWatchpointDialog")
-        self.watchSpecialChanged = \
-            self.tr("changed", "must be same as in EditWatchpointDialog")
+        self.watchSpecialCreated = self.tr(
+            "created", "must be same as in EditWatchpointDialog")
+        self.watchSpecialChanged = self.tr(
+            "changed", "must be same as in EditWatchpointDialog")
         
         self.networkInterface = Preferences.getDebugger("NetworkInterface")
         if self.networkInterface == "all":
@@ -192,11 +193,11 @@
             hostAddress = QHostAddress("::")  # QHostAddress.AnyIPv6)
         else:
             hostAddress = QHostAddress(self.networkInterface)
-        self.networkInterfaceName, self.networkInterfaceIndex = \
-            self.__getNetworkInterfaceAndIndex(self.networkInterface)
+        self.networkInterfaceName, self.networkInterfaceIndex = (
+            self.__getNetworkInterfaceAndIndex(self.networkInterface))
         
-        if not preventPassiveDebugging and \
-           Preferences.getDebugger("PassiveDbgEnabled"):
+        if (not preventPassiveDebugging and
+                Preferences.getDebugger("PassiveDbgEnabled")):
             sock = Preferences.getDebugger("PassiveDbgPort")  # default: 42424
             self.listen(hostAddress, sock)
             self.passive = True
@@ -212,8 +213,7 @@
         self.running = False
         self.clientProcess = None
         self.clientInterpreter = ""
-        self.clientType = \
-            Preferences.Prefs.settings.value('DebugClient/Type')
+        self.clientType = Preferences.Prefs.settings.value('DebugClient/Type')
         if self.clientType is None:
             self.clientType = 'Python3'
         # Change clientType if dependent interpreter does not exist anymore
@@ -287,10 +287,10 @@
                 addressEntries = networkInterface.addressEntries()
                 if len(addressEntries) > 0:
                     for addressEntry in addressEntries:
-                        if addressEntry.ip().toString().lower() == \
-                                address.lower():
-                            return networkInterface.humanReadableName(), \
-                                networkInterface.index()
+                        if (addressEntry.ip().toString().lower() ==
+                                address.lower()):
+                            return (networkInterface.humanReadableName(),
+                                    networkInterface.index())
         
         return "", 0
         
@@ -300,8 +300,8 @@
         """
         registeredInterfaces = {}
         for interfaceName in self.__debuggerInterfaces:
-            registeredInterfaces[interfaceName] = \
-                self.__debuggerInterfaces[interfaceName]
+            registeredInterfaces[interfaceName] = (
+                self.__debuggerInterfaces[interfaceName])
         
         self.__debuggerInterfaceRegistry = {}
         for interfaceName, getRegistryData in registeredInterfaces.items():
@@ -338,8 +338,8 @@
             self.__debuggerInterfaces[interfaceName] = getRegistryData
         registryDataList = getRegistryData()
         if registryDataList:
-            for clientLanguage, clientCapabilities, clientExtensions, \
-                    interfaceCreator in registryDataList:
+            for (clientLanguage, clientCapabilities, clientExtensions,
+                 interfaceCreator) in registryDataList:
                 self.__debuggerInterfaceRegistry[clientLanguage] = [
                     clientCapabilities, clientExtensions, interfaceCreator,
                     interfaceName]
@@ -353,8 +353,8 @@
         """
         if interfaceName in self.__debuggerInterfaces:
             clientLanguages = []
-            for clientLanguage, registryData in \
-                    self.__debuggerInterfaceRegistry.items():
+            for clientLanguage, registryData in (
+                    self.__debuggerInterfaceRegistry.items()):
                 if interfaceName == registryData[-1]:
                     clientLanguages.append(clientLanguage)
             for clientLanguage in clientLanguages:
@@ -404,10 +404,9 @@
             pass    # it is not in the list
         
         if shellOnly:
-            languages = \
-                [lang for lang in languages
-                 if self.__debuggerInterfaceRegistry[lang][0] &
-                    DebugClientCapabilities.HasShell]
+            languages = [lang for lang in languages
+                         if self.__debuggerInterfaceRegistry[lang][0] &
+                         DebugClientCapabilities.HasShell]
         
         return languages[:]
         
@@ -434,13 +433,13 @@
             if clientType is None:
                 clientType = self.clientType
             if clientType in self.__debuggerInterfaceRegistry:
-                self.debuggerInterface = \
+                self.debuggerInterface = (
                     self.__debuggerInterfaceRegistry[clientType][2](
-                        self, self.passive)
+                        self, self.passive))
             else:
-                self.debuggerInterface = \
+                self.debuggerInterface = (
                     self.__debuggerInterfaceRegistry["None"][2](
-                        self, self.passive)
+                        self, self.passive))
                 self.clientType = "None"
         
     def __setClientType(self, clType):
@@ -501,20 +500,20 @@
             if forProject:
                 project = e5App().getObject("Project")
                 if not project.isDebugPropertiesLoaded():
-                    self.clientProcess, isNetworked, clientInterpreter = \
+                    self.clientProcess, isNetworked, clientInterpreter = (
                         self.debuggerInterface.startRemote(
                             self.serverPort(), runInConsole, venvName,
-                            self.__originalPathString, workingDir=workingDir)
+                            self.__originalPathString, workingDir=workingDir))
                 else:
-                    self.clientProcess, isNetworked, clientInterpreter = \
+                    self.clientProcess, isNetworked, clientInterpreter = (
                         self.debuggerInterface.startRemoteForProject(
                             self.serverPort(), runInConsole, venvName,
-                            self.__originalPathString, workingDir=workingDir)
+                            self.__originalPathString, workingDir=workingDir))
             else:
-                self.clientProcess, isNetworked, clientInterpreter = \
+                self.clientProcess, isNetworked, clientInterpreter = (
                     self.debuggerInterface.startRemote(
                         self.serverPort(), runInConsole, venvName,
-                        self.__originalPathString, workingDir=workingDir)
+                        self.__originalPathString, workingDir=workingDir))
             
             if self.clientProcess:
                 self.clientProcess.readyReadStandardError.connect(
@@ -582,8 +581,8 @@
         if self.debugging:
             for row in range(start, end + 1):
                 index = self.breakpointModel.index(row, 0, parentIndex)
-                fn, lineno = \
-                    self.breakpointModel.getBreakPointByIndex(index)[0:2]
+                fn, lineno = (
+                    self.breakpointModel.getBreakPointByIndex(index)[0:2])
                 self.remoteBreakpoint(fn, lineno, False)
 
     def __changeBreakPoints(self, startIndex, endIndex):
@@ -620,8 +619,8 @@
         if self.debugging:
             for row in range(start, end + 1):
                 index = self.breakpointModel.index(row, 0, parentIndex)
-                fn, line, cond, temp, enabled, ignorecount = \
-                    self.breakpointModel.getBreakPointByIndex(index)[:6]
+                fn, line, cond, temp, enabled, ignorecount = (
+                    self.breakpointModel.getBreakPointByIndex(index)[:6])
                 self.remoteBreakpoint(fn, line, True, cond, temp)
                 if not enabled:
                     self.__remoteBreakpointEnable(fn, line, False)
@@ -687,8 +686,8 @@
         if self.debugging:
             for row in range(start, end + 1):
                 index = self.watchpointModel.index(row, 0, parentIndex)
-                cond, special = \
-                    self.watchpointModel.getWatchPointByIndex(index)[0:2]
+                cond, special = (
+                    self.watchpointModel.getWatchPointByIndex(index)[0:2])
                 cond = self.__makeWatchCondition(cond, special)
                 self.__remoteWatchpoint(cond, False)
         
@@ -715,8 +714,8 @@
         if self.debugging:
             for row in range(start, end + 1):
                 index = self.watchpointModel.index(row, 0, parentIndex)
-                cond, special, temp, enabled, ignorecount = \
-                    self.watchpointModel.getWatchPointByIndex(index)[:5]
+                cond, special, temp, enabled, ignorecount = (
+                    self.watchpointModel.getWatchPointByIndex(index)[:5])
                 cond = self.__makeWatchCondition(cond, special)
                 self.__remoteWatchpoint(cond, True, temp)
                 if not enabled:
--- 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
--- a/eric6/Debugger/DebugViewer.py	Sat Sep 21 13:03:17 2019 +0200
+++ b/eric6/Debugger/DebugViewer.py	Sat Sep 21 13:37:58 2019 +0200
@@ -24,9 +24,10 @@
 import os
 
 from PyQt5.QtCore import pyqtSignal
-from PyQt5.QtWidgets import QWidget, QVBoxLayout, QHBoxLayout, QLineEdit, \
-    QSizePolicy, QPushButton, QComboBox, QLabel, QTreeWidget, \
-    QTreeWidgetItem, QHeaderView
+from PyQt5.QtWidgets import (
+    QWidget, QVBoxLayout, QHBoxLayout, QLineEdit, QSizePolicy, QPushButton,
+    QComboBox, QLabel, QTreeWidget, QTreeWidgetItem, QHeaderView
+)
 
 import UI.PixmapCache
 import Preferences
--- a/eric6/Debugger/DebuggerInterfacePython.py	Sat Sep 21 13:03:17 2019 +0200
+++ b/eric6/Debugger/DebuggerInterfacePython.py	Sat Sep 21 13:37:58 2019 +0200
@@ -12,8 +12,9 @@
 import os
 import logging
 
-from PyQt5.QtCore import QObject, QTextCodec, QProcess, QProcessEnvironment, \
-    QTimer
+from PyQt5.QtCore import (
+    QObject, QTextCodec, QProcess, QProcessEnvironment, QTimer
+)
 from PyQt5.QtWidgets import QInputDialog
 
 from E5Gui.E5Application import e5App
@@ -72,11 +73,11 @@
         if passive:
             # set translation function
             if Preferences.getDebugger("PathTranslation"):
-                self.translateRemote = \
-                    Preferences.getDebugger("PathTranslationRemote")
+                self.translateRemote = Preferences.getDebugger(
+                    "PathTranslationRemote")
                 self.translateRemoteWindows = "\\" in self.translateRemote
-                self.translateLocal = \
-                    Preferences.getDebugger("PathTranslationLocal")
+                self.translateLocal = Preferences.getDebugger(
+                    "PathTranslationLocal")
                 self.translateLocalWindows = "\\" in self.translateLocal
                 self.translate = self.__remoteTranslation
             else:
@@ -177,8 +178,8 @@
         venvManager = e5App().getObject("VirtualEnvManager")
         interpreter = venvManager.getVirtualenvInterpreter(venvName)
         execPath = venvManager.getVirtualenvExecPath(venvName)
-        if interpreter == "" and \
-           int(self.__variant[-1]) == sys.version_info[0]:
+        if (interpreter == "" and
+                int(self.__variant[-1]) == sys.version_info[0]):
             # use the interpreter used to run eric for identical variants
             interpreter = sys.executable.replace("w.exe", ".exe")
         if interpreter == "":
@@ -210,12 +211,12 @@
         
         if self.__variant == "Python2":
             redirect = str(Preferences.getDebugger("PythonRedirect"))
-            noencoding = Preferences.getDebugger("PythonNoEncoding") and \
-                '--no-encoding' or ''
+            noencoding = (Preferences.getDebugger("PythonNoEncoding") and
+                          '--no-encoding' or '')
         else:
             redirect = str(Preferences.getDebugger("Python3Redirect"))
-            noencoding = Preferences.getDebugger("Python3NoEncoding") and \
-                '--no-encoding' or ''
+            noencoding = (Preferences.getDebugger("Python3NoEncoding") and
+                          '--no-encoding' or '')
         
         if Preferences.getDebugger("RemoteDbgEnabled"):
             ipaddr = self.debugServer.getHostAddress(False)
@@ -224,9 +225,9 @@
             if rhost == "":
                 rhost = "localhost"
             if rexec:
-                args = Utilities.parseOptionString(rexec) + \
-                    [rhost, interpreter, debugClient,
-                        noencoding, str(port), redirect, ipaddr]
+                args = Utilities.parseOptionString(rexec) + [
+                    rhost, interpreter, debugClient, noencoding, str(port),
+                    redirect, ipaddr]
                 if Utilities.isWindowsPlatform():
                     if not os.path.splitext(args[0])[1]:
                         for ext in [".exe", ".com", ".cmd", ".bat"]:
@@ -248,11 +249,11 @@
                 
                 # set translation function
                 if Preferences.getDebugger("PathTranslation"):
-                    self.translateRemote = \
-                        Preferences.getDebugger("PathTranslationRemote")
+                    self.translateRemote = Preferences.getDebugger(
+                        "PathTranslationRemote")
                     self.translateRemoteWindows = "\\" in self.translateRemote
-                    self.translateLocal = \
-                        Preferences.getDebugger("PathTranslationLocal")
+                    self.translateLocal = Preferences.getDebugger(
+                        "PathTranslationLocal")
                     self.translate = self.__remoteTranslation
                     self.translateLocalWindows = "\\" in self.translateLocal
                 else:
@@ -290,9 +291,9 @@
         if runInConsole or Preferences.getDebugger("ConsoleDbgEnabled"):
             ccmd = Preferences.getDebugger("ConsoleDbgCommand")
             if ccmd:
-                args = Utilities.parseOptionString(ccmd) + \
-                    [interpreter, os.path.abspath(debugClient),
-                        noencoding, str(port), '0', ipaddr]
+                args = Utilities.parseOptionString(ccmd) + [
+                    interpreter, os.path.abspath(debugClient), noencoding,
+                    str(port), '0', ipaddr]
                 args[0] = Utilities.getExecutablePath(args[0])
                 process = self.__startProcess(args[0], args[1:], clientEnv,
                                               workingDir=workingDir)
@@ -359,15 +360,15 @@
                 venvName = Preferences.getDebugger("Python3VirtualEnv")
         
         redirect = str(project.getDebugProperty("REDIRECT"))
-        noencoding = \
-            project.getDebugProperty("NOENCODING") and '--no-encoding' or ''
+        noencoding = (
+            project.getDebugProperty("NOENCODING") and '--no-encoding' or '')
         
         venvManager = e5App().getObject("VirtualEnvManager")
         interpreter = venvManager.getVirtualenvInterpreter(venvName)
         execPath = venvManager.getVirtualenvExecPath(venvName)
-        if interpreter == "" and \
-           project.getProjectLanguage().startswith("Python") and \
-           sys.version_info[0] == int(project.getProjectLanguage()[-1]):
+        if (interpreter == "" and
+            project.getProjectLanguage().startswith("Python") and
+                sys.version_info[0] == int(project.getProjectLanguage()[-1])):
             interpreter = sys.executable.replace("w.exe", ".exe")
         if interpreter == "":
             E5MessageBox.critical(
@@ -385,9 +386,9 @@
             if rhost == "":
                 rhost = "localhost"
             if rexec:
-                args = Utilities.parseOptionString(rexec) + \
-                    [rhost, interpreter, debugClient, noencoding,
-                     str(port), redirect, ipaddr]
+                args = Utilities.parseOptionString(rexec) + [
+                    rhost, interpreter, debugClient, noencoding, str(port),
+                    redirect, ipaddr]
                 if Utilities.isWindowsPlatform():
                     if not os.path.splitext(args[0])[1]:
                         for ext in [".exe", ".com", ".cmd", ".bat"]:
@@ -408,11 +409,10 @@
                             """ started.</p>"""))
                 # set translation function
                 if project.getDebugProperty("PATHTRANSLATION"):
-                    self.translateRemote = \
-                        project.getDebugProperty("REMOTEPATH")
+                    self.translateRemote = project.getDebugProperty(
+                        "REMOTEPATH")
                     self.translateRemoteWindows = "\\" in self.translateRemote
-                    self.translateLocal = \
-                        project.getDebugProperty("LOCALPATH")
+                    self.translateLocal = project.getDebugProperty("LOCALPATH")
                     self.translateLocalWindows = "\\" in self.translateLocal
                     self.translate = self.__remoteTranslation
                 else:
@@ -451,12 +451,12 @@
         
         ipaddr = self.debugServer.getHostAddress(True)
         if runInConsole or project.getDebugProperty("CONSOLEDEBUGGER"):
-            ccmd = project.getDebugProperty("CONSOLECOMMAND") or \
-                Preferences.getDebugger("ConsoleDbgCommand")
+            ccmd = (project.getDebugProperty("CONSOLECOMMAND") or
+                    Preferences.getDebugger("ConsoleDbgCommand"))
             if ccmd:
-                args = Utilities.parseOptionString(ccmd) + \
-                    [interpreter, os.path.abspath(debugClient),
-                        noencoding, str(port), '0', ipaddr]
+                args = Utilities.parseOptionString(ccmd) + [
+                    interpreter, os.path.abspath(debugClient), noencoding,
+                    str(port), '0', ipaddr]
                 args[0] = Utilities.getExecutablePath(args[0])
                 process = self.__startProcess(args[0], args[1:], clientEnv,
                                               workingDir=workingDir)
--- a/eric6/Debugger/EditWatchpointDialog.py	Sat Sep 21 13:03:17 2019 +0200
+++ b/eric6/Debugger/EditWatchpointDialog.py	Sat Sep 21 13:37:58 2019 +0200
@@ -77,11 +77,13 @@
         @param txt text of the line edit (string)
         """
         if self.conditionButton.isChecked():
-            self.buttonBox.button(QDialogButtonBox.Ok)\
-                .setEnabled(self.conditionEdit.text() != "")
+            self.buttonBox.button(
+                QDialogButtonBox.Ok
+            ).setEnabled(self.conditionEdit.text() != "")
         elif self.specialButton.isChecked():
-            self.buttonBox.button(QDialogButtonBox.Ok)\
-                .setEnabled(self.specialEdit.text() != "")
+            self.buttonBox.button(
+                QDialogButtonBox.Ok
+            ).setEnabled(self.specialEdit.text() != "")
         else:
             # should not happen
             self.buttonBox.button(QDialogButtonBox.Ok).setEnabled(False)
--- a/eric6/Debugger/ExceptionLogger.py	Sat Sep 21 13:03:17 2019 +0200
+++ b/eric6/Debugger/ExceptionLogger.py	Sat Sep 21 13:37:58 2019 +0200
@@ -139,5 +139,5 @@
         """
         Private method to open the configuration dialog.
         """
-        e5App().getObject("UserInterface")\
-            .showPreferences("debuggerGeneralPage")
+        e5App().getObject("UserInterface").showPreferences(
+            "debuggerGeneralPage")
--- a/eric6/Debugger/VariablesViewer.py	Sat Sep 21 13:03:17 2019 +0200
+++ b/eric6/Debugger/VariablesViewer.py	Sat Sep 21 13:37:58 2019 +0200
@@ -1196,8 +1196,8 @@
         """
         Private method to open the configuration dialog.
         """
-        e5App().getObject("UserInterface")\
-            .showPreferences("debuggerGeneralPage")
+        e5App().getObject("UserInterface").showPreferences(
+            "debuggerGeneralPage")
     
     def __configureFilter(self):
         """
--- a/eric6/Debugger/WatchPointModel.py	Sat Sep 21 13:03:17 2019 +0200
+++ b/eric6/Debugger/WatchPointModel.py	Sat Sep 21 13:37:58 2019 +0200
@@ -132,9 +132,13 @@
         @param parent index of the parent item (QModelIndex)
         @return requested index (QModelIndex)
         """
-        if (parent and parent.isValid()) or \
-           row < 0 or row >= len(self.watchpoints) or \
-           column < 0 or column >= len(self.header):
+        if (
+            (parent and parent.isValid()) or
+            row < 0 or
+            row >= len(self.watchpoints) or
+            column < 0 or
+            column >= len(self.header)
+        ):
             return QModelIndex()
         
         return self.createIndex(row, column, self.watchpoints[row])
--- a/eric6/Debugger/WatchPointViewer.py	Sat Sep 21 13:03:17 2019 +0200
+++ b/eric6/Debugger/WatchPointViewer.py	Sat Sep 21 13:37:58 2019 +0200
@@ -8,10 +8,12 @@
 """
 
 
-from PyQt5.QtCore import Qt, QModelIndex, QItemSelectionModel, \
-    QSortFilterProxyModel
-from PyQt5.QtWidgets import QTreeView, QAbstractItemView, QMenu, QHeaderView, \
-    QDialog
+from PyQt5.QtCore import (
+    Qt, QModelIndex, QItemSelectionModel, QSortFilterProxyModel
+)
+from PyQt5.QtWidgets import (
+    QTreeView, QAbstractItemView, QMenu, QHeaderView, QDialog
+)
 
 from E5Gui.E5Application import e5App
 from E5Gui import E5MessageBox
@@ -156,15 +158,15 @@
         self.backMenuActions = {}
         self.backMenu = QMenu()
         self.backMenu.addAction(self.tr("Add"), self.__addWatchPoint)
-        self.backMenuActions["EnableAll"] = \
-            self.backMenu.addAction(self.tr("Enable all"),
-                                    self.__enableAllWatchPoints)
-        self.backMenuActions["DisableAll"] = \
-            self.backMenu.addAction(self.tr("Disable all"),
-                                    self.__disableAllWatchPoints)
-        self.backMenuActions["DeleteAll"] = \
-            self.backMenu.addAction(self.tr("Delete all"),
-                                    self.__deleteAllWatchPoints)
+        self.backMenuActions["EnableAll"] = self.backMenu.addAction(
+            self.tr("Enable all"),
+            self.__enableAllWatchPoints)
+        self.backMenuActions["DisableAll"] = self.backMenu.addAction(
+            self.tr("Disable all"),
+            self.__disableAllWatchPoints)
+        self.backMenuActions["DeleteAll"] = self.backMenu.addAction(
+            self.tr("Delete all"),
+            self.__deleteAllWatchPoints)
         self.backMenu.addSeparator()
         self.backMenu.addAction(self.tr("Configure..."), self.__configure)
         self.backMenu.aboutToShow.connect(self.__showBackMenu)
@@ -232,18 +234,19 @@
         if index is None:
             index = QModelIndex()
         idx = self.__model.getWatchPointIndex(cond, special)
-        duplicate = idx.isValid() and \
-            idx.internalPointer() != index.internalPointer()
+        duplicate = (idx.isValid() and
+                     idx.internalPointer() != index.internalPointer())
         if showMessage and 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))
+                    """ for the variable <b>{1}</b> already exists.</p>"""
+                ).format(special, Utilities.html_encode(cond))
             E5MessageBox.warning(
                 self,
                 self.tr("Watch expression already exists"),
@@ -438,5 +441,5 @@
         """
         Private method to open the configuration dialog.
         """
-        e5App().getObject("UserInterface")\
-            .showPreferences("debuggerGeneralPage")
+        e5App().getObject("UserInterface").showPreferences(
+            "debuggerGeneralPage")

eric ide

mercurial