Wed, 14 Oct 2020 18:47:31 +0200
Changed calls of exec_() into exec().
ChangeLog | file | annotate | diff | comparison | revisions | |
PluginPyInstaller.py | file | annotate | diff | comparison | revisions | |
PluginPyInstaller.zip | file | annotate | diff | comparison | revisions |
--- a/ChangeLog Thu Jun 25 19:16:07 2020 +0200 +++ b/ChangeLog Wed Oct 14 18:47:31 2020 +0200 @@ -1,5 +1,8 @@ ChangeLog --------- +Version 2.1.0: +- changed exec_() into exec() + Version 2.0.1: - updated Russion translations
--- a/PluginPyInstaller.py Thu Jun 25 19:16:07 2020 +0200 +++ b/PluginPyInstaller.py Wed Oct 14 18:47:31 2020 +0200 @@ -27,7 +27,7 @@ author = "Detlev Offenbach <detlev@die-offenbachs.de>" autoactivate = True deactivateable = True -version = "2.0.1" +version = "2.1.0" className = "PyInstallerPlugin" packageName = "PyInstaller" shortDescription = "Show dialogs to configure and execute PyInstaller." @@ -191,20 +191,17 @@ _exePy3 = set() versionArgs = ["-c", "import sys; print(sys.version_info[0])"] for exe in exes: - try: - f = open(exe, "r") + with open(exe, "r") as f: line0 = f.readline() - program = line0.replace("#!", "").strip() - process = QProcess() - process.start(program, versionArgs) - process.waitForFinished(5000) - # get a QByteArray of the output - versionBytes = process.readAllStandardOutput() - versionStr = str(versionBytes, encoding='utf-8').strip() - if versionStr == "3": - _exePy3.add(exe) - finally: - f.close() + program = line0.replace("#!", "").strip() + process = QProcess() + process.start(program, versionArgs) + process.waitForFinished(5000) + # get a QByteArray of the output + versionBytes = process.readAllStandardOutput() + versionStr = str(versionBytes, encoding='utf-8').strip() + if versionStr == "3": + _exePy3.add(exe) executables = _exePy3 @@ -430,7 +427,7 @@ params = project.getData('PACKAGERSPARMS', "PYINSTALLER") dlg = PyInstallerConfigDialog(project, executables, params, mode="installer") - if dlg.exec_() == QDialog.Accepted: + if dlg.exec() == QDialog.Accepted: args, params, script = dlg.generateParameters() project.setData('PACKAGERSPARMS', "PYINSTALLER", params) @@ -442,7 +439,7 @@ dia.show() res = dia.start(args, params, project, script) if res: - dia.exec_() + dia.exec() @pyqtSlot() def __pyiMakeSpec(self): @@ -473,7 +470,7 @@ params = project.getData('PACKAGERSPARMS', "PYINSTALLER") dlg = PyInstallerConfigDialog(project, executables, params, mode="spec") - if dlg.exec_() == QDialog.Accepted: + if dlg.exec() == QDialog.Accepted: args, params, script = dlg.generateParameters() project.setData('PACKAGERSPARMS', "PYINSTALLER", params) @@ -485,7 +482,7 @@ dia.show() res = dia.start(args, params, project, script) if res: - dia.exec_() + dia.exec() @pyqtSlot() def __pyinstallerCleanup(self): @@ -498,7 +495,7 @@ PyInstallerCleanupDialog ) dlg = PyInstallerCleanupDialog() - if dlg.exec_() == QDialog.Accepted: + if dlg.exec() == QDialog.Accepted: removeDirs = dlg.getDirectories() for directory in removeDirs: rd = os.path.join(project.getProjectPath(), directory)