128 |
128 |
129 versionSuffixes = ["", "-32", "-64"] |
129 versionSuffixes = ["", "-32", "-64"] |
130 for minorVersion in minorVersions: |
130 for minorVersion in minorVersions: |
131 for versionSuffix in versionSuffixes: |
131 for versionSuffix in versionSuffixes: |
132 versionStr = '{0}.{1}{2}'.format(majorVersion, minorVersion, |
132 versionStr = '{0}.{1}{2}'.format(majorVersion, minorVersion, |
133 versionSuffix) |
133 versionSuffix) |
134 exePaths = getExePath( |
134 exePaths = getExePath( |
135 winreg.HKEY_CURRENT_USER, |
135 winreg.HKEY_CURRENT_USER, |
136 winreg.KEY_WOW64_32KEY | winreg.KEY_READ, versionStr) |
136 winreg.KEY_WOW64_32KEY | winreg.KEY_READ, versionStr) |
137 for exePath in exePaths: |
137 for exePath in exePaths: |
138 executables.add(exePath) |
138 executables.add(exePath) |
397 project. |
397 project. |
398 """ |
398 """ |
399 project = e5App().getObject("Project") |
399 project = e5App().getObject("Project") |
400 majorVersionStr = project.getProjectLanguage() |
400 majorVersionStr = project.getProjectLanguage() |
401 if majorVersionStr == "Python3": |
401 if majorVersionStr == "Python3": |
402 executables = [f for f in exePy3 if |
402 executables = [f for f in exePy3 if |
403 f.endswith(("pyinstaller", "pyinstaller.exe"))] |
403 f.endswith(("pyinstaller", "pyinstaller.exe"))] |
404 else: |
404 else: |
405 executables = [f for f in exePy2 if |
405 executables = [f for f in exePy2 if |
406 f.endswith(("pyinstaller", "pyinstaller.exe"))] |
406 f.endswith(("pyinstaller", "pyinstaller.exe"))] |
407 if not executables: |
407 if not executables: |
408 E5MessageBox.critical( |
408 E5MessageBox.critical( |
409 self.__ui, |
409 self.__ui, |
410 self.tr("pyinstaller"), |
410 self.tr("pyinstaller"), |
420 dlg = PyInstallerConfigDialog(project, executables, params, |
420 dlg = PyInstallerConfigDialog(project, executables, params, |
421 mode="installer") |
421 mode="installer") |
422 if dlg.exec_() == QDialog.Accepted: |
422 if dlg.exec_() == QDialog.Accepted: |
423 args, params = dlg.generateParameters() |
423 args, params = dlg.generateParameters() |
424 project.setData('PACKAGERSPARMS', "PYINSTALLER", params) |
424 project.setData('PACKAGERSPARMS', "PYINSTALLER", params) |
|
425 |
|
426 # TODO: implement pyinstaller |
|
427 return |
425 |
428 |
426 # now do the call |
429 # now do the call |
427 from PyInstaller.PyInstallerExecDialog import PyInstallerExecDialog |
430 from PyInstaller.PyInstallerExecDialog import PyInstallerExecDialog |
428 dia = PyInstallerExecDialog("pyinstaller") |
431 dia = PyInstallerExecDialog("pyinstaller") |
429 dia.show() |
432 dia.show() |
430 res = dia.start(args, params, project.getProjectPath(), |
433 res = dia.start(args, params, project.getProjectPath(), |
431 project.getMainScript()) |
434 project.getMainScript()) |
432 if res: |
435 if res: |
433 dia.exec_() |
436 dia.exec_() |
434 # TODO: implement pyinstaller |
|
435 |
437 |
436 @pyqtSlot() |
438 @pyqtSlot() |
437 def __pyiMakeSpec(self): |
439 def __pyiMakeSpec(self): |
438 """ |
440 """ |
439 Private slot to execute the pyi-makespec command for the current |
441 Private slot to execute the pyi-makespec command for the current |
440 project to generate a spec file to be used by pyinstaller. |
442 project to generate a spec file to be used by pyinstaller. |
441 """ |
443 """ |
442 project = e5App().getObject("Project") |
444 project = e5App().getObject("Project") |
443 majorVersionStr = project.getProjectLanguage() |
445 majorVersionStr = project.getProjectLanguage() |
444 if majorVersionStr == "Python3": |
446 if majorVersionStr == "Python3": |
445 executables = [f for f in exePy3 if |
447 executables = [f for f in exePy3 if |
446 f.endswith(("pyi-makespec", "pyi-makespec.exe"))] |
448 f.endswith(("pyi-makespec", "pyi-makespec.exe"))] |
447 else: |
449 else: |
448 executables = [f for f in exePy2 if |
450 executables = [f for f in exePy2 if |
449 f.endswith(("pyi-makespec", "pyi-makespec.exe"))] |
451 f.endswith(("pyi-makespec", "pyi-makespec.exe"))] |
450 if not executables: |
452 if not executables: |
451 E5MessageBox.critical( |
453 E5MessageBox.critical( |
452 self.__ui, |
454 self.__ui, |
453 self.tr("pyi-makespec"), |
455 self.tr("pyi-makespec"), |