71 |
71 |
72 @return tuple of None and activation status (boolean) |
72 @return tuple of None and activation status (boolean) |
73 """ |
73 """ |
74 menu = e5App().getObject("Project").getMenu("Checks") |
74 menu = e5App().getObject("Project").getMenu("Checks") |
75 if menu: |
75 if menu: |
76 self.__projectAct = E5Action(self.trUtf8('Check Syntax'), |
76 self.__projectAct = E5Action( |
77 self.trUtf8('&Syntax...'), 0, 0, |
77 self.trUtf8('Check Syntax'), |
78 self, 'project_check_syntax') |
78 self.trUtf8('&Syntax...'), 0, 0, |
|
79 self, 'project_check_syntax') |
79 self.__projectAct.setStatusTip( |
80 self.__projectAct.setStatusTip( |
80 self.trUtf8('Check syntax.')) |
81 self.trUtf8('Check syntax.')) |
81 self.__projectAct.setWhatsThis(self.trUtf8( |
82 self.__projectAct.setWhatsThis(self.trUtf8( |
82 """<b>Check Syntax...</b>""" |
83 """<b>Check Syntax...</b>""" |
83 """<p>This checks Python files for syntax errors.</p>""" |
84 """<p>This checks Python files for syntax errors.</p>""" |
84 )) |
85 )) |
85 self.__projectAct.triggered[()].connect(self.__projectSyntaxCheck) |
86 self.__projectAct.triggered[()].connect(self.__projectSyntaxCheck) |
86 e5App().getObject("Project").addE5Actions([self.__projectAct]) |
87 e5App().getObject("Project").addE5Actions([self.__projectAct]) |
87 menu.addAction(self.__projectAct) |
88 menu.addAction(self.__projectAct) |
88 |
89 |
89 self.__editorAct = E5Action(self.trUtf8('Check Syntax'), |
90 self.__editorAct = E5Action( |
90 self.trUtf8('&Syntax...'), 0, 0, |
91 self.trUtf8('Check Syntax'), |
91 self, "") |
92 self.trUtf8('&Syntax...'), 0, 0, |
|
93 self, "") |
92 self.__editorAct.setWhatsThis(self.trUtf8( |
94 self.__editorAct.setWhatsThis(self.trUtf8( |
93 """<b>Check Syntax...</b>""" |
95 """<b>Check Syntax...</b>""" |
94 """<p>This checks Python files for syntax errors.</p>""" |
96 """<p>This checks Python files for syntax errors.</p>""" |
95 )) |
97 )) |
96 self.__editorAct.triggered[()].connect(self.__editorSyntaxCheck) |
98 self.__editorAct.triggered[()].connect(self.__editorSyntaxCheck) |
183 """ |
185 """ |
184 project = e5App().getObject("Project") |
186 project = e5App().getObject("Project") |
185 project.saveAllScripts() |
187 project.saveAllScripts() |
186 ppath = project.getProjectPath() |
188 ppath = project.getProjectPath() |
187 files = [os.path.join(ppath, file) \ |
189 files = [os.path.join(ppath, file) \ |
188 for file in project.pdata["SOURCES"] \ |
190 for file in project.pdata["SOURCES"] \ |
189 if file.endswith( |
191 if file.endswith( |
190 tuple(Preferences.getPython("Python3Extensions")) + |
192 tuple(Preferences.getPython("Python3Extensions")) + |
191 tuple(Preferences.getPython("PythonExtensions")))] |
193 tuple(Preferences.getPython("PythonExtensions")))] |
192 |
194 |
193 from CheckerPlugins.SyntaxChecker.SyntaxCheckerDialog import \ |
195 from CheckerPlugins.SyntaxChecker.SyntaxCheckerDialog import \ |
194 SyntaxCheckerDialog |
196 SyntaxCheckerDialog |