Corrected some code style issues and converted some source code documentation to the new style. eric7

Sat, 23 Dec 2023 16:30:39 +0100

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Sat, 23 Dec 2023 16:30:39 +0100
branch
eric7
changeset 55
3794f1ca53af
parent 54
359e2d772474
child 56
02709629940d

Corrected some code style issues and converted some source code documentation to the new style.

PluginPyInstaller.epj file | annotate | diff | comparison | revisions
PluginPyInstaller.py file | annotate | diff | comparison | revisions
PyInstallerInterface/Documentation/source/Plugin_Packager_PyInstaller.PyInstallerInterface.PyInstallerExecDialog.html file | annotate | diff | comparison | revisions
PyInstallerInterface/PyInstallerConfigDialog.py file | annotate | diff | comparison | revisions
PyInstallerInterface/PyInstallerExecDialog.py file | annotate | diff | comparison | revisions
--- a/PluginPyInstaller.epj	Sat Dec 23 15:48:50 2023 +0100
+++ b/PluginPyInstaller.epj	Sat Dec 23 16:30:39 2023 +0100
@@ -1,7 +1,7 @@
 {
   "header": {
     "comment": "eric project file for project PluginPyInstaller",
-    "copyright": "Copyright (C) 2022 Detlev Offenbach, detlev@die-offenbachs.de"
+    "copyright": "Copyright (C) 2023 Detlev Offenbach, detlev@die-offenbachs.de"
   },
   "project": {
     "AUTHOR": "Detlev Offenbach",
@@ -11,10 +11,14 @@
           "AllowStarArgAny": false,
           "AllowUntypedDefs": false,
           "AllowUntypedNested": false,
+          "CheckFutureAnnotations": false,
           "DispatchDecorators": [
             "singledispatch",
             "singledispatchmethod"
           ],
+          "ExemptedTypingSymbols": [
+            ""
+          ],
           "ForceFutureAnnotations": false,
           "MaximumComplexity": 3,
           "MaximumLength": 7,
@@ -62,15 +66,18 @@
         "CopyrightAuthor": "",
         "CopyrightMinFileSize": 0,
         "DocstringType": "eric_black",
-        "EnabledCheckerCategories": "C, D, E, M, N, S, Y, W",
+        "EnabledCheckerCategories": "C, D, E, I, L, M, NO, N, S, Y, U, W",
         "ExcludeFiles": "*/Ui_*.py, */*_rc.py,",
-        "ExcludeMessages": "C101,E265,E266,E305,E402,M201,M301,M302,M303,M304,M305,M306,M307,M308,M311,M312,M313,M314,M315,M321,M701,M702,M811,M834,N802,N803,N807,N808,N821,W293,W503,Y119,Y401,Y402",
+        "ExcludeMessages": "C101,E265,E266,E305,E402,M201,M301,M302,M303,M304,M305,M306,M307,M308,M311,M312,M313,M314,M315,M321,M701,M702,M811,M834,M852,N802,N803,N807,N808,N821,W293,W503,Y119,Y401,Y402",
         "FixCodes": "",
         "FixIssues": false,
         "FutureChecker": "",
         "HangClosing": false,
         "ImportsChecker": {
-          "ApplicationPackageNames": [],
+          "ApplicationPackageNames": [
+            "PyinstallerInterface",
+            "eric7"
+          ],
           "BanRelativeImports": "",
           "BannedModules": []
         },
@@ -80,6 +87,17 @@
         "MaxCodeComplexity": 10,
         "MaxDocLineLength": 88,
         "MaxLineLength": 88,
+        "NameOrderChecker": {
+          "ApplicationPackageNames": [
+            "PyinstallerInterface",
+            "eric7"
+          ],
+          "CombinedAsImports": false,
+          "SortCaseSensitive": false,
+          "SortFromFirst": false,
+          "SortIgnoringStyle": false,
+          "SortOrder": "natural"
+        },
         "NoFixCodes": "E501",
         "RepeatMessages": true,
         "SecurityChecker": {
@@ -113,6 +131,19 @@
           "WeakKeySizeRsaMedium": "2048"
         },
         "ShowIgnored": false,
+        "UnusedChecker": {
+          "IgnoreAbstract": true,
+          "IgnoreDunderGlobals": true,
+          "IgnoreDunderMethods": true,
+          "IgnoreEventHandlerMethods": false,
+          "IgnoreLambdas": false,
+          "IgnoreNestedFunctions": false,
+          "IgnoreOverload": true,
+          "IgnoreOverride": true,
+          "IgnoreSlotMethods": false,
+          "IgnoreStubs": true,
+          "IgnoreVariadicNames": false
+        },
         "ValidEncodings": "latin-1, utf-8"
       }
     },
@@ -132,6 +163,7 @@
         ],
         "outputDirectory": "PyInstallerInterface/Documentation/source",
         "qtHelpEnabled": false,
+        "startDirectory": "",
         "useRecursion": true
       }
     },
@@ -195,7 +227,7 @@
     ],
     "OTHERTOOLSPARMS": {
       "Black": {
-        "exclude": "/(\\.direnv|\\.eggs|\\.git|\\.hg|\\.mypy_cache|\\.nox|\\.tox|\\.venv|venv|\\.svn|\\.ipynb_checkpoints|_build|buck-out|build|dist|__pypackages__)/",
+        "exclude": "/(\\.direnv|\\.eggs|\\.git|\\.hg|\\.ipynb_checkpoints|\\.mypy_cache|\\.nox|\\.pytest_cache|\\.ruff_cache|\\.tox|\\.svn|\\.venv|\\.vscode|__pypackages__|_build|buck-out|build|dist|venv)/",
         "extend-exclude": "",
         "force-exclude": "",
         "line-length": 88,
@@ -203,6 +235,7 @@
         "skip-string-normalization": false,
         "source": "project",
         "target-version": [
+          "py312",
           "py311",
           "py310",
           "py39",
@@ -248,6 +281,7 @@
       "PyInstallerInterface/__init__.py",
       "__init__.py"
     ],
+    "SOURCESDIR": "",
     "SPELLEXCLUDES": "",
     "SPELLLANGUAGE": "en_US",
     "SPELLWORDS": "",
--- a/PluginPyInstaller.py	Sat Dec 23 15:48:50 2023 +0100
+++ b/PluginPyInstaller.py	Sat Dec 23 16:30:39 2023 +0100
@@ -103,7 +103,7 @@
         # Windows
         #
         try:
-            import winreg
+            import winreg  # noqa: I101, I103
         except ImportError:
             import _winreg as winreg  # __IGNORE_WARNING__
 
@@ -390,7 +390,7 @@
 
         self.__initialize()
 
-    def __projectShowMenu(self, menuName, menu):
+    def __projectShowMenu(self, menuName, menu):  # noqa: U100
         """
         Private slot called, when the the project menu or a submenu is
         about to be shown.
@@ -434,6 +434,9 @@
         Private slot to execute the pyinstaller command for the current
         project.
         """
+        from PyInstallerInterface.PyInstallerConfigDialog import PyInstallerConfigDialog
+        from PyInstallerInterface.PyInstallerExecDialog import PyInstallerExecDialog
+
         project = ericApp().getObject("Project")
         majorVersionStr = project.getProjectLanguage()
         if majorVersionStr == "Python3":
@@ -444,9 +447,7 @@
                 EricMessageBox.critical(
                     self.__ui,
                     self.tr("pyinstaller"),
-                    self.tr(
-                        """The pyinstaller executable could not be""" """ found."""
-                    ),
+                    self.tr("""The pyinstaller executable could not be found."""),
                 )
                 return
 
@@ -454,10 +455,6 @@
             if not project.checkAllScriptsDirty(reportSyntaxErrors=True):
                 return
 
-            from PyInstallerInterface.PyInstallerConfigDialog import (
-                PyInstallerConfigDialog,
-            )
-
             params = project.getData("PACKAGERSPARMS", "PYINSTALLER")
             dlg = PyInstallerConfigDialog(
                 project, executables, params, mode="installer"
@@ -467,13 +464,9 @@
                 project.setData("PACKAGERSPARMS", "PYINSTALLER", params)
 
                 # now do the call
-                from PyInstallerInterface.PyInstallerExecDialog import (
-                    PyInstallerExecDialog,
-                )
-
                 dia = PyInstallerExecDialog("pyinstaller")
                 dia.show()
-                res = dia.start(args, params, project, script)
+                res = dia.start(args, project, script)
                 if res:
                     dia.exec()
 
@@ -483,6 +476,9 @@
         Private slot to execute the pyi-makespec command for the current
         project to generate a spec file to be used by pyinstaller.
         """
+        from PyInstallerInterface.PyInstallerConfigDialog import PyInstallerConfigDialog
+        from PyInstallerInterface.PyInstallerExecDialog import PyInstallerExecDialog
+
         project = ericApp().getObject("Project")
         majorVersionStr = project.getProjectLanguage()
         if majorVersionStr == "Python3":
@@ -493,9 +489,7 @@
                 EricMessageBox.critical(
                     self.__ui,
                     self.tr("pyi-makespec"),
-                    self.tr(
-                        """The pyi-makespec executable could not be""" """ found."""
-                    ),
+                    self.tr("""The pyi-makespec executable could not be found."""),
                 )
                 return
 
@@ -503,10 +497,6 @@
             if not project.checkAllScriptsDirty(reportSyntaxErrors=True):
                 return
 
-            from PyInstallerInterface.PyInstallerConfigDialog import (
-                PyInstallerConfigDialog,
-            )
-
             params = project.getData("PACKAGERSPARMS", "PYINSTALLER")
             dlg = PyInstallerConfigDialog(project, executables, params, mode="spec")
             if dlg.exec() == QDialog.DialogCode.Accepted:
@@ -514,13 +504,9 @@
                 project.setData("PACKAGERSPARMS", "PYINSTALLER", params)
 
                 # now do the call
-                from PyInstallerInterface.PyInstallerExecDialog import (
-                    PyInstallerExecDialog,
-                )
-
                 dia = PyInstallerExecDialog("pyinstaller")
                 dia.show()
-                res = dia.start(args, params, project, script)
+                res = dia.start(args, project, script)
                 if res:
                     dia.exec()
 
@@ -529,12 +515,12 @@
         """
         Private slot to remove the directories created by pyinstaller.
         """
-        project = ericApp().getObject("Project")
-
         from PyInstallerInterface.PyInstallerCleanupDialog import (
             PyInstallerCleanupDialog,
         )
 
+        project = ericApp().getObject("Project")
+
         dlg = PyInstallerCleanupDialog()
         if dlg.exec() == QDialog.DialogCode.Accepted:
             removeDirs = dlg.getDirectories()
@@ -557,4 +543,4 @@
 
 
 #
-# eflag: noqa = M801
+# eflag: noqa = M801, U200, I102
--- a/PyInstallerInterface/Documentation/source/Plugin_Packager_PyInstaller.PyInstallerInterface.PyInstallerExecDialog.html	Sat Dec 23 15:48:50 2023 +0100
+++ b/PyInstallerInterface/Documentation/source/Plugin_Packager_PyInstaller.PyInstallerInterface.PyInstallerExecDialog.html	Sat Dec 23 16:30:39 2023 +0100
@@ -188,7 +188,7 @@
 </dl>
 <a NAME="PyInstallerExecDialog.start" ID="PyInstallerExecDialog.start"></a>
 <h4>PyInstallerExecDialog.start</h4>
-<b>start</b>(<i>args, parms, project, script</i>)
+<b>start</b>(<i>args, project, script</i>)
 
 <p>
         Public slot to start the packager command.
@@ -199,10 +199,6 @@
 <dd>
 command line arguments for packager program
 </dd>
-<dt><i>parms</i> (dict)</dt>
-<dd>
-parameters got from the config dialog
-</dd>
 <dt><i>project</i> (Project)</dt>
 <dd>
 reference to the project object
--- a/PyInstallerInterface/PyInstallerConfigDialog.py	Sat Dec 23 15:48:50 2023 +0100
+++ b/PyInstallerInterface/PyInstallerConfigDialog.py	Sat Dec 23 16:30:39 2023 +0100
@@ -83,13 +83,11 @@
         self.iconFilePicker.setDefaultDirectory(self.__project.getProjectPath())
         if isMacPlatform():
             self.iconFilePicker.setFilters(
-                self.tr("Icon Files (*.icns);;" "All Files (*)")
+                self.tr("Icon Files (*.icns);;All Files (*)")
             )
         elif isWindowsPlatform():
             self.iconFilePicker.setFilters(
-                self.tr(
-                    "Icon Files (*.ico);;" "Executable Files (*.exe);;" "All Files (*)"
-                )
+                self.tr("Icon Files (*.ico);;Executable Files (*.exe);;All Files (*)")
             )
 
         # disable platform specific tabs
@@ -319,7 +317,7 @@
         self.buttonBox.button(QDialogButtonBox.StandardButton.Ok).setEnabled(enable)
 
     @pyqtSlot(bool)
-    def on_selectedScriptButton_toggled(self, checked):
+    def on_selectedScriptButton_toggled(self, checked):  # noqa: U100
         """
         Private slot to handle changes of the radio button state.
 
@@ -329,7 +327,7 @@
         self.__updateOkButton()
 
     @pyqtSlot(str)
-    def on_inputFilePicker_textChanged(self, txt):
+    def on_inputFilePicker_textChanged(self, txt):  # noqa: U100
         """
         Private slot to handle changes of the input file.
 
@@ -350,7 +348,7 @@
         self.__updateOkButton()
 
     @pyqtSlot(str)
-    def on_iconIdEdit_textChanged(self, txt):
+    def on_iconIdEdit_textChanged(self, txt):  # noqa: U100
         """
         Private slot to handle changes of the icon ID.
 
--- a/PyInstallerInterface/PyInstallerExecDialog.py	Sat Dec 23 15:48:50 2023 +0100
+++ b/PyInstallerInterface/PyInstallerExecDialog.py	Sat Dec 23 16:30:39 2023 +0100
@@ -46,14 +46,12 @@
         self.__process = None
         self.__cmdname = cmdname  # used for several outputs
 
-    def start(self, args, parms, project, script):
+    def start(self, args, project, script):
         """
         Public slot to start the packager command.
 
         @param args command line arguments for packager program
         @type list of str
-        @param parms parameters got from the config dialog
-        @type dict
         @param project reference to the project object
         @type Project
         @param script script or spec file name to be processed by by the

eric ide

mercurial