25 version = "5.4.0" |
25 version = "5.4.0" |
26 className = "TabnannyPlugin" |
26 className = "TabnannyPlugin" |
27 packageName = "__core__" |
27 packageName = "__core__" |
28 shortDescription = "Show the Tabnanny dialog." |
28 shortDescription = "Show the Tabnanny dialog." |
29 longDescription = """This plugin implements the Tabnanny dialog.""" \ |
29 longDescription = """This plugin implements the Tabnanny dialog.""" \ |
30 """ Tabnanny is used to check Python source files for correct indentations.""" |
30 """ Tabnanny is used to check Python source files for correct""" \ |
|
31 """ indentations.""" |
31 pyqtApi = 2 |
32 pyqtApi = 2 |
32 # End-Of-Header |
33 # End-Of-Header |
33 |
34 |
34 error = "" |
35 error = "" |
35 |
36 |
149 @param menu reference to the menu (QMenu) |
150 @param menu reference to the menu (QMenu) |
150 """ |
151 """ |
151 if menuName == "Checks" and self.__projectAct is not None: |
152 if menuName == "Checks" and self.__projectAct is not None: |
152 self.__projectAct.setEnabled( |
153 self.__projectAct.setEnabled( |
153 e5App().getObject("Project").getProjectLanguage() in |
154 e5App().getObject("Project").getProjectLanguage() in |
154 ["Python3", "Python2", "Python"]) |
155 ["Python3", "Python2", "Python"]) |
155 |
156 |
156 def __projectBrowserShowMenu(self, menuName, menu): |
157 def __projectBrowserShowMenu(self, menuName, menu): |
157 """ |
158 """ |
158 Private slot called, when the the project browser context menu or a |
159 Private slot called, when the the project browser context menu or a |
159 submenu is about to be shown. |
160 submenu is about to be shown. |
188 project.saveAllScripts() |
189 project.saveAllScripts() |
189 ppath = project.getProjectPath() |
190 ppath = project.getProjectPath() |
190 files = [os.path.join(ppath, file) |
191 files = [os.path.join(ppath, file) |
191 for file in project.pdata["SOURCES"] |
192 for file in project.pdata["SOURCES"] |
192 if file.endswith( |
193 if file.endswith( |
193 tuple(Preferences.getPython("Python3Extensions")) + |
194 tuple(Preferences.getPython("Python3Extensions")) + |
194 tuple(Preferences.getPython("PythonExtensions")))] |
195 tuple(Preferences.getPython("PythonExtensions")))] |
195 |
196 |
196 from CheckerPlugins.Tabnanny.TabnannyDialog import TabnannyDialog |
197 from CheckerPlugins.Tabnanny.TabnannyDialog import TabnannyDialog |
197 self.__projectTabnannyDialog = TabnannyDialog() |
198 self.__projectTabnannyDialog = TabnannyDialog() |
198 self.__projectTabnannyDialog.show() |
199 self.__projectTabnannyDialog.show() |
199 self.__projectTabnannyDialog.prepare(files, project) |
200 self.__projectTabnannyDialog.prepare(files, project) |