Implemented some code simplifications. release-7.2.0

Mon, 26 Apr 2021 17:57:17 +0200

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Mon, 26 Apr 2021 17:57:17 +0200
changeset 131
86d810eea380
parent 130
c15aad5f55cf
child 132
60b54c7d9e8a

Implemented some code simplifications.

ChangeLog file | annotate | diff | comparison | revisions
CxFreeze/CxfreezeConfigDialog.py file | annotate | diff | comparison | revisions
CxFreeze/CxfreezeExecDialog.py file | annotate | diff | comparison | revisions
CxFreeze/Documentation/source/Plugin_Packager_CxFreeze.CxFreeze.CxfreezeConfigDialog.html file | annotate | diff | comparison | revisions
CxFreeze/Documentation/source/Plugin_Packager_CxFreeze.CxFreeze.CxfreezeExecDialog.html file | annotate | diff | comparison | revisions
CxFreeze/Documentation/source/Plugin_Packager_CxFreeze.PluginCxFreeze.html file | annotate | diff | comparison | revisions
PluginCxFreeze.epj file | annotate | diff | comparison | revisions
PluginCxFreeze.py file | annotate | diff | comparison | revisions
PluginCxFreeze.zip file | annotate | diff | comparison | revisions
--- a/ChangeLog	Wed Dec 30 11:02:05 2020 +0100
+++ b/ChangeLog	Mon Apr 26 17:57:17 2021 +0200
@@ -1,5 +1,8 @@
 ChangeLog
 ---------
+Version 7.2.0:
+- implemented some code simplifications
+
 Version 7.1.0:
 - changed exec_() into exec()
 
--- a/CxFreeze/CxfreezeConfigDialog.py	Wed Dec 30 11:02:05 2020 +0100
+++ b/CxFreeze/CxfreezeConfigDialog.py	Mon Apr 26 17:57:17 2021 +0200
@@ -10,6 +10,7 @@
 import sys
 import os
 import copy
+import contextlib
 
 from PyQt5.QtCore import pyqtSlot, QDir, QProcess, QItemSelection
 from PyQt5.QtWidgets import (
@@ -43,7 +44,7 @@
         """
         self.selectedFilesFolders = []
         
-        QFileDialog.__init__(self, parent, caption, directory, fileFilter)
+        super().__init__(parent, caption, directory, fileFilter)
         self.setFileMode(QFileDialog.ExistingFiles)
     
     def exec(self):
@@ -171,11 +172,9 @@
         self.exe = exe
         self.cxfreezeExecCombo.addItems(exe)
         # try to set the saved script path
-        try:
+        with contextlib.suppress(ValueError):
             idx = exe.index(self.parameters['script'])
             self.cxfreezeExecCombo.setCurrentIndex(idx)
-        except ValueError:
-            pass
         
         self.targetDirCompleter = E5DirCompleter(self.targetDirEdit)
         self.extListFileCompleter = E5FileCompleter(self.extListFileEdit)
--- a/CxFreeze/CxfreezeExecDialog.py	Wed Dec 30 11:02:05 2020 +0100
+++ b/CxFreeze/CxfreezeExecDialog.py	Mon Apr 26 17:57:17 2021 +0200
@@ -36,7 +36,7 @@
         @param cmdname name of the packager (string)
         @param parent parent widget of this dialog (QWidget)
         """
-        QDialog.__init__(self, parent)
+        super().__init__(parent)
         self.setupUi(self)
         
         self.buttonBox.button(QDialogButtonBox.Close).setEnabled(False)
@@ -213,7 +213,7 @@
         
         @param main self-object of the caller
         """
-        super(CopyAdditionalFiles, self).__init__()
+        super().__init__()
         
         self.ppath = main.ppath
         self.additionalFiles = main.additionalFiles
--- a/CxFreeze/Documentation/source/Plugin_Packager_CxFreeze.CxFreeze.CxfreezeConfigDialog.html	Wed Dec 30 11:02:05 2020 +0100
+++ b/CxFreeze/Documentation/source/Plugin_Packager_CxFreeze.CxFreeze.CxfreezeConfigDialog.html	Mon Apr 26 17:57:17 2021 +0200
@@ -194,7 +194,7 @@
 </dd>
 </dl>
 <dl>
-<dt>Returns:</dt>
+<dt>Return:</dt>
 <dd>
 list of split values
 </dd>
@@ -223,7 +223,7 @@
         the default settings.
 </p>
 <dl>
-<dt>Returns:</dt>
+<dt>Return:</dt>
 <dd>
 a tuple of the commandline parameters and non default
             parameters (list of strings, dictionary)
@@ -383,8 +383,8 @@
 <td>Public method to update the list with the selected files and folders.</td>
 </tr>
 <tr>
-<td><a href="#DirFileDialog.exec_">exec_</a></td>
-<td>Public slot to finalize initialisation and start the event loop.</td>
+<td><a href="#DirFileDialog.exec">exec</a></td>
+<td>Public slot to finalize initialization and start the event loop.</td>
 </tr>
 <tr>
 <td><a href="#DirFileDialog.on_directoryEntered">on_directoryEntered</a></td>
@@ -438,15 +438,15 @@
 <p>
         Public method to update the list with the selected files and folders.
 </p>
-<a NAME="DirFileDialog.exec_" ID="DirFileDialog.exec_"></a>
-<h4>DirFileDialog.exec_</h4>
-<b>exec_</b>(<i></i>)
+<a NAME="DirFileDialog.exec" ID="DirFileDialog.exec"></a>
+<h4>DirFileDialog.exec</h4>
+<b>exec</b>(<i></i>)
 
 <p>
-        Public slot to finalize initialisation and start the event loop.
+        Public slot to finalize initialization and start the event loop.
 </p>
 <dl>
-<dt>Returns:</dt>
+<dt>Return:</dt>
 <dd>
 accepted or rejected (QDialog.DialogCode)
 </dd>
@@ -515,7 +515,7 @@
 </dd>
 </dl>
 <dl>
-<dt>Returns:</dt>
+<dt>Return:</dt>
 <dd>
 names of the selected files and folders (list of strings)
 </dd>
--- a/CxFreeze/Documentation/source/Plugin_Packager_CxFreeze.CxFreeze.CxfreezeExecDialog.html	Wed Dec 30 11:02:05 2020 +0100
+++ b/CxFreeze/Documentation/source/Plugin_Packager_CxFreeze.CxFreeze.CxfreezeExecDialog.html	Mon Apr 26 17:57:17 2021 +0200
@@ -141,14 +141,10 @@
 </dl>
 <dl>
 
-<dt>Raises <b>IOError</b>:</dt>
+<dt>Raises <b>OSError</b>:</dt>
 <dd>
 raised if the given source does not exist
 </dd>
-<dt>Raises <b>OSError</b>:</dt>
-<dd>
-raised if there is an issue writing the package
-</dd>
 </dl>
 <a NAME="CopyAdditionalFiles.run" ID="CopyAdditionalFiles.run"></a>
 <h4>CopyAdditionalFiles.run</h4>
@@ -191,7 +187,7 @@
 </dd>
 </dl>
 <dl>
-<dt>Returns:</dt>
+<dt>Return:</dt>
 <dd>
 destination path
 </dd>
@@ -380,7 +376,7 @@
 </dd>
 </dl>
 <dl>
-<dt>Returns:</dt>
+<dt>Return:</dt>
 <dd>
 flag indicating the successful start of the process
 </dd>
--- a/CxFreeze/Documentation/source/Plugin_Packager_CxFreeze.PluginCxFreeze.html	Wed Dec 30 11:02:05 2020 +0100
+++ b/CxFreeze/Documentation/source/Plugin_Packager_CxFreeze.PluginCxFreeze.html	Mon Apr 26 17:57:17 2021 +0200
@@ -181,7 +181,7 @@
         Public method to activate this plugin.
 </p>
 <dl>
-<dt>Returns:</dt>
+<dt>Return:</dt>
 <dd>
 tuple of None and activation status (boolean)
 </dd>
@@ -204,7 +204,7 @@
     Restricted function to check the availability of cxfreeze.
 </p>
 <dl>
-<dt>Returns:</dt>
+<dt>Return:</dt>
 <dd>
 flag indicating availability (boolean)
 </dd>
@@ -227,7 +227,7 @@
 </dd>
 </dl>
 <dl>
-<dt>Returns:</dt>
+<dt>Return:</dt>
 <dd>
 names of the executable (list)
 </dd>
@@ -243,7 +243,7 @@
     Public method to support the display of some executable info.
 </p>
 <dl>
-<dt>Returns:</dt>
+<dt>Return:</dt>
 <dd>
 dictionary containing the data to query the presence of
         the executable
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/PluginCxFreeze.epj	Mon Apr 26 17:57:17 2021 +0200
@@ -0,0 +1,268 @@
+{
+  "header": {
+    "comment": "eric project file for project PluginCxFreeze",
+    "copyright": "Copyright (C) 2021 Detlev Offenbach, detlev@die-offenbachs.de"
+  },
+  "project": {
+    "AUTHOR": "Detlev Offenbach",
+    "CHECKERSPARMS": {
+      "Pep8Checker": {
+        "AnnotationsChecker": {
+          "AllowUntypedDefs": false,
+          "AllowUntypedNested": false,
+          "DispatchDecorators": [
+            "singledispatch",
+            "singledispatchmethod"
+          ],
+          "MaximumComplexity": 3,
+          "MaximumLength": 7,
+          "MinimumCoverage": 75,
+          "MypyInitReturn": false,
+          "OverloadDecorators": [
+            "overload"
+          ],
+          "SuppressDummyArgs": false,
+          "SuppressNoneReturning": true
+        },
+        "BlankLines": [
+          2,
+          1
+        ],
+        "BuiltinsChecker": {
+          "bytes": [
+            "unicode"
+          ],
+          "chr": [
+            "unichr"
+          ],
+          "str": [
+            "unicode"
+          ]
+        },
+        "CommentedCodeChecker": {
+          "Aggressive": false,
+          "WhiteList": [
+            "pylint",
+            "pyright",
+            "noqa",
+            "type:\\s*ignore",
+            "fmt:\\s*(on|off)",
+            "TODO",
+            "FIXME",
+            "WARNING",
+            "NOTE",
+            "TEST",
+            "DOCU",
+            "XXX",
+            "- "
+          ]
+        },
+        "CopyrightAuthor": "",
+        "CopyrightMinFileSize": 0,
+        "DocstringType": "eric",
+        "EnabledCheckerCategories": "C, D, E, M, N, S, Y, 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,W504,Y119,Y401,Y402",
+        "FixCodes": "",
+        "FixIssues": false,
+        "FutureChecker": "",
+        "HangClosing": false,
+        "IncludeMessages": "",
+        "LineComplexity": 25,
+        "LineComplexityScore": 10,
+        "MaxCodeComplexity": 10,
+        "MaxDocLineLength": 79,
+        "MaxLineLength": 79,
+        "NoFixCodes": "E501",
+        "RepeatMessages": true,
+        "SecurityChecker": {
+          "CheckTypedException": false,
+          "HardcodedTmpDirectories": [
+            "/tmp",
+            "/var/tmp",
+            "/dev/shm",
+            "~/tmp"
+          ],
+          "InsecureHashes": [
+            "md4",
+            "md5",
+            "sha",
+            "sha1"
+          ],
+          "InsecureSslProtocolVersions": [
+            "PROTOCOL_SSLv2",
+            "SSLv2_METHOD",
+            "SSLv23_METHOD",
+            "PROTOCOL_SSLv3",
+            "PROTOCOL_TLSv1",
+            "SSLv3_METHOD",
+            "TLSv1_METHOD"
+          ],
+          "WeakKeySizeDsaHigh": "1024",
+          "WeakKeySizeDsaMedium": "2048",
+          "WeakKeySizeEcHigh": "160",
+          "WeakKeySizeEcMedium": "224",
+          "WeakKeySizeRsaHigh": "1024",
+          "WeakKeySizeRsaMedium": "2048"
+        },
+        "ShowIgnored": false,
+        "ValidEncodings": "latin-1, utf-8"
+      }
+    },
+    "DESCRIPTION": "This plugin implements an eric5 interface to the cxfreeze packager.",
+    "DOCSTRING": "",
+    "DOCUMENTATIONPARMS": {
+      "ERIC4DOC": {
+        "cssFile": "%PYTHON%/eric6/CSSs/default.css",
+        "ignoreDirectories": [
+          ".eric5project",
+          ".eric6project",
+          ".ropeproject",
+          ".hg"
+        ],
+        "ignoreFilePatterns": [
+          "Ui_*"
+        ],
+        "outputDirectory": "CxFreeze/Documentation/source",
+        "qtHelpEnabled": false,
+        "useRecursion": true
+      }
+    },
+    "EMAIL": "detlev@die-offenbachs.de",
+    "EOL": 1,
+    "FILETYPES": {
+      "*.idl": "INTERFACES",
+      "*.py": "SOURCES",
+      "*.py3": "SOURCES",
+      "*.pyw": "SOURCES",
+      "*.pyw3": "SOURCES",
+      "*.qm": "TRANSLATIONS",
+      "*.qrc": "RESOURCES",
+      "*.ts": "TRANSLATIONS",
+      "*.ui": "FORMS",
+      "*.ui.h": "FORMS",
+      "Ui_*.py": "__IGNORE__"
+    },
+    "FORMS": [
+      "CxFreeze/CxfreezeConfigDialog.ui",
+      "CxFreeze/CxfreezeExecDialog.ui"
+    ],
+    "HASH": "e6cc5d1be724a6f9b38cea1b3785946161f4baeb",
+    "IDLPARAMS": {
+      "DefinedNames": [],
+      "IncludeDirs": [],
+      "UndefinedNames": []
+    },
+    "INTERFACES": [],
+    "LEXERASSOCS": {},
+    "MAINSCRIPT": "PluginCxFreeze.py",
+    "MAKEPARAMS": {
+      "MakeEnabled": false,
+      "MakeExecutable": "",
+      "MakeFile": "",
+      "MakeParameters": "",
+      "MakeTarget": "",
+      "MakeTestOnly": true
+    },
+    "MIXEDLANGUAGE": false,
+    "OTHERS": [
+      ".hgignore",
+      "ChangeLog",
+      "CxFreeze/Documentation/LICENSE.GPL3",
+      "CxFreeze/Documentation/source",
+      "PKGLIST",
+      "PluginCxFreeze.e4p",
+      "PluginCxFreeze.zip",
+      "PluginCxFreeze.epj"
+    ],
+    "OTHERTOOLSPARMS": {},
+    "PACKAGERSPARMS": {},
+    "PROGLANGUAGE": "Python3",
+    "PROJECTTYPE": "E6Plugin",
+    "PROJECTTYPESPECIFICDATA": {},
+    "PROTOCOLS": [],
+    "RCCPARAMS": {
+      "CompressLevel": 0,
+      "CompressionDisable": false,
+      "CompressionThreshold": 70,
+      "PathPrefix": ""
+    },
+    "RESOURCES": [],
+    "SOURCES": [
+      "CxFreeze/CxfreezeConfigDialog.py",
+      "CxFreeze/CxfreezeExecDialog.py",
+      "CxFreeze/CxfreezeFindPath.py",
+      "CxFreeze/__init__.py",
+      "PluginCxFreeze.py",
+      "__init__.py"
+    ],
+    "SPELLEXCLUDES": "",
+    "SPELLLANGUAGE": "en",
+    "SPELLWORDS": "",
+    "TRANSLATIONEXCEPTIONS": [],
+    "TRANSLATIONPATTERN": "CxFreeze/i18n/cxfreeze_%language%.ts",
+    "TRANSLATIONS": [
+      "CxFreeze/i18n/cxfreeze_cs.qm",
+      "CxFreeze/i18n/cxfreeze_cs.ts",
+      "CxFreeze/i18n/cxfreeze_de.qm",
+      "CxFreeze/i18n/cxfreeze_de.ts",
+      "CxFreeze/i18n/cxfreeze_en.qm",
+      "CxFreeze/i18n/cxfreeze_en.ts",
+      "CxFreeze/i18n/cxfreeze_es.qm",
+      "CxFreeze/i18n/cxfreeze_es.ts",
+      "CxFreeze/i18n/cxfreeze_fr.qm",
+      "CxFreeze/i18n/cxfreeze_fr.ts",
+      "CxFreeze/i18n/cxfreeze_it.qm",
+      "CxFreeze/i18n/cxfreeze_it.ts",
+      "CxFreeze/i18n/cxfreeze_ru.qm",
+      "CxFreeze/i18n/cxfreeze_ru.ts"
+    ],
+    "TRANSLATIONSBINPATH": "",
+    "UICPARAMS": {
+      "Package": "",
+      "PackagesRoot": "",
+      "RcSuffix": ""
+    },
+    "VCS": "Mercurial",
+    "VCSOPTIONS": {
+      "add": [
+        ""
+      ],
+      "checkout": [
+        ""
+      ],
+      "commit": [
+        ""
+      ],
+      "diff": [
+        ""
+      ],
+      "export": [
+        ""
+      ],
+      "global": [
+        ""
+      ],
+      "history": [
+        ""
+      ],
+      "log": [
+        ""
+      ],
+      "remove": [
+        ""
+      ],
+      "status": [
+        ""
+      ],
+      "tag": [
+        ""
+      ],
+      "update": [
+        ""
+      ]
+    },
+    "VCSOTHERDATA": {},
+    "VERSION": "6.0.x"
+  }
+}
\ No newline at end of file
--- a/PluginCxFreeze.py	Wed Dec 30 11:02:05 2020 +0100
+++ b/PluginCxFreeze.py	Mon Apr 26 17:57:17 2021 +0200
@@ -24,7 +24,7 @@
 author = "Detlev Offenbach <detlev@die-offenbachs.de>"
 autoactivate = True
 deactivateable = True
-version = "7.1.0"
+version = "7.2.0"
 className = "CxFreezePlugin"
 packageName = "CxFreeze"
 shortDescription = "Show the CxFreeze dialogs."
@@ -232,7 +232,7 @@
         
         @param ui reference to the user interface object (UI.UserInterface)
         """
-        QObject.__init__(self, ui)
+        super().__init__(ui)
         self.__ui = ui
         self.__initialize()
         _checkProgram()
@@ -311,12 +311,14 @@
         @param menuName name of the menu to be shown (string)
         @param menu reference to the menu (QMenu)
         """
-        if menuName == "Packagers":
-            if self.__projectAct is not None:
-                self.__projectAct.setEnabled(
-                    e5App().getObject("Project").getProjectLanguage() ==
-                    "Python3"
-                )
+        if (
+            menuName == "Packagers" and
+            self.__projectAct is not None
+        ):
+            self.__projectAct.setEnabled(
+                e5App().getObject("Project").getProjectLanguage() ==
+                "Python3"
+            )
     
     def __loadTranslator(self):
         """
Binary file PluginCxFreeze.zip has changed

eric ide

mercurial