PluginCxFreeze.py

branch
eric7
changeset 146
32c4e3d4465c
parent 145
c423d46df27e
child 147
908186813616
equal deleted inserted replaced
145:c423d46df27e 146:32c4e3d4465c
95 if isWindowsPlatform(): 95 if isWindowsPlatform():
96 # 96 #
97 # Windows 97 # Windows
98 # 98 #
99 try: 99 try:
100 import winreg 100 import winreg # noqa: I101, I103
101 except ImportError: 101 except ImportError:
102 import _winreg as winreg # __IGNORE_WARNING__ 102 import _winreg as winreg # __IGNORE_WARNING__
103 103
104 def getExePath(branch, access, versionStr): 104 def getExePath(branch, access, versionStr):
105 try: 105 try:
327 if self.__projectSeparator: 327 if self.__projectSeparator:
328 menu.removeAction(self.__projectSeparator) 328 menu.removeAction(self.__projectSeparator)
329 329
330 self.__initialize() 330 self.__initialize()
331 331
332 def __projectShowMenu(self, menuName, menu): 332 def __projectShowMenu(self, menuName, menu): # noqa: U100
333 """ 333 """
334 Private slot called, when the the project menu or a submenu is 334 Private slot called, when the the project menu or a submenu is
335 about to be shown. 335 about to be shown.
336 336
337 @param menuName name of the menu to be shown 337 @param menuName name of the menu to be shown
367 367
368 def __cxfreeze(self): 368 def __cxfreeze(self):
369 """ 369 """
370 Private slot to handle the cxfreeze execution. 370 Private slot to handle the cxfreeze execution.
371 """ 371 """
372 from CxFreeze.CxfreezeConfigDialog import CxfreezeConfigDialog
373 from CxFreeze.CxfreezeExecDialog import CxfreezeExecDialog
374
372 project = ericApp().getObject("Project") 375 project = ericApp().getObject("Project")
373 if not project.getMainScript(): 376 if not project.getMainScript():
374 # no main script defined 377 # no main script defined
375 EricMessageBox.critical( 378 EricMessageBox.critical(
376 self.__ui, 379 self.__ui,
395 398
396 # check if all files saved and errorfree before continue 399 # check if all files saved and errorfree before continue
397 if not project.checkAllScriptsDirty(reportSyntaxErrors=True): 400 if not project.checkAllScriptsDirty(reportSyntaxErrors=True):
398 return 401 return
399 402
400 from CxFreeze.CxfreezeConfigDialog import CxfreezeConfigDialog
401
402 parms = project.getData("PACKAGERSPARMS", "CXFREEZE") 403 parms = project.getData("PACKAGERSPARMS", "CXFREEZE")
403 dlg = CxfreezeConfigDialog(project, exe, parms) 404 dlg = CxfreezeConfigDialog(project, exe, parms)
404 if dlg.exec() == QDialog.DialogCode.Accepted: 405 if dlg.exec() == QDialog.DialogCode.Accepted:
405 args, parms = dlg.generateParameters() 406 args, parms = dlg.generateParameters()
406 project.setData("PACKAGERSPARMS", "CXFREEZE", parms) 407 project.setData("PACKAGERSPARMS", "CXFREEZE", parms)
407 408
408 # now do the call 409 # now do the call
409 from CxFreeze.CxfreezeExecDialog import CxfreezeExecDialog
410
411 dia = CxfreezeExecDialog("cxfreeze") 410 dia = CxfreezeExecDialog("cxfreeze")
412 dia.show() 411 dia.show()
413 res = dia.start(args, parms, project.ppath, project.getMainScript()) 412 res = dia.start(args, parms, project.ppath, project.getMainScript())
414 if res: 413 if res:
415 dia.exec() 414 dia.exec()
427 except ImportError: 426 except ImportError:
428 pipInstall(["cx-Freeze"]) 427 pipInstall(["cx-Freeze"])
429 428
430 429
431 # 430 #
432 # eflag: noqa = M801 431 # eflag: noqa = M801, U200

eric ide

mercurial