Plugins/PluginSyntaxChecker.py

changeset 3022
57179e4cdadd
parent 3006
66b769f458c9
child 3034
7ce719013078
child 3058
0a02c433f52d
equal deleted inserted replaced
3021:801289962f4e 3022:57179e4cdadd
69 69
70 @return tuple of None and activation status (boolean) 70 @return tuple of None and activation status (boolean)
71 """ 71 """
72 menu = e5App().getObject("Project").getMenu("Checks") 72 menu = e5App().getObject("Project").getMenu("Checks")
73 if menu: 73 if menu:
74 self.__projectAct = E5Action(self.trUtf8('Check Syntax'), 74 self.__projectAct = E5Action(
75 self.trUtf8('&Syntax...'), 0, 0, 75 self.trUtf8('Check Syntax'),
76 self, 'project_check_syntax') 76 self.trUtf8('&Syntax...'), 0, 0,
77 self, 'project_check_syntax')
77 self.__projectAct.setStatusTip( 78 self.__projectAct.setStatusTip(
78 self.trUtf8('Check syntax.')) 79 self.trUtf8('Check syntax.'))
79 self.__projectAct.setWhatsThis(self.trUtf8( 80 self.__projectAct.setWhatsThis(self.trUtf8(
80 """<b>Check Syntax...</b>""" 81 """<b>Check Syntax...</b>"""
81 """<p>This checks Python files for syntax errors.</p>""" 82 """<p>This checks Python files for syntax errors.</p>"""
82 )) 83 ))
83 self.__projectAct.triggered[()].connect(self.__projectSyntaxCheck) 84 self.__projectAct.triggered[()].connect(self.__projectSyntaxCheck)
84 e5App().getObject("Project").addE5Actions([self.__projectAct]) 85 e5App().getObject("Project").addE5Actions([self.__projectAct])
85 menu.addAction(self.__projectAct) 86 menu.addAction(self.__projectAct)
86 87
87 self.__editorAct = E5Action(self.trUtf8('Check Syntax'), 88 self.__editorAct = E5Action(
88 self.trUtf8('&Syntax...'), 0, 0, 89 self.trUtf8('Check Syntax'),
89 self, "") 90 self.trUtf8('&Syntax...'), 0, 0,
91 self, "")
90 self.__editorAct.setWhatsThis(self.trUtf8( 92 self.__editorAct.setWhatsThis(self.trUtf8(
91 """<b>Check Syntax...</b>""" 93 """<b>Check Syntax...</b>"""
92 """<p>This checks Python files for syntax errors.</p>""" 94 """<p>This checks Python files for syntax errors.</p>"""
93 )) 95 ))
94 self.__editorAct.triggered[()].connect(self.__editorSyntaxCheck) 96 self.__editorAct.triggered[()].connect(self.__editorSyntaxCheck)
181 """ 183 """
182 project = e5App().getObject("Project") 184 project = e5App().getObject("Project")
183 project.saveAllScripts() 185 project.saveAllScripts()
184 ppath = project.getProjectPath() 186 ppath = project.getProjectPath()
185 files = [os.path.join(ppath, file) \ 187 files = [os.path.join(ppath, file) \
186 for file in project.pdata["SOURCES"] \ 188 for file in project.pdata["SOURCES"] \
187 if file.endswith( 189 if file.endswith(
188 tuple(Preferences.getPython("Python3Extensions")) + 190 tuple(Preferences.getPython("Python3Extensions")) +
189 tuple(Preferences.getPython("PythonExtensions")))] 191 tuple(Preferences.getPython("PythonExtensions")))]
190 192
191 from CheckerPlugins.SyntaxChecker.SyntaxCheckerDialog import \ 193 from CheckerPlugins.SyntaxChecker.SyntaxCheckerDialog import \
192 SyntaxCheckerDialog 194 SyntaxCheckerDialog

eric ide

mercurial