Project/Project.py

changeset 564
b3d966393ba9
parent 553
5af61623ae3c
child 570
43a680c5c8e6
equal deleted inserted replaced
563:e35d2cda9a74 564:b3d966393ba9
189 "Ruby" : ['.rb'], 189 "Ruby" : ['.rb'],
190 "Mixed" : ['.py', '.ptl', '.rb'] 190 "Mixed" : ['.py', '.ptl', '.rb']
191 } 191 }
192 192
193 self.dbgFilters = { 193 self.dbgFilters = {
194 "Python" : self.trUtf8(\ 194 "Python" : self.trUtf8(
195 "Python Files (*.py2);;" 195 "Python Files (*.py2);;"
196 "Python GUI Files (*.pyw2);;"), 196 "Python GUI Files (*.pyw2);;"),
197 "Python3" : self.trUtf8(\ 197 "Python3" : self.trUtf8(
198 "Python3 Files (*.py *.py3);;" 198 "Python3 Files (*.py *.py3);;"
199 "Python3 GUI Files (*.pyw *.pyw3);;"), 199 "Python3 GUI Files (*.pyw *.pyw3);;"),
200 "Ruby" : self.trUtf8("Ruby Files (*.rb);;"), 200 "Ruby" : self.trUtf8("Ruby Files (*.rb);;"),
201 } 201 }
202 202
506 def handlePreferencesChanged(self): 506 def handlePreferencesChanged(self):
507 """ 507 """
508 Public slot used to handle the preferencesChanged signal. 508 Public slot used to handle the preferencesChanged signal.
509 """ 509 """
510 if self.pudata["VCSSTATUSMONITORINTERVAL"]: 510 if self.pudata["VCSSTATUSMONITORINTERVAL"]:
511 self.setStatusMonitorInterval(\ 511 self.setStatusMonitorInterval(
512 self.pudata["VCSSTATUSMONITORINTERVAL"][0]) 512 self.pudata["VCSSTATUSMONITORINTERVAL"][0])
513 else: 513 else:
514 self.setStatusMonitorInterval(\ 514 self.setStatusMonitorInterval(
515 Preferences.getVCS("StatusMonitorInterval")) 515 Preferences.getVCS("StatusMonitorInterval"))
516 516
517 self.__model.preferencesChanged() 517 self.__model.preferencesChanged()
518 518
519 def setDirty(self, b): 519 def setDirty(self, b):
2005 """ 2005 """
2006 fn = self.getRelativePath(oldfn) 2006 fn = self.getRelativePath(oldfn)
2007 isSourceFile = fn in self.pdata["SOURCES"] 2007 isSourceFile = fn in self.pdata["SOURCES"]
2008 2008
2009 if newfn is None: 2009 if newfn is None:
2010 newfn = QFileDialog.getSaveFileName(\ 2010 newfn = QFileDialog.getSaveFileName(
2011 None, 2011 None,
2012 self.trUtf8("Rename file"), 2012 self.trUtf8("Rename file"),
2013 os.path.dirname(oldfn), 2013 os.path.dirname(oldfn),
2014 "", 2014 "",
2015 QFileDialog.Options(QFileDialog.DontConfirmOverwrite)) 2015 QFileDialog.Options(QFileDialog.DontConfirmOverwrite))
2370 if os.path.exists(os.path.join(self.ppath, indicator)): 2370 if os.path.exists(os.path.join(self.ppath, indicator)):
2371 if len(vcsData) > 1: 2371 if len(vcsData) > 1:
2372 vcsList = [] 2372 vcsList = []
2373 for vcsSystemStr, vcsSystemDisplay in vcsData: 2373 for vcsSystemStr, vcsSystemDisplay in vcsData:
2374 vcsList.append(vcsSystemDisplay) 2374 vcsList.append(vcsSystemDisplay)
2375 res, vcs_ok = QInputDialog.getItem(\ 2375 res, vcs_ok = QInputDialog.getItem(
2376 None, 2376 None,
2377 self.trUtf8("New Project"), 2377 self.trUtf8("New Project"),
2378 self.trUtf8("Select Version Control System"), 2378 self.trUtf8("Select Version Control System"),
2379 vcsList, 2379 vcsList,
2380 0, False) 2380 0, False)
2423 .getPluginDisplayStrings("version_control") 2423 .getPluginDisplayStrings("version_control")
2424 vcsSystemsDisplay = [self.trUtf8("None")] 2424 vcsSystemsDisplay = [self.trUtf8("None")]
2425 keys = sorted(vcsSystemsDict.keys()) 2425 keys = sorted(vcsSystemsDict.keys())
2426 for key in keys: 2426 for key in keys:
2427 vcsSystemsDisplay.append(vcsSystemsDict[key]) 2427 vcsSystemsDisplay.append(vcsSystemsDict[key])
2428 vcsSelected, ok = QInputDialog.getItem(\ 2428 vcsSelected, ok = QInputDialog.getItem(
2429 None, 2429 None,
2430 self.trUtf8("New Project"), 2430 self.trUtf8("New Project"),
2431 self.trUtf8("Select version control system for the project"), 2431 self.trUtf8("Select version control system for the project"),
2432 vcsSystemsDisplay, 2432 vcsSystemsDisplay,
2433 0, False) 2433 0, False)
2517 self.pdata["TRANSLATIONPATTERN"] = \ 2517 self.pdata["TRANSLATIONPATTERN"] = \
2518 [os.path.join(os.path.dirname(tslist[0]), 2518 [os.path.join(os.path.dirname(tslist[0]),
2519 "{0}_%language%{1}".format(os.path.basename(tslist[0]).split('_')[0], 2519 "{0}_%language%{1}".format(os.path.basename(tslist[0]).split('_')[0],
2520 os.path.splitext(tslist[0])[1]))] 2520 os.path.splitext(tslist[0])[1]))]
2521 else: 2521 else:
2522 pattern, ok = QInputDialog.getText(\ 2522 pattern, ok = QInputDialog.getText(
2523 None, 2523 None,
2524 self.trUtf8("Translation Pattern"), 2524 self.trUtf8("Translation Pattern"),
2525 self.trUtf8("Enter the path pattern for translation files " 2525 self.trUtf8("Enter the path pattern for translation files "
2526 "(use '%language%' in place of the language code):"), 2526 "(use '%language%' in place of the language code):"),
2527 QLineEdit.Normal, 2527 QLineEdit.Normal,
2631 self.vcs.vcsStatusMonitorData.connect(self.__model.changeVCSStates) 2631 self.vcs.vcsStatusMonitorData.connect(self.__model.changeVCSStates)
2632 self.vcs.vcsStatusMonitorStatus.connect(self.__statusMonitorStatus) 2632 self.vcs.vcsStatusMonitorStatus.connect(self.__statusMonitorStatus)
2633 self.reinitVCS.emit() 2633 self.reinitVCS.emit()
2634 2634
2635 if self.pudata["VCSSTATUSMONITORINTERVAL"]: 2635 if self.pudata["VCSSTATUSMONITORINTERVAL"]:
2636 self.setStatusMonitorInterval(\ 2636 self.setStatusMonitorInterval(
2637 self.pudata["VCSSTATUSMONITORINTERVAL"][0]) 2637 self.pudata["VCSSTATUSMONITORINTERVAL"][0])
2638 else: 2638 else:
2639 self.setStatusMonitorInterval(\ 2639 self.setStatusMonitorInterval(
2640 Preferences.getVCS("StatusMonitorInterval")) 2640 Preferences.getVCS("StatusMonitorInterval"))
2641 2641
2642 def __showFiletypeAssociations(self): 2642 def __showFiletypeAssociations(self):
2643 """ 2643 """
2644 Public slot to display the filetype association dialog. 2644 Public slot to display the filetype association dialog.
2692 """ 2692 """
2693 if not self.checkDirty(): 2693 if not self.checkDirty():
2694 return 2694 return
2695 2695
2696 if fn is None: 2696 if fn is None:
2697 fn = QFileDialog.getOpenFileName(\ 2697 fn = QFileDialog.getOpenFileName(
2698 self.parent(), 2698 self.parent(),
2699 self.trUtf8("Open project"), 2699 self.trUtf8("Open project"),
2700 "", 2700 "",
2701 self.trUtf8("Project Files (*.e4p *.e4pz)")) 2701 self.trUtf8("Project Files (*.e4p *.e4pz)"))
2702 2702
2737 if len(vcsData) > 1: 2737 if len(vcsData) > 1:
2738 vcsList = [] 2738 vcsList = []
2739 for vcsSystemStr, vcsSystemDisplay in vcsData: 2739 for vcsSystemStr, vcsSystemDisplay in vcsData:
2740 vcsList.append(vcsSystemDisplay) 2740 vcsList.append(vcsSystemDisplay)
2741 QApplication.restoreOverrideCursor() 2741 QApplication.restoreOverrideCursor()
2742 res, vcs_ok = QInputDialog.getItem(\ 2742 res, vcs_ok = QInputDialog.getItem(
2743 None, 2743 None,
2744 self.trUtf8("New Project"), 2744 self.trUtf8("New Project"),
2745 self.trUtf8("Select Version Control System"), 2745 self.trUtf8("Select Version Control System"),
2746 vcsList, 2746 vcsList,
2747 0, False) 2747 0, False)
2856 """ 2856 """
2857 if Preferences.getProject("CompressedProjectFiles"): 2857 if Preferences.getProject("CompressedProjectFiles"):
2858 defaultFilter = self.trUtf8("Compressed Project Files (*.e4pz)") 2858 defaultFilter = self.trUtf8("Compressed Project Files (*.e4pz)")
2859 else: 2859 else:
2860 defaultFilter = self.trUtf8("Project Files (*.e4p)") 2860 defaultFilter = self.trUtf8("Project Files (*.e4p)")
2861 fn, selectedFilter = E5FileDialog.getSaveFileNameAndFilter(\ 2861 fn, selectedFilter = E5FileDialog.getSaveFileNameAndFilter(
2862 self.parent(), 2862 self.parent(),
2863 self.trUtf8("Save project as"), 2863 self.trUtf8("Save project as"),
2864 self.ppath, 2864 self.ppath,
2865 self.trUtf8("Project Files (*.e4p);;" 2865 self.trUtf8("Project Files (*.e4p);;"
2866 "Compressed Project Files (*.e4pz)"), 2866 "Compressed Project Files (*.e4pz)"),
3449 self.actions.append(self.userPropsAct) 3449 self.actions.append(self.userPropsAct)
3450 3450
3451 self.filetypesAct = E5Action(self.trUtf8('Filetype Associations'), 3451 self.filetypesAct = E5Action(self.trUtf8('Filetype Associations'),
3452 self.trUtf8('Filetype Associations...'), 0, 0, 3452 self.trUtf8('Filetype Associations...'), 0, 0,
3453 self, 'project_filetype_associatios') 3453 self, 'project_filetype_associatios')
3454 self.filetypesAct.setStatusTip(\ 3454 self.filetypesAct.setStatusTip(
3455 self.trUtf8('Show the project filetype associations')) 3455 self.trUtf8('Show the project filetype associations'))
3456 self.filetypesAct.setWhatsThis(self.trUtf8( 3456 self.filetypesAct.setWhatsThis(self.trUtf8(
3457 """<b>Filetype Associations...</b>""" 3457 """<b>Filetype Associations...</b>"""
3458 """<p>This shows a dialog to edit the filetype associations of the project.""" 3458 """<p>This shows a dialog to edit the filetype associations of the project."""
3459 """ These associations determine the type (source, form, interface""" 3459 """ These associations determine the type (source, form, interface"""
3464 self.actions.append(self.filetypesAct) 3464 self.actions.append(self.filetypesAct)
3465 3465
3466 self.lexersAct = E5Action(self.trUtf8('Lexer Associations'), 3466 self.lexersAct = E5Action(self.trUtf8('Lexer Associations'),
3467 self.trUtf8('Lexer Associations...'), 0, 0, 3467 self.trUtf8('Lexer Associations...'), 0, 0,
3468 self, 'project_lexer_associatios') 3468 self, 'project_lexer_associatios')
3469 self.lexersAct.setStatusTip(\ 3469 self.lexersAct.setStatusTip(
3470 self.trUtf8('Show the project lexer associations (overriding defaults)')) 3470 self.trUtf8('Show the project lexer associations (overriding defaults)'))
3471 self.lexersAct.setWhatsThis(self.trUtf8( 3471 self.lexersAct.setWhatsThis(self.trUtf8(
3472 """<b>Lexer Associations...</b>""" 3472 """<b>Lexer Associations...</b>"""
3473 """<p>This shows a dialog to edit the lexer associations of the project.""" 3473 """<p>This shows a dialog to edit the lexer associations of the project."""
3474 """ These associations override the global lexer associations. Lexers""" 3474 """ These associations override the global lexer associations. Lexers"""
3585 self.chkGrp = createActionGroup(self) 3585 self.chkGrp = createActionGroup(self)
3586 3586
3587 self.codeMetricsAct = E5Action(self.trUtf8('Code Metrics'), 3587 self.codeMetricsAct = E5Action(self.trUtf8('Code Metrics'),
3588 self.trUtf8('&Code Metrics...'), 0, 0, 3588 self.trUtf8('&Code Metrics...'), 0, 0,
3589 self.chkGrp,'project_code_metrics') 3589 self.chkGrp,'project_code_metrics')
3590 self.codeMetricsAct.setStatusTip(\ 3590 self.codeMetricsAct.setStatusTip(
3591 self.trUtf8('Show some code metrics for the project.')) 3591 self.trUtf8('Show some code metrics for the project.'))
3592 self.codeMetricsAct.setWhatsThis(self.trUtf8( 3592 self.codeMetricsAct.setWhatsThis(self.trUtf8(
3593 """<b>Code Metrics...</b>""" 3593 """<b>Code Metrics...</b>"""
3594 """<p>This shows some code metrics for all Python files in the project.</p>""" 3594 """<p>This shows some code metrics for all Python files in the project.</p>"""
3595 )) 3595 ))
3597 self.actions.append(self.codeMetricsAct) 3597 self.actions.append(self.codeMetricsAct)
3598 3598
3599 self.codeCoverageAct = E5Action(self.trUtf8('Python Code Coverage'), 3599 self.codeCoverageAct = E5Action(self.trUtf8('Python Code Coverage'),
3600 self.trUtf8('Code Co&verage...'), 0, 0, 3600 self.trUtf8('Code Co&verage...'), 0, 0,
3601 self.chkGrp,'project_code_coverage') 3601 self.chkGrp,'project_code_coverage')
3602 self.codeCoverageAct.setStatusTip(\ 3602 self.codeCoverageAct.setStatusTip(
3603 self.trUtf8('Show code coverage information for the project.')) 3603 self.trUtf8('Show code coverage information for the project.'))
3604 self.codeCoverageAct.setWhatsThis(self.trUtf8( 3604 self.codeCoverageAct.setWhatsThis(self.trUtf8(
3605 """<b>Code Coverage...</b>""" 3605 """<b>Code Coverage...</b>"""
3606 """<p>This shows the code coverage information for all Python files""" 3606 """<p>This shows the code coverage information for all Python files"""
3607 """ in the project.</p>""" 3607 """ in the project.</p>"""
3610 self.actions.append(self.codeCoverageAct) 3610 self.actions.append(self.codeCoverageAct)
3611 3611
3612 self.codeProfileAct = E5Action(self.trUtf8('Profile Data'), 3612 self.codeProfileAct = E5Action(self.trUtf8('Profile Data'),
3613 self.trUtf8('&Profile Data...'), 0, 0, 3613 self.trUtf8('&Profile Data...'), 0, 0,
3614 self.chkGrp,'project_profile_data') 3614 self.chkGrp,'project_profile_data')
3615 self.codeProfileAct.setStatusTip(\ 3615 self.codeProfileAct.setStatusTip(
3616 self.trUtf8('Show profiling data for the project.')) 3616 self.trUtf8('Show profiling data for the project.'))
3617 self.codeProfileAct.setWhatsThis(self.trUtf8( 3617 self.codeProfileAct.setWhatsThis(self.trUtf8(
3618 """<b>Profile Data...</b>""" 3618 """<b>Profile Data...</b>"""
3619 """<p>This shows the profiling data for the project.</p>""" 3619 """<p>This shows the profiling data for the project.</p>"""
3620 )) 3620 ))
3622 self.actions.append(self.codeProfileAct) 3622 self.actions.append(self.codeProfileAct)
3623 3623
3624 self.applicationDiagramAct = E5Action(self.trUtf8('Application Diagram'), 3624 self.applicationDiagramAct = E5Action(self.trUtf8('Application Diagram'),
3625 self.trUtf8('&Application Diagram...'), 0, 0, 3625 self.trUtf8('&Application Diagram...'), 0, 0,
3626 self.chkGrp,'project_application_diagram') 3626 self.chkGrp,'project_application_diagram')
3627 self.applicationDiagramAct.setStatusTip(\ 3627 self.applicationDiagramAct.setStatusTip(
3628 self.trUtf8('Show a diagram of the project.')) 3628 self.trUtf8('Show a diagram of the project.'))
3629 self.applicationDiagramAct.setWhatsThis(self.trUtf8( 3629 self.applicationDiagramAct.setWhatsThis(self.trUtf8(
3630 """<b>Application Diagram...</b>""" 3630 """<b>Application Diagram...</b>"""
3631 """<p>This shows a diagram of the project.</p>""" 3631 """<p>This shows a diagram of the project.</p>"""
3632 )) 3632 ))
3637 3637
3638 self.pluginPkgListAct = E5Action(self.trUtf8('Create Package List'), 3638 self.pluginPkgListAct = E5Action(self.trUtf8('Create Package List'),
3639 UI.PixmapCache.getIcon("pluginArchiveList.png"), 3639 UI.PixmapCache.getIcon("pluginArchiveList.png"),
3640 self.trUtf8('Create &Package List'), 0, 0, 3640 self.trUtf8('Create &Package List'), 0, 0,
3641 self.pluginGrp,'project_plugin_pkglist') 3641 self.pluginGrp,'project_plugin_pkglist')
3642 self.pluginPkgListAct.setStatusTip(\ 3642 self.pluginPkgListAct.setStatusTip(
3643 self.trUtf8('Create an initial PKGLIST file for an eric5 plugin.')) 3643 self.trUtf8('Create an initial PKGLIST file for an eric5 plugin.'))
3644 self.pluginPkgListAct.setWhatsThis(self.trUtf8( 3644 self.pluginPkgListAct.setWhatsThis(self.trUtf8(
3645 """<b>Create Package List</b>""" 3645 """<b>Create Package List</b>"""
3646 """<p>This creates an initial list of files to include in an eric5 """ 3646 """<p>This creates an initial list of files to include in an eric5 """
3647 """plugin archive. The list is created from the project file.</p>""" 3647 """plugin archive. The list is created from the project file.</p>"""
3651 3651
3652 self.pluginArchiveAct = E5Action(self.trUtf8('Create Plugin Archive'), 3652 self.pluginArchiveAct = E5Action(self.trUtf8('Create Plugin Archive'),
3653 UI.PixmapCache.getIcon("pluginArchive.png"), 3653 UI.PixmapCache.getIcon("pluginArchive.png"),
3654 self.trUtf8('Create Plugin &Archive'), 0, 0, 3654 self.trUtf8('Create Plugin &Archive'), 0, 0,
3655 self.pluginGrp,'project_plugin_archive') 3655 self.pluginGrp,'project_plugin_archive')
3656 self.pluginArchiveAct.setStatusTip(\ 3656 self.pluginArchiveAct.setStatusTip(
3657 self.trUtf8('Create an eric5 plugin archive file.')) 3657 self.trUtf8('Create an eric5 plugin archive file.'))
3658 self.pluginArchiveAct.setWhatsThis(self.trUtf8( 3658 self.pluginArchiveAct.setWhatsThis(self.trUtf8(
3659 """<b>Create Plugin Archive</b>""" 3659 """<b>Create Plugin Archive</b>"""
3660 """<p>This creates an eric5 plugin archive file using the list of files """ 3660 """<p>This creates an eric5 plugin archive file using the list of files """
3661 """given in the PKGLIST file. The archive name is built from the main """ 3661 """given in the PKGLIST file. The archive name is built from the main """
3666 3666
3667 self.pluginSArchiveAct = E5Action(self.trUtf8('Create Plugin Archive (Snapshot)'), 3667 self.pluginSArchiveAct = E5Action(self.trUtf8('Create Plugin Archive (Snapshot)'),
3668 UI.PixmapCache.getIcon("pluginArchiveSnapshot.png"), 3668 UI.PixmapCache.getIcon("pluginArchiveSnapshot.png"),
3669 self.trUtf8('Create Plugin Archive (&Snapshot)'), 0, 0, 3669 self.trUtf8('Create Plugin Archive (&Snapshot)'), 0, 0,
3670 self.pluginGrp,'project_plugin_sarchive') 3670 self.pluginGrp,'project_plugin_sarchive')
3671 self.pluginSArchiveAct.setStatusTip(\ 3671 self.pluginSArchiveAct.setStatusTip(
3672 self.trUtf8('Create an eric5 plugin archive file (snapshot release).')) 3672 self.trUtf8('Create an eric5 plugin archive file (snapshot release).'))
3673 self.pluginSArchiveAct.setWhatsThis(self.trUtf8( 3673 self.pluginSArchiveAct.setWhatsThis(self.trUtf8(
3674 """<b>Create Plugin Archive (Snapshot)</b>""" 3674 """<b>Create Plugin Archive (Snapshot)</b>"""
3675 """<p>This creates an eric5 plugin archive file using the list of files """ 3675 """<p>This creates an eric5 plugin archive file using the list of files """
3676 """given in the PKGLIST file. The archive name is built from the main """ 3676 """given in the PKGLIST file. The archive name is built from the main """
3864 for rp in self.recent: 3864 for rp in self.recent:
3865 if idx < 10: 3865 if idx < 10:
3866 formatStr = '&{0:d}. {1}' 3866 formatStr = '&{0:d}. {1}'
3867 else: 3867 else:
3868 formatStr = '{0:d}. {1}' 3868 formatStr = '{0:d}. {1}'
3869 act = self.recentMenu.addAction(\ 3869 act = self.recentMenu.addAction(
3870 formatStr.format(idx, 3870 formatStr.format(idx,
3871 Utilities.compactPath(rp, self.ui.maxMenuFilePathLen))) 3871 Utilities.compactPath(rp, self.ui.maxMenuFilePathLen)))
3872 act.setData(rp) 3872 act.setData(rp)
3873 act.setEnabled(QFileInfo(rp).exists()) 3873 act.setEnabled(QFileInfo(rp).exists())
3874 idx += 1 3874 idx += 1
4233 if os.path.isfile(tf): 4233 if os.path.isfile(tf):
4234 files.append(tf) 4234 files.append(tf)
4235 4235
4236 if files: 4236 if files:
4237 if len(files) > 1: 4237 if len(files) > 1:
4238 fn, ok = QInputDialog.getItem(\ 4238 fn, ok = QInputDialog.getItem(
4239 None, 4239 None,
4240 self.trUtf8("Code Coverage"), 4240 self.trUtf8("Code Coverage"),
4241 self.trUtf8("Please select a coverage file"), 4241 self.trUtf8("Please select a coverage file"),
4242 files, 4242 files,
4243 0, False) 4243 0, False)
4279 if os.path.isfile(tf): 4279 if os.path.isfile(tf):
4280 files.append(tf) 4280 files.append(tf)
4281 4281
4282 if files: 4282 if files:
4283 if len(files) > 1: 4283 if len(files) > 1:
4284 fn, ok = QInputDialog.getItem(\ 4284 fn, ok = QInputDialog.getItem(
4285 None, 4285 None,
4286 self.trUtf8("Profile Data"), 4286 self.trUtf8("Profile Data"),
4287 self.trUtf8("Please select a profile file"), 4287 self.trUtf8("Please select a profile file"),
4288 files, 4288 files,
4289 0, False) 4289 0, False)
4305 fn = self.getMainScript(True) 4305 fn = self.getMainScript(True)
4306 if fn is not None: 4306 if fn is not None:
4307 tfn = Utilities.getTestFileName(fn) 4307 tfn = Utilities.getTestFileName(fn)
4308 basename = os.path.splitext(fn)[0] 4308 basename = os.path.splitext(fn)[0]
4309 tbasename = os.path.splitext(tfn)[0] 4309 tbasename = os.path.splitext(tfn)[0]
4310 self.codeProfileAct.setEnabled(\ 4310 self.codeProfileAct.setEnabled(
4311 os.path.isfile("{0}.profile".format(basename)) or \ 4311 os.path.isfile("{0}.profile".format(basename)) or \
4312 os.path.isfile("{0}.profile".format(tbasename))) 4312 os.path.isfile("{0}.profile".format(tbasename)))
4313 self.codeCoverageAct.setEnabled(\ 4313 self.codeCoverageAct.setEnabled(
4314 self.pdata["PROGLANGUAGE"][0] == "Python3" and \ 4314 self.pdata["PROGLANGUAGE"][0] == "Python3" and \
4315 (os.path.isfile("{0}.coverage".format(basename)) or \ 4315 (os.path.isfile("{0}.coverage".format(basename)) or \
4316 os.path.isfile("{0}.coverage".format(tbasename)))) 4316 os.path.isfile("{0}.coverage".format(tbasename))))
4317 else: 4317 else:
4318 self.codeProfileAct.setEnabled(False) 4318 self.codeProfileAct.setEnabled(False)
4525 4525
4526 for name in names: 4526 for name in names:
4527 try: 4527 try:
4528 self.__createZipDirEntries(os.path.split(name)[0], archiveFile) 4528 self.__createZipDirEntries(os.path.split(name)[0], archiveFile)
4529 if snapshot and name == self.pdata["MAINSCRIPT"][0]: 4529 if snapshot and name == self.pdata["MAINSCRIPT"][0]:
4530 snapshotSource, version = self.__createSnapshotSource(\ 4530 snapshotSource, version = self.__createSnapshotSource(
4531 os.path.join(self.ppath, self.pdata["MAINSCRIPT"][0])) 4531 os.path.join(self.ppath, self.pdata["MAINSCRIPT"][0]))
4532 archiveFile.writestr(name, snapshotSource) 4532 archiveFile.writestr(name, snapshotSource)
4533 else: 4533 else:
4534 archiveFile.write(os.path.join(self.ppath, name), name) 4534 archiveFile.write(os.path.join(self.ppath, name), name)
4535 if name == self.pdata["MAINSCRIPT"][0]: 4535 if name == self.pdata["MAINSCRIPT"][0]:
4536 version = self.__pluginExtractVersion(\ 4536 version = self.__pluginExtractVersion(
4537 os.path.join(self.ppath, self.pdata["MAINSCRIPT"][0])) 4537 os.path.join(self.ppath, self.pdata["MAINSCRIPT"][0]))
4538 except OSError as why: 4538 except OSError as why:
4539 E5MessageBox.critical(self.ui, 4539 E5MessageBox.critical(self.ui,
4540 self.trUtf8("Create Plugin Archive"), 4540 self.trUtf8("Create Plugin Archive"),
4541 self.trUtf8("""<p>The file <b>{0}</b> could not be stored """ 4541 self.trUtf8("""<p>The file <b>{0}</b> could not be stored """

eric ide

mercurial