Mon, 26 Apr 2021 18:03:44 +0200
Implemented some code simplifications.
--- a/ChangeLog Wed Dec 30 11:02:06 2020 +0100 +++ b/ChangeLog Mon Apr 26 18:03:44 2021 +0200 @@ -1,5 +1,8 @@ ChangeLog --------- +Version 2.2.0: +- implemented some code simplifications + Version 2.1.0: - changed exec_() into exec()
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/PluginPyInstaller.epj Mon Apr 26 18:03:44 2021 +0200 @@ -0,0 +1,270 @@ +{ + "header": { + "comment": "eric project file for project PluginPyInstaller", + "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 interface to the PyInstaller packager.", + "DOCSTRING": "", + "DOCUMENTATIONPARMS": { + "ERIC4DOC": { + "cssFile": "%PYTHON%/eric6/CSSs/default.css", + "ignoreDirectories": [ + ".eric6project", + ".ropeproject", + "_eric6project", + ".hg" + ], + "ignoreFilePatterns": [ + "Ui_*.py" + ], + "outputDirectory": "PyInstaller/Documentation/source", + "qtHelpEnabled": false, + "useRecursion": true + } + }, + "EMAIL": "detlev@die-offenbachs.de", + "EOL": 1, + "FILETYPES": { + "*.e4p": "OTHERS", + "*.idl": "INTERFACES", + "*.md": "OTHERS", + "*.proto": "PROTOCOLS", + "*.py": "SOURCES", + "*.py3": "SOURCES", + "*.pyw": "SOURCES", + "*.pyw3": "SOURCES", + "*.qm": "TRANSLATIONS", + "*.qrc": "RESOURCES", + "*.rst": "OTHERS", + "*.ts": "TRANSLATIONS", + "*.txt": "OTHERS", + "*.ui": "FORMS", + "README": "OTHERS", + "README.*": "OTHERS", + "Ui_*.py": "__IGNORE__" + }, + "FORMS": [ + "PyInstaller/PyInstallerCleanupDialog.ui", + "PyInstaller/PyInstallerConfigDialog.ui", + "PyInstaller/PyInstallerExecDialog.ui" + ], + "HASH": "3a7e5bc36f1ae73d45efc807f5aeb2c0236daa13", + "IDLPARAMS": { + "DefinedNames": [], + "IncludeDirs": [], + "UndefinedNames": [] + }, + "INTERFACES": [], + "LEXERASSOCS": {}, + "MAINSCRIPT": "PluginPyInstaller.py", + "MAKEPARAMS": { + "MakeEnabled": false, + "MakeExecutable": "", + "MakeFile": "", + "MakeParameters": "", + "MakeTarget": "", + "MakeTestOnly": true + }, + "MIXEDLANGUAGE": false, + "OTHERS": [ + ".hgignore", + "ChangeLog", + "PKGLIST", + "PluginPyInstaller.e4p", + "PluginPyInstaller.zip", + "PyInstaller/Documentation/LICENSE.GPL3", + "PyInstaller/Documentation/source", + "PluginPyInstaller.epj" + ], + "OTHERTOOLSPARMS": {}, + "PACKAGERSPARMS": {}, + "PROGLANGUAGE": "Python3", + "PROJECTTYPE": "E6Plugin", + "PROJECTTYPESPECIFICDATA": {}, + "PROTOCOLS": [], + "RCCPARAMS": { + "CompressLevel": 0, + "CompressionDisable": false, + "CompressionThreshold": 70, + "PathPrefix": "" + }, + "RESOURCES": [], + "SOURCES": [ + "PluginPyInstaller.py", + "PyInstaller/PyInstallerCleanupDialog.py", + "PyInstaller/PyInstallerConfigDialog.py", + "PyInstaller/PyInstallerExecDialog.py", + "PyInstaller/__init__.py", + "__init__.py" + ], + "SPELLEXCLUDES": "", + "SPELLLANGUAGE": "en_US", + "SPELLWORDS": "", + "TRANSLATIONEXCEPTIONS": [], + "TRANSLATIONPATTERN": "PyInstaller/i18n/pyinstaller_%language%.ts", + "TRANSLATIONS": [ + "PyInstaller/i18n/pyinstaller_de.qm", + "PyInstaller/i18n/pyinstaller_de.ts", + "PyInstaller/i18n/pyinstaller_empty.ts", + "PyInstaller/i18n/pyinstaller_en.qm", + "PyInstaller/i18n/pyinstaller_en.ts", + "PyInstaller/i18n/pyinstaller_es.qm", + "PyInstaller/i18n/pyinstaller_es.ts", + "PyInstaller/i18n/pyinstaller_ru.qm", + "PyInstaller/i18n/pyinstaller_ru.ts" + ], + "TRANSLATIONSBINPATH": "", + "UICPARAMS": { + "Package": "", + "PackagesRoot": "", + "RcSuffix": "" + }, + "VCS": "Mercurial", + "VCSOPTIONS": { + "add": [ + "" + ], + "checkout": [ + "" + ], + "commit": [ + "" + ], + "diff": [ + "" + ], + "export": [ + "" + ], + "global": [ + "" + ], + "history": [ + "" + ], + "log": [ + "" + ], + "remove": [ + "" + ], + "status": [ + "" + ], + "tag": [ + "" + ], + "update": [ + "" + ] + }, + "VCSOTHERDATA": {}, + "VERSION": "2.x" + } +} \ No newline at end of file
--- a/PluginPyInstaller.py Wed Dec 30 11:02:06 2020 +0100 +++ b/PluginPyInstaller.py Mon Apr 26 18:03:44 2021 +0200 @@ -7,6 +7,7 @@ Module implementing the PyInstaller interface plug-in. """ +import contextlib import os import platform import shutil @@ -27,7 +28,7 @@ author = "Detlev Offenbach <detlev@die-offenbachs.de>" autoactivate = True deactivateable = True -version = "2.1.0" +version = "2.2.0" className = "PyInstallerPlugin" packageName = "PyInstaller" shortDescription = "Show dialogs to configure and execute PyInstaller." @@ -106,7 +107,7 @@ def getExePath(branch, access, versionStr): exes = [] - try: + with contextlib.suppress(WindowsError, OSError): software = winreg.OpenKey(branch, 'Software', 0, access) python = winreg.OpenKey(software, 'Python', 0, access) pcore = winreg.OpenKey(python, 'PythonCore', 0, access) @@ -120,8 +121,6 @@ exe = os.path.join(installpath, 'Scripts', 'pyi-makespec.exe') if os.access(exe, os.X_OK): exes.append(exe) - except (WindowsError, OSError): # __IGNORE_WARNING__ - pass return exes versionSuffixes = ["", "-32", "-64"] @@ -247,7 +246,7 @@ @param ui reference to the user interface object @type UI.UserInterface """ - super(PyInstallerPlugin, self).__init__(ui) + super().__init__(ui) self.__ui = ui self.__initialize()
--- a/PyInstaller/Documentation/source/Plugin_Packager_PyInstaller.PluginPyInstaller.html Wed Dec 30 11:02:06 2020 +0100 +++ b/PyInstaller/Documentation/source/Plugin_Packager_PyInstaller.PluginPyInstaller.html Mon Apr 26 18:03:44 2021 +0200 @@ -205,7 +205,7 @@ Public method to activate this plug-in. </p> <dl> -<dt>Returns:</dt> +<dt>Return:</dt> <dd> tuple of None and activation status (boolean) </dd> @@ -228,7 +228,7 @@ Restricted function to check the availability of pyinstaller. </p> <dl> -<dt>Returns:</dt> +<dt>Return:</dt> <dd> flag indicating availability (boolean) </dd> @@ -251,7 +251,7 @@ </dd> </dl> <dl> -<dt>Returns:</dt> +<dt>Return:</dt> <dd> names of the executables </dd> @@ -273,7 +273,7 @@ Module function to support the display of some executable info. </p> <dl> -<dt>Returns:</dt> +<dt>Return:</dt> <dd> list of dictionaries containing the data to query the presence of the executable
--- a/PyInstaller/Documentation/source/Plugin_Packager_PyInstaller.PyInstaller.PyInstallerCleanupDialog.html Wed Dec 30 11:02:06 2020 +0100 +++ b/PyInstaller/Documentation/source/Plugin_Packager_PyInstaller.PyInstaller.PyInstallerCleanupDialog.html Mon Apr 26 18:03:44 2021 +0200 @@ -105,7 +105,7 @@ Public method to get the project relative directories to be cleaned. </p> <dl> -<dt>Returns:</dt> +<dt>Return:</dt> <dd> list of directories to be removed </dd>
--- a/PyInstaller/Documentation/source/Plugin_Packager_PyInstaller.PyInstaller.PyInstallerConfigDialog.html Wed Dec 30 11:02:06 2020 +0100 +++ b/PyInstaller/Documentation/source/Plugin_Packager_PyInstaller.PyInstaller.PyInstallerConfigDialog.html Mon Apr 26 18:03:44 2021 +0200 @@ -183,7 +183,7 @@ generation to overwrite the default settings. </p> <dl> -<dt>Returns:</dt> +<dt>Return:</dt> <dd> a tuple of the command line parameters, non default parameters and the script path
--- a/PyInstaller/Documentation/source/Plugin_Packager_PyInstaller.PyInstaller.PyInstallerExecDialog.html Wed Dec 30 11:02:06 2020 +0100 +++ b/PyInstaller/Documentation/source/Plugin_Packager_PyInstaller.PyInstaller.PyInstallerExecDialog.html Mon Apr 26 18:03:44 2021 +0200 @@ -228,7 +228,7 @@ </dd> </dl> <dl> -<dt>Returns:</dt> +<dt>Return:</dt> <dd> flag indicating the successful start of the process </dd>
--- a/PyInstaller/PyInstallerCleanupDialog.py Wed Dec 30 11:02:06 2020 +0100 +++ b/PyInstaller/PyInstallerCleanupDialog.py Mon Apr 26 18:03:44 2021 +0200 @@ -26,7 +26,7 @@ @param parent reference to the parent widget @type QWidget """ - super(PyInstallerCleanupDialog, self).__init__(parent) + super().__init__(parent) self.setupUi(self) msh = self.minimumSizeHint()
--- a/PyInstaller/PyInstallerConfigDialog.py Wed Dec 30 11:02:06 2020 +0100 +++ b/PyInstaller/PyInstallerConfigDialog.py Mon Apr 26 18:03:44 2021 +0200 @@ -40,7 +40,7 @@ @param parent reference to the parent widget @type QWidget """ - super(PyInstallerConfigDialog, self).__init__(parent) + super().__init__(parent) self.setupUi(self) self.__project = project @@ -264,10 +264,11 @@ args.append("--noconfirm") # don't ask the user # determine the script to be processed - if self.__parameters["mainscript"]: - script = self.__project.getMainScript() - else: - script = self.__parameters["inputFile"] + script = ( + self.__project.getMainScript() + if self.__parameters["mainscript"] else + self.__parameters["inputFile"] + ) return args, parms, script @@ -308,7 +309,7 @@ ) # call the accept slot of the base class - super(PyInstallerConfigDialog, self).accept() + super().accept() def __updateOkButton(self): """
--- a/PyInstaller/PyInstallerExecDialog.py Wed Dec 30 11:02:06 2020 +0100 +++ b/PyInstaller/PyInstallerExecDialog.py Mon Apr 26 18:03:44 2021 +0200 @@ -37,7 +37,7 @@ @param parent reference to the parent widget @type QWidget """ - super(PyInstallerExecDialog, self).__init__(parent) + super().__init__(parent) self.setupUi(self) self.buttonBox.button(QDialogButtonBox.Close).setEnabled(False)