Corrected some code style and formatting issues. eric7

Sun, 21 Jan 2024 13:00:42 +0100

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Sun, 21 Jan 2024 13:00:42 +0100
branch
eric7
changeset 10517
aecd5a8c958c
parent 10516
72baef0baa76
child 10518
1682f3203ae5

Corrected some code style and formatting issues.

scripts/install.py file | annotate | diff | comparison | revisions
src/eric7/Debugger/DebuggerInterfacePython.py file | annotate | diff | comparison | revisions
src/eric7/JediInterface/JediServer.py file | annotate | diff | comparison | revisions
src/eric7/Network/IRC/IrcWidget.py file | annotate | diff | comparison | revisions
src/eric7/PluginManager/PluginRepositoryDialog.py file | annotate | diff | comparison | revisions
src/eric7/Plugins/CheckerPlugins/CodeStyleChecker/CodeStyleCheckerDialog.py file | annotate | diff | comparison | revisions
src/eric7/Plugins/CheckerPlugins/CodeStyleChecker/Security/Checks/certificateValidation.py file | annotate | diff | comparison | revisions
src/eric7/Plugins/CheckerPlugins/CodeStyleChecker/Security/Checks/djangoXssVulnerability.py file | annotate | diff | comparison | revisions
src/eric7/Plugins/CheckerPlugins/CodeStyleChecker/Security/__init__.py file | annotate | diff | comparison | revisions
src/eric7/Plugins/VcsPlugins/vcsMercurial/HgUserConfigDialog.py file | annotate | diff | comparison | revisions
src/eric7/Plugins/VcsPlugins/vcsMercurial/hg.py file | annotate | diff | comparison | revisions
src/eric7/Plugins/VcsPlugins/vcsPySvn/subversion.py file | annotate | diff | comparison | revisions
src/eric7/Preferences/ConfigurationPages/WebBrowserPage.py file | annotate | diff | comparison | revisions
src/eric7/Project/Project.py file | annotate | diff | comparison | revisions
src/eric7/Project/ProjectBrowserModel.py file | annotate | diff | comparison | revisions
src/eric7/QScintilla/Editor.py file | annotate | diff | comparison | revisions
src/eric7/UI/BrowserModel.py file | annotate | diff | comparison | revisions
--- a/scripts/install.py	Sun Jan 21 12:53:23 2024 +0100
+++ b/scripts/install.py	Sun Jan 21 13:00:42 2024 +0100
@@ -971,7 +971,7 @@
         for desktop in ("eric7_ide", "eric7_browser"):
             copyDesktopFile(
                 os.path.join(dataSourceDir, desktop + ".desktop.in"),
-                os.path.join(dst, desktop + ".desktop")
+                os.path.join(dst, desktop + ".desktop"),
             )
 
         for dst in (
--- a/src/eric7/Debugger/DebuggerInterfacePython.py	Sun Jan 21 12:53:23 2024 +0100
+++ b/src/eric7/Debugger/DebuggerInterfacePython.py	Sun Jan 21 13:00:42 2024 +0100
@@ -664,7 +664,7 @@
         @param sock reference to the disconnected socket
         @type QTcpSocket
         """
-        for debuggerId in self.__connections:
+        for debuggerId in list(self.__connections):
             if self.__connections[debuggerId] is sock:
                 del self.__connections[debuggerId]
                 if debuggerId == self.__mainDebugger:
--- a/src/eric7/JediInterface/JediServer.py	Sun Jan 21 12:53:23 2024 +0100
+++ b/src/eric7/JediInterface/JediServer.py	Sun Jan 21 13:00:42 2024 +0100
@@ -993,7 +993,7 @@
         @param editor reference to the editor to forget about
         @type Editor
         """
-        for uid in self.__editors:
+        for uid in list(self.__editors):
             if self.__editors[uid] is editor:
                 with contextlib.suppress(KeyError):
                     del self.__editors[uid]
--- a/src/eric7/Network/IRC/IrcWidget.py	Sun Jan 21 12:53:23 2024 +0100
+++ b/src/eric7/Network/IRC/IrcWidget.py	Sun Jan 21 13:00:42 2024 +0100
@@ -469,7 +469,7 @@
         @param name name of the closed channel
         @type str
         """
-        for channel in self.__channelList:
+        for channel in self.__channelList[:]:
             if channel.name() == name:
                 self.channelsWidget.removeTab(self.channelsWidget.indexOf(channel))
                 self.__channelList.remove(channel)
--- a/src/eric7/PluginManager/PluginRepositoryDialog.py	Sun Jan 21 12:53:23 2024 +0100
+++ b/src/eric7/PluginManager/PluginRepositoryDialog.py	Sun Jan 21 13:00:42 2024 +0100
@@ -440,8 +440,9 @@
         self.__installButton.setEnabled(enable)
 
         self.selectedLabel.setText(
-            self.tr("Selected: <b>{0}</b>")
-            .format(len(self.repositoryList.selectedItems()))
+            self.tr("Selected: <b>{0}</b>").format(
+                len(self.repositoryList.selectedItems())
+            )
         )
 
     def reloadList(self):
--- a/src/eric7/Plugins/CheckerPlugins/CodeStyleChecker/CodeStyleCheckerDialog.py	Sun Jan 21 12:53:23 2024 +0100
+++ b/src/eric7/Plugins/CheckerPlugins/CodeStyleChecker/CodeStyleCheckerDialog.py	Sun Jan 21 13:00:42 2024 +0100
@@ -1923,7 +1923,7 @@
                     )
                 )
             )
-        ),
+        )
         self.insecureSslProtocolsEdit.setPlainText(
             "\n".join(
                 Preferences.toList(
@@ -1935,7 +1935,7 @@
                     )
                 )
             )
-        ),
+        )
         self.dsaHighRiskCombo.setCurrentText(
             settings.value(
                 "PEP8/WeakKeySizeDsaHigh",
@@ -1947,31 +1947,31 @@
                 "PEP8/WeakKeySizeDsaMedium",
                 defaultParameters["SecurityChecker"]["WeakKeySizeDsaMedium"],
             )
-        ),
+        )
         self.rsaHighRiskCombo.setCurrentText(
             settings.value(
                 "PEP8/WeakKeySizeRsaHigh",
                 defaultParameters["SecurityChecker"]["WeakKeySizeRsaHigh"],
             )
-        ),
+        )
         self.rsaMediumRiskCombo.setCurrentText(
             settings.value(
                 "PEP8/WeakKeySizeRsaMedium",
                 defaultParameters["SecurityChecker"]["WeakKeySizeRsaMedium"],
             )
-        ),
+        )
         self.ecHighRiskCombo.setCurrentText(
             settings.value(
                 "PEP8/WeakKeySizeEcHigh",
                 defaultParameters["SecurityChecker"]["WeakKeySizeEcHigh"],
             )
-        ),
+        )
         self.ecMediumRiskCombo.setCurrentText(
             settings.value(
                 "PEP8/WeakKeySizeEcMedium",
                 defaultParameters["SecurityChecker"]["WeakKeySizeEcMedium"],
             )
-        ),
+        )
         self.typedExceptionsCheckBox.setChecked(
             Preferences.toBool(
                 settings.value(
@@ -1979,7 +1979,7 @@
                     defaultParameters["SecurityChecker"]["CheckTypedException"],
                 )
             )
-        ),
+        )
 
         # Imports Checker
         self.appPackagesEdit.setPlainText(
@@ -2249,37 +2249,37 @@
         settings.setValue(
             "PEP8/HardcodedTmpDirectories",
             [t.strip() for t in self.tmpDirectoriesEdit.toPlainText().splitlines()],
-        ),
+        )
         settings.setValue(
             "PEP8/InsecureHashes",
             [h.strip() for h in self.hashesEdit.text().split(",")],
-        ),
+        )
         settings.setValue(
             "PEP8/InsecureSslProtocolVersions",
             [
                 p.strip()
                 for p in self.insecureSslProtocolsEdit.toPlainText().splitlines()
             ],
-        ),
+        )
         settings.setValue(
             "PEP8/WeakKeySizeDsaHigh", self.dsaHighRiskCombo.currentText()
-        ),
+        )
         settings.setValue(
             "PEP8/WeakKeySizeDsaMedium", self.dsaMediumRiskCombo.currentText()
-        ),
+        )
         settings.setValue(
             "PEP8/WeakKeySizeRsaHigh", self.rsaHighRiskCombo.currentText()
-        ),
+        )
         settings.setValue(
             "PEP8/WeakKeySizeRsaMedium", self.rsaMediumRiskCombo.currentText()
-        ),
-        settings.setValue("PEP8/WeakKeySizeEcHigh", self.ecHighRiskCombo.currentText()),
+        )
+        settings.setValue("PEP8/WeakKeySizeEcHigh", self.ecHighRiskCombo.currentText())
         settings.setValue(
             "PEP8/WeakKeySizeEcMedium", self.ecMediumRiskCombo.currentText()
-        ),
+        )
         settings.setValue(
             "PEP8/CheckTypedException", self.typedExceptionsCheckBox.isChecked()
-        ),
+        )
 
         # Imports Checker
         settings.setValue(
--- a/src/eric7/Plugins/CheckerPlugins/CodeStyleChecker/Security/Checks/certificateValidation.py	Sun Jan 21 12:53:23 2024 +0100
+++ b/src/eric7/Plugins/CheckerPlugins/CodeStyleChecker/Security/Checks/certificateValidation.py	Sun Jan 21 13:00:42 2024 +0100
@@ -46,18 +46,9 @@
     httpxAttrs = ("request", "stream", "Client", "AsyncClient") + httpVerbs
     qualName = context.callFunctionNameQual.split(".")[0]
     if (
-        (
-            (
-                qualName == "requests"
-                and context.callFunctionName in httpVerbs
-            )
-            or (
-                qualName == "httpx"
-                and context.callFunctionName in httpxAttrs
-            )
-        )
-        and context.checkCallArgValue("verify", "False")
-    ):
+        (qualName == "requests" and context.callFunctionName in httpVerbs)
+        or (qualName == "httpx" and context.callFunctionName in httpxAttrs)
+    ) and context.checkCallArgValue("verify", "False"):
         reportError(
             context.getLinenoForCallArg("verify") - 1,
             context.getOffsetForCallArg("verify"),
--- a/src/eric7/Plugins/CheckerPlugins/CodeStyleChecker/Security/Checks/djangoXssVulnerability.py	Sun Jan 21 12:53:23 2024 +0100
+++ b/src/eric7/Plugins/CheckerPlugins/CodeStyleChecker/Security/Checks/djangoXssVulnerability.py	Sun Jan 21 13:00:42 2024 +0100
@@ -313,7 +313,7 @@
             elif isinstance(arg, ast.Starred) and isinstance(
                 arg.value, (ast.List, ast.Tuple)
             ):
-                args.extend(arg.value.elts)
+                args.extend(arg.value.elts)  # noqa: M538
                 numSecure += 1
             else:
                 break
--- a/src/eric7/Plugins/CheckerPlugins/CodeStyleChecker/Security/__init__.py	Sun Jan 21 12:53:23 2024 +0100
+++ b/src/eric7/Plugins/CheckerPlugins/CodeStyleChecker/Security/__init__.py	Sun Jan 21 13:00:42 2024 +0100
@@ -10,4 +10,3 @@
 ###########################################################################
 ## The security checker is based on Bandit v1.7.6.                       ##
 ###########################################################################
-
--- a/src/eric7/Plugins/VcsPlugins/vcsMercurial/HgUserConfigDialog.py	Sun Jan 21 12:53:23 2024 +0100
+++ b/src/eric7/Plugins/VcsPlugins/vcsMercurial/HgUserConfigDialog.py	Sun Jan 21 13:00:42 2024 +0100
@@ -306,8 +306,8 @@
                 else:
                     name = username
                     email = ""
-                self.userNameEdit.setText(name.strip()),
-                self.emailEdit.setText(email.strip()),
+                self.userNameEdit.setText(name.strip())
+                self.emailEdit.setText(email.strip())
 
             # step 2: extract extensions information
             if "extensions" in self.__config:
--- a/src/eric7/Plugins/VcsPlugins/vcsMercurial/hg.py	Sun Jan 21 12:53:23 2024 +0100
+++ b/src/eric7/Plugins/VcsPlugins/vcsMercurial/hg.py	Sun Jan 21 13:00:42 2024 +0100
@@ -1179,7 +1179,7 @@
                             if dirName in names:
                                 names[dirName] = VersionControlState.Controlled
                             if dirs:
-                                for d in dirs:
+                                for d in dirs[:]:
                                     if name.startswith(d):
                                         names[d] = VersionControlState.Controlled
                                         dirs.remove(d)
--- a/src/eric7/Plugins/VcsPlugins/vcsPySvn/subversion.py	Sun Jan 21 12:53:23 2024 +0100
+++ b/src/eric7/Plugins/VcsPlugins/vcsPySvn/subversion.py	Sun Jan 21 13:00:42 2024 +0100
@@ -1650,7 +1650,7 @@
                                 self.statusCache[dn] = VersionControlState.Controlled
                         self.statusCache[name] = VersionControlState.Controlled
                         if dirs:
-                            for d in dirs:
+                            for d in dirs[:]:
                                 if name.startswith(d):
                                     names[d] = VersionControlState.Controlled
                                     self.statusCache[d] = VersionControlState.Controlled
--- a/src/eric7/Preferences/ConfigurationPages/WebBrowserPage.py	Sun Jan 21 12:53:23 2024 +0100
+++ b/src/eric7/Preferences/ConfigurationPages/WebBrowserPage.py	Sun Jan 21 13:00:42 2024 +0100
@@ -276,11 +276,11 @@
         Preferences.setWebBrowser("WebGLEnabled", self.webGLCheckBox.isChecked())
         Preferences.setWebBrowser(
             "Accelerated2dCanvasEnabled", self.accelerated2dCanvasCheckBox.isChecked()
-        ),
+        )
 
         Preferences.setWebBrowser(
             "AutoLoadIconsForPage", self.autoloadIconsCheckBox.isChecked()
-        ),
+        )
         Preferences.setWebBrowser(
             "PlaybackRequiresUserGesture", self.autoplayMediaCheckBox.isChecked()
         )
--- a/src/eric7/Project/Project.py	Sun Jan 21 12:53:23 2024 +0100
+++ b/src/eric7/Project/Project.py	Sun Jan 21 13:00:42 2024 +0100
@@ -5730,7 +5730,7 @@
                     if recursiveSearch:
                         d = self.getRelativePath(ns)
                         if d not in dirs:
-                            dirs.append(d)
+                            dirs.append(d)  # noqa: M538
                     continue
 
                 filetype = ""
--- a/src/eric7/Project/ProjectBrowserModel.py	Sun Jan 21 12:53:23 2024 +0100
+++ b/src/eric7/Project/ProjectBrowserModel.py	Sun Jan 21 13:00:42 2024 +0100
@@ -715,7 +715,7 @@
             for f in entryInfoList:
                 fpath = FileSystemUtilities.toNativeSeparators(f.absoluteFilePath())
                 childFound = False
-                for child in children:
+                for child in children[:]:
                     if child.name() == fpath:
                         childFound = True
                         children.remove(child)
@@ -755,7 +755,7 @@
                     child = itm.child(row)
                     childname = FileSystemUtilities.fromNativeSeparators(child.name())
                     entryFound = False
-                    for f in entryInfoList:
+                    for f in entryInfoList[:]:
                         if f.absoluteFilePath() == childname:
                             entryFound = True
                             entryInfoList.remove(f)
--- a/src/eric7/QScintilla/Editor.py	Sun Jan 21 12:53:23 2024 +0100
+++ b/src/eric7/QScintilla/Editor.py	Sun Jan 21 13:00:42 2024 +0100
@@ -2618,7 +2618,7 @@
         if self.inLinesChanged:
             return
 
-        for handle in self.breaks:
+        for handle in list(self.breaks):
             if self.markerLine(handle) == line - 1:
                 del self.breaks[handle]
                 self.markerDeleteHandle(handle)
@@ -2920,7 +2920,7 @@
         @param line line number of the bookmark
         @type int
         """
-        for handle in self.bookmarks:
+        for handle in self.bookmarks[:]:
             if self.markerLine(handle) == line - 1:
                 self.bookmarks.remove(handle)
                 self.markerDeleteHandle(handle)
--- a/src/eric7/UI/BrowserModel.py	Sun Jan 21 12:53:23 2024 +0100
+++ b/src/eric7/UI/BrowserModel.py	Sun Jan 21 13:00:42 2024 +0100
@@ -380,7 +380,7 @@
             for f in entryInfoList:
                 fpath = FileSystemUtilities.toNativeSeparators(f.absoluteFilePath())
                 childFound = False
-                for child in children:
+                for child in children[:]:
                     if child.name() == fpath:
                         childFound = True
                         children.remove(child)
@@ -411,7 +411,7 @@
                     child = itm.child(row)
                     childname = FileSystemUtilities.fromNativeSeparators(child.name())
                     entryFound = False
-                    for f in entryInfoList:
+                    for f in entryInfoList[:]:
                         if f.absoluteFilePath() == childname:
                             entryFound = True
                             entryInfoList.remove(f)

eric ide

mercurial