Plugins/PluginSyntaxChecker.py

changeset 945
8cd4d08fa9f6
parent 830
6caa4436dee2
child 954
a096fdc38f71
equal deleted inserted replaced
944:1b59c4ba121e 945:8cd4d08fa9f6
32 """ Syntax Checker is used to check Python source files for correct syntax.""" 32 """ Syntax Checker is used to check Python source files for correct syntax."""
33 pyqtApi = 2 33 pyqtApi = 2
34 # End-Of-Header 34 # End-Of-Header
35 35
36 error = "" 36 error = ""
37
37 38
38 class SyntaxCheckerPlugin(QObject): 39 class SyntaxCheckerPlugin(QObject):
39 """ 40 """
40 Class implementing the Syntax Checker plugin. 41 Class implementing the Syntax Checker plugin.
41 """ 42 """
131 132
132 self.__initialize() 133 self.__initialize()
133 134
134 def __projectShowMenu(self, menuName, menu): 135 def __projectShowMenu(self, menuName, menu):
135 """ 136 """
136 Private slot called, when the the project menu or a submenu is 137 Private slot called, when the the project menu or a submenu is
137 about to be shown. 138 about to be shown.
138 139
139 @param menuName name of the menu to be shown (string) 140 @param menuName name of the menu to be shown (string)
140 @param menu reference to the menu (QMenu) 141 @param menu reference to the menu (QMenu)
141 """ 142 """
144 e5App().getObject("Project").getProjectLanguage() in \ 145 e5App().getObject("Project").getProjectLanguage() in \
145 ["Python3", "Python2", "Python"]) 146 ["Python3", "Python2", "Python"])
146 147
147 def __projectBrowserShowMenu(self, menuName, menu): 148 def __projectBrowserShowMenu(self, menuName, menu):
148 """ 149 """
149 Private slot called, when the the project browser menu or a submenu is 150 Private slot called, when the the project browser menu or a submenu is
150 about to be shown. 151 about to be shown.
151 152
152 @param menuName name of the menu to be shown (string) 153 @param menuName name of the menu to be shown (string)
153 @param menu reference to the menu (QMenu) 154 @param menu reference to the menu (QMenu)
154 """ 155 """
224 except ValueError: 225 except ValueError:
225 pass 226 pass
226 227
227 def __editorShowMenu(self, menuName, menu, editor): 228 def __editorShowMenu(self, menuName, menu, editor):
228 """ 229 """
229 Private slot called, when the the editor context menu or a submenu is 230 Private slot called, when the the editor context menu or a submenu is
230 about to be shown. 231 about to be shown.
231 232
232 @param menuName name of the menu to be shown (string) 233 @param menuName name of the menu to be shown (string)
233 @param menu reference to the menu (QMenu) 234 @param menu reference to the menu (QMenu)
234 @param editor reference to the editor 235 @param editor reference to the editor
244 """ 245 """
245 editor = e5App().getObject("ViewManager").activeWindow() 246 editor = e5App().getObject("ViewManager").activeWindow()
246 if editor is not None: 247 if editor is not None:
247 self.__editorSyntaxCheckerDialog = SyntaxCheckerDialog() 248 self.__editorSyntaxCheckerDialog = SyntaxCheckerDialog()
248 self.__editorSyntaxCheckerDialog.show() 249 self.__editorSyntaxCheckerDialog.show()
249 self.__editorSyntaxCheckerDialog.start(editor.getFileName(), 250 self.__editorSyntaxCheckerDialog.start(editor.getFileName(),
250 editor.text()) 251 editor.text())

eric ide

mercurial