Plugins/PluginTabnanny.py

changeset 3036
30c81c9e88b8
parent 3034
7ce719013078
child 3060
5883ce99ee12
child 3160
209a07d7e401
equal deleted inserted replaced
3035:36e9f388958b 3036:30c81c9e88b8
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)

eric ide

mercurial