Corrected some code style, code formatting and imports order issues. eric7

Thu, 24 Nov 2022 16:21:10 +0100

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Thu, 24 Nov 2022 16:21:10 +0100
branch
eric7
changeset 9531
155b2646799a
parent 9530
c30f02ea1b27
child 9532
39a1ebff6b4e

Corrected some code style, code formatting and imports order issues.

src/eric7/EricXML/ProjectReader.py file | annotate | diff | comparison | revisions
src/eric7/Preferences/ConfigurationPages/DebuggerGeneralPage.py file | annotate | diff | comparison | revisions
src/eric7/Preferences/ConfigurationPages/ProjectBrowserPage.py file | annotate | diff | comparison | revisions
src/eric7/Preferences/__init__.py file | annotate | diff | comparison | revisions
src/eric7/Project/AddDirectoryDialog.py file | annotate | diff | comparison | revisions
src/eric7/Project/FiletypeAssociationDialog.py file | annotate | diff | comparison | revisions
src/eric7/Project/ProjectFile.py file | annotate | diff | comparison | revisions
src/eric7/Project/ProjectTranslationsBrowser.py file | annotate | diff | comparison | revisions
src/eric7/Project/QuickFindFileDialog.py file | annotate | diff | comparison | revisions
src/eric7/UI/UserInterface.py file | annotate | diff | comparison | revisions
src/eric7/Utilities/__init__.py file | annotate | diff | comparison | revisions
--- a/src/eric7/EricXML/ProjectReader.py	Thu Nov 24 16:11:55 2022 +0100
+++ b/src/eric7/EricXML/ProjectReader.py	Thu Nov 24 16:21:10 2022 +0100
@@ -118,9 +118,7 @@
                         int(self.attribute("index", "0")), dataKey="EOL", setDirty=False
                     )
                 elif self.name() in fileCategoryTags:
-                    self.__readFiles(
-                        self.name(), self.name()[:-1], self.name().upper()
-                    )
+                    self.__readFiles(self.name(), self.name()[:-1], self.name().upper())
                 elif self.name() == "TranslationExceptions":
                     self.__readFiles(
                         "TranslationExceptions",
--- a/src/eric7/Preferences/ConfigurationPages/DebuggerGeneralPage.py	Thu Nov 24 16:11:55 2022 +0100
+++ b/src/eric7/Preferences/ConfigurationPages/DebuggerGeneralPage.py	Thu Nov 24 16:21:10 2022 +0100
@@ -204,9 +204,7 @@
         Preferences.setDebugger("RemoteHost", self.hostLineEdit.text())
         Preferences.setDebugger("RemoteExecution", self.execLineEdit.text())
 
-        Preferences.setDebugger(
-            "PassiveDbgEnabled", self.passiveDbgGroup.isChecked()
-        )
+        Preferences.setDebugger("PassiveDbgEnabled", self.passiveDbgGroup.isChecked())
         Preferences.setDebugger("PassiveDbgPort", self.passiveDbgPortSpinBox.value())
         Preferences.setDebugger(
             "PassiveDbgType", self.passiveDbgBackendCombo.currentText()
--- a/src/eric7/Preferences/ConfigurationPages/ProjectBrowserPage.py	Thu Nov 24 16:11:55 2022 +0100
+++ b/src/eric7/Preferences/ConfigurationPages/ProjectBrowserPage.py	Thu Nov 24 16:21:10 2022 +0100
@@ -9,7 +9,7 @@
 
 import contextlib
 
-from PyQt6.QtCore import pyqtSlot, Qt
+from PyQt6.QtCore import Qt, pyqtSlot
 from PyQt6.QtWidgets import QListWidgetItem
 
 from eric7 import Preferences
--- a/src/eric7/Preferences/__init__.py	Thu Nov 24 16:11:55 2022 +0100
+++ b/src/eric7/Preferences/__init__.py	Thu Nov 24 16:21:10 2022 +0100
@@ -51,7 +51,6 @@
 from eric7.EricWidgets import EricFileDialog
 from eric7.EricWidgets.EricApplication import ericApp
 from eric7.EricWidgets.EricIconBar import EricIconBar
-
 from eric7.QScintilla.Shell import ShellHistoryStyle
 from eric7.Utilities.crypto import pwConvert
 from eric7.Utilities.crypto.py3PBKDF2 import hashPassword
@@ -741,7 +740,6 @@
         "AutoExecuteMake": False,
         "AutoLoadDbgProperties": False,
         "AutoSaveDbgProperties": False,
-        ##"HideGeneratedForms": False,
         "FollowEditor": True,
         "FollowCursorLine": True,
         "AutoPopulateItems": True,
@@ -767,52 +765,99 @@
     # defaults for the project browser lists settings
     projectBrowsersDefaults = {
         "allBrowsers": (
-            "sources", "forms", "resources", "translations", "others",
-            "interfaces", "protocols",
+            "sources",
+            "forms",
+            "resources",
+            "translations",
+            "others",
+            "interfaces",
+            "protocols",
         ),
         "PyQt5": (
-            "sources", "forms", "resources", "translations", "others",
-            "interfaces", "protocols",
+            "sources",
+            "forms",
+            "resources",
+            "translations",
+            "others",
+            "interfaces",
+            "protocols",
         ),
         "PyQt5C": (
-            "sources", "resources", "translations", "others",
-            "interfaces", "protocols",
+            "sources",
+            "resources",
+            "translations",
+            "others",
+            "interfaces",
+            "protocols",
         ),
         "PyQt6": (
-            "sources", "forms", "translations", "others",
-            "interfaces", "protocols",
+            "sources",
+            "forms",
+            "translations",
+            "others",
+            "interfaces",
+            "protocols",
         ),
         "PyQt6C": (
-            "sources", "translations", "others",
-            "interfaces", "protocols",
+            "sources",
+            "translations",
+            "others",
+            "interfaces",
+            "protocols",
         ),
         "E7Plugin": (
-            "sources", "forms", "translations", "others",
-            "interfaces", "protocols",
+            "sources",
+            "forms",
+            "translations",
+            "others",
+            "interfaces",
+            "protocols",
         ),
         "Console": (
-            "sources", "others",
-            "interfaces", "protocols",
+            "sources",
+            "others",
+            "interfaces",
+            "protocols",
         ),
         "Other": (
-            "sources", "others",
-            "interfaces", "protocols",
+            "sources",
+            "others",
+            "interfaces",
+            "protocols",
         ),
         "PySide2": (
-            "sources", "forms", "resources", "translations", "others",
-            "interfaces", "protocols",
+            "sources",
+            "forms",
+            "resources",
+            "translations",
+            "others",
+            "interfaces",
+            "protocols",
         ),
         "PySide2C": (
-            "sources", "resources", "translations", "others",
-            "interfaces", "protocols",
+            "sources",
+            "resources",
+            "translations",
+            "others",
+            "interfaces",
+            "protocols",
         ),
         "PySide6": (
-            "sources", "forms", "resources", "translations", "others",
-            "interfaces", "protocols",
+            "sources",
+            "forms",
+            "resources",
+            "translations",
+            "others",
+            "interfaces",
+            "protocols",
         ),
         "PySide6C": (
-            "sources", "resources", "translations", "others",
-            "interfaces", "protocols",
+            "sources",
+            "resources",
+            "translations",
+            "others",
+            "interfaces",
+            "protocols",
         ),
     }
 
--- a/src/eric7/Project/AddDirectoryDialog.py	Thu Nov 24 16:11:55 2022 +0100
+++ b/src/eric7/Project/AddDirectoryDialog.py	Thu Nov 24 16:21:10 2022 +0100
@@ -52,8 +52,7 @@
             )
         else:
             for fileCategory in sorted(
-                c for c in self.__project.getFileCategories()
-                if c != "TRANSLATIONS"
+                c for c in self.__project.getFileCategories() if c != "TRANSLATIONS"
             ):
                 self.filterComboBox.addItem(
                     self.__project.getFileCategoryString(fileCategory),
--- a/src/eric7/Project/FiletypeAssociationDialog.py	Thu Nov 24 16:11:55 2022 +0100
+++ b/src/eric7/Project/FiletypeAssociationDialog.py	Thu Nov 24 16:21:10 2022 +0100
@@ -52,10 +52,10 @@
                     pattern, self.__project.getFileCategoryType(filetype), filetype
                 )
             except KeyError:
-                if filetype == "__IGNORE__":
+                if filetype != "__IGNORE__":
+                    raise  # re-raise the error if the type is not __IGNORE__
+                else:
                     self.__createItem(pattern, self.tr("Ignore"), "__IGNORE__")
-                else:
-                    raise  # re-raise the error if the type is not __IGNORE__
 
         self.__resort()
         self.__reformat()
--- a/src/eric7/Project/ProjectFile.py	Thu Nov 24 16:11:55 2022 +0100
+++ b/src/eric7/Project/ProjectFile.py	Thu Nov 24 16:21:10 2022 +0100
@@ -8,7 +8,6 @@
 """
 
 import contextlib
-
 import json
 import time
 import typing
--- a/src/eric7/Project/ProjectTranslationsBrowser.py	Thu Nov 24 16:11:55 2022 +0100
+++ b/src/eric7/Project/ProjectTranslationsBrowser.py	Thu Nov 24 16:21:10 2022 +0100
@@ -63,9 +63,7 @@
         @param parent parent widget of this browser
         @type QWidget
         """
-        ProjectBaseBrowser.__init__(
-            self, project, "translation", parent
-        )
+        ProjectBaseBrowser.__init__(self, project, "translation", parent)
         self.isTranslationsBrowser = True
 
         self.selectedItemsFilter = [
--- a/src/eric7/Project/QuickFindFileDialog.py	Thu Nov 24 16:11:55 2022 +0100
+++ b/src/eric7/Project/QuickFindFileDialog.py	Thu Nov 24 16:21:10 2022 +0100
@@ -145,15 +145,6 @@
         @yield set of files in our project
         @ytype str
         """
-        ##for typ in [
-            ##"SOURCES",
-            ##"FORMS",
-            ##"INTERFACES",
-            ##"PROTOCOLS",
-            ##"RESOURCES",
-            ##"TRANSLATIONS",
-            ##"OTHERS",
-        ##]:
         for fileCategory in self.project.getFileCategories():
             entries = self.project.getProjectData(dataKey=fileCategory, default=[])
             yield from entries[:]
--- a/src/eric7/UI/UserInterface.py	Thu Nov 24 16:11:55 2022 +0100
+++ b/src/eric7/UI/UserInterface.py	Thu Nov 24 16:21:10 2022 +0100
@@ -464,7 +464,6 @@
         self.debuggerUI.processChangedProjectFiles.connect(
             self.project.processChangedProjectFiles
         )
-        ##self.debuggerUI.executeMake.connect(self.project.executeMake)
         self.debuggerUI.appendStdout.connect(self.appendToStdout)
 
         self.__debugServer.clientDisassembly.connect(
--- a/src/eric7/Utilities/__init__.py	Thu Nov 24 16:11:55 2022 +0100
+++ b/src/eric7/Utilities/__init__.py	Thu Nov 24 16:21:10 2022 +0100
@@ -64,7 +64,6 @@
     sessionType,
     setConfigDir,
 )
-
 from eric7.UI.Info import Program, Version
 
 

eric ide

mercurial