PluginPyInstaller.py

branch
eric7
changeset 56
02709629940d
parent 55
3794f1ca53af
child 58
8bfeb70bcdc3
equal deleted inserted replaced
55:3794f1ca53af 56:02709629940d
25 # imports for eric < 23.1 25 # imports for eric < 23.1
26 from eric7.Globals import isWindowsPlatform 26 from eric7.Globals import isWindowsPlatform
27 from eric7.Utilities import getEnvironmentEntry 27 from eric7.Utilities import getEnvironmentEntry
28 28
29 # Start-Of-Header 29 # Start-Of-Header
30 name = "PyInstaller Plugin" 30 __header__ = {
31 author = "Detlev Offenbach <detlev@die-offenbachs.de>" 31 "name": "PyInstaller Plugin",
32 autoactivate = True 32 "author": "Detlev Offenbach <detlev@die-offenbachs.de>",
33 deactivateable = True 33 "autoactivate": True,
34 version = "10.2.0" 34 "deactivateable": True,
35 className = "PyInstallerPlugin" 35 "version": "10.3.0",
36 packageName = "PyInstallerInterface" 36 "className": "PyInstallerPlugin",
37 shortDescription = "Show dialogs to configure and execute PyInstaller." 37 "packageName": "PyInstallerInterface",
38 longDescription = ( 38 "shortDescription": "Show dialogs to configure and execute PyInstaller.",
39 """This plug-in implements dialogs to configure and execute PyInstaller""" 39 "longDescription": (
40 """ for an eric project. PyInstaller must be available or must be""" 40 "This plug-in implements dialogs to configure and execute PyInstaller"
41 """ installed via 'pip install PyInstaller'.""" 41 " for an eric project. PyInstaller must be available or must be"
42 ) 42 " installed via 'pip install PyInstaller'."
43 needsRestart = False 43 ),
44 pyqtApi = 2 44 "needsRestart": False,
45 "hasCompiledForms": True,
46 "pyqtApi": 2,
47 }
45 # End-Of-Header 48 # End-Of-Header
46 49
47 error = "" 50 error = ""
48 51
49 exePy3 = [] 52 exePy3 = []
455 if not project.checkAllScriptsDirty(reportSyntaxErrors=True): 458 if not project.checkAllScriptsDirty(reportSyntaxErrors=True):
456 return 459 return
457 460
458 params = project.getData("PACKAGERSPARMS", "PYINSTALLER") 461 params = project.getData("PACKAGERSPARMS", "PYINSTALLER")
459 dlg = PyInstallerConfigDialog( 462 dlg = PyInstallerConfigDialog(
460 project, executables, params, mode="installer" 463 project, executables, params, mode="installer", parent=self.__ui
461 ) 464 )
462 if dlg.exec() == QDialog.DialogCode.Accepted: 465 if dlg.exec() == QDialog.DialogCode.Accepted:
463 args, params, script = dlg.generateParameters() 466 args, params, script = dlg.generateParameters()
464 project.setData("PACKAGERSPARMS", "PYINSTALLER", params) 467 project.setData("PACKAGERSPARMS", "PYINSTALLER", params)
465 468
466 # now do the call 469 # now do the call
467 dia = PyInstallerExecDialog("pyinstaller") 470 dia = PyInstallerExecDialog("pyinstaller", parent=self.__ui)
468 dia.show() 471 dia.show()
469 res = dia.start(args, project, script) 472 res = dia.start(args, project, script)
470 if res: 473 if res:
471 dia.exec() 474 dia.exec()
472 475
496 # check if all files saved and errorfree before continue 499 # check if all files saved and errorfree before continue
497 if not project.checkAllScriptsDirty(reportSyntaxErrors=True): 500 if not project.checkAllScriptsDirty(reportSyntaxErrors=True):
498 return 501 return
499 502
500 params = project.getData("PACKAGERSPARMS", "PYINSTALLER") 503 params = project.getData("PACKAGERSPARMS", "PYINSTALLER")
501 dlg = PyInstallerConfigDialog(project, executables, params, mode="spec") 504 dlg = PyInstallerConfigDialog(
505 project, executables, params, mode="spec", parent=self.__ui
506 )
502 if dlg.exec() == QDialog.DialogCode.Accepted: 507 if dlg.exec() == QDialog.DialogCode.Accepted:
503 args, params, script = dlg.generateParameters() 508 args, params, script = dlg.generateParameters()
504 project.setData("PACKAGERSPARMS", "PYINSTALLER", params) 509 project.setData("PACKAGERSPARMS", "PYINSTALLER", params)
505 510
506 # now do the call 511 # now do the call
507 dia = PyInstallerExecDialog("pyinstaller") 512 dia = PyInstallerExecDialog("pyi-makespec", parent=self.__ui)
508 dia.show() 513 dia.show()
509 res = dia.start(args, project, script) 514 res = dia.start(args, project, script)
510 if res: 515 if res:
511 dia.exec() 516 dia.exec()
512 517
519 PyInstallerCleanupDialog, 524 PyInstallerCleanupDialog,
520 ) 525 )
521 526
522 project = ericApp().getObject("Project") 527 project = ericApp().getObject("Project")
523 528
524 dlg = PyInstallerCleanupDialog() 529 dlg = PyInstallerCleanupDialog(parent=self.__ui)
525 if dlg.exec() == QDialog.DialogCode.Accepted: 530 if dlg.exec() == QDialog.DialogCode.Accepted:
526 removeDirs = dlg.getDirectories() 531 removeDirs = dlg.getDirectories()
527 for directory in removeDirs: 532 for directory in removeDirs:
528 rd = os.path.join(project.getProjectPath(), directory) 533 rd = os.path.join(project.getProjectPath(), directory)
529 shutil.rmtree(rd, ignore_errors=True) 534 shutil.rmtree(rd, ignore_errors=True)

eric ide

mercurial