Project/Project.py

changeset 2222
105f425944a2
parent 2193
fc37253e4dbd
child 2284
7812fbbc7d25
equal deleted inserted replaced
2221:f72f8b0478cb 2222:105f425944a2
2693 ) 2693 )
2694 return False 2694 return False
2695 else: 2695 else:
2696 return success 2696 return success
2697 2697
2698 def checkAllScriptsDirty(self, reportSyntaxErrors=False):
2699 """
2700 Public method to check all scripts belonging to the project for
2701 their dirty status.
2702
2703 @keyparam reportSyntaxErrors flag indicating special reporting
2704 for syntax errors (boolean)
2705 @return flag indicating success (boolean)
2706 """
2707 vm = e5App().getObject("ViewManager")
2708 success = True
2709 filesWithSyntaxErrors = 0
2710 for fn in vm.getOpenFilenames():
2711 rfn = self.getRelativePath(fn)
2712 if rfn in self.pdata["SOURCES"] or rfn in self.pdata["OTHERS"]:
2713 editor = vm.getOpenEditor(fn)
2714 success &= editor.checkDirty()
2715 if reportSyntaxErrors and editor.hasSyntaxErrors():
2716 filesWithSyntaxErrors += 1
2717
2718 if reportSyntaxErrors and filesWithSyntaxErrors > 0:
2719 E5MessageBox.critical(self.ui,
2720 self.trUtf8("Syntax errors detected"),
2721 self.trUtf8("""The project contains %n file(s) with syntax errors.""",
2722 "", filesWithSyntaxErrors)
2723 )
2724 return False
2725 else:
2726 return success
2727
2698 def getMainScript(self, normalized=False): 2728 def getMainScript(self, normalized=False):
2699 """ 2729 """
2700 Public method to return the main script filename. 2730 Public method to return the main script filename.
2701 2731
2702 @param normalized flag indicating a normalized filename is wanted (boolean) 2732 @param normalized flag indicating a normalized filename is wanted (boolean)

eric ide

mercurial