Plugins/PluginTabnanny.py

branch
Py2 comp.
changeset 3058
0a02c433f52d
parent 3057
10516539f238
parent 3022
57179e4cdadd
child 3060
5883ce99ee12
equal deleted inserted replaced
3057:10516539f238 3058:0a02c433f52d
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 Indentations'), 76 self.__projectAct = E5Action(
77 self.trUtf8('&Indentations...'), 0, 0, 77 self.trUtf8('Check Indentations'),
78 self, 'project_check_indentations') 78 self.trUtf8('&Indentations...'), 0, 0,
79 self, 'project_check_indentations')
79 self.__projectAct.setStatusTip( 80 self.__projectAct.setStatusTip(
80 self.trUtf8('Check indentations using tabnanny.')) 81 self.trUtf8('Check indentations using tabnanny.'))
81 self.__projectAct.setWhatsThis(self.trUtf8( 82 self.__projectAct.setWhatsThis(self.trUtf8(
82 """<b>Check Indentations...</b>""" 83 """<b>Check Indentations...</b>"""
83 """<p>This checks Python files""" 84 """<p>This checks Python files"""
85 )) 86 ))
86 self.__projectAct.triggered[()].connect(self.__projectTabnanny) 87 self.__projectAct.triggered[()].connect(self.__projectTabnanny)
87 e5App().getObject("Project").addE5Actions([self.__projectAct]) 88 e5App().getObject("Project").addE5Actions([self.__projectAct])
88 menu.addAction(self.__projectAct) 89 menu.addAction(self.__projectAct)
89 90
90 self.__editorAct = E5Action(self.trUtf8('Check Indentations'), 91 self.__editorAct = E5Action(
91 self.trUtf8('&Indentations...'), 0, 0, 92 self.trUtf8('Check Indentations'),
92 self, "") 93 self.trUtf8('&Indentations...'), 0, 0,
94 self, "")
93 self.__editorAct.setWhatsThis(self.trUtf8( 95 self.__editorAct.setWhatsThis(self.trUtf8(
94 """<b>Check Indentations...</b>""" 96 """<b>Check Indentations...</b>"""
95 """<p>This checks Python files""" 97 """<p>This checks Python files"""
96 """ for bad indentations using tabnanny.</p>""" 98 """ for bad indentations using tabnanny.</p>"""
97 )) 99 ))
186 """ 188 """
187 project = e5App().getObject("Project") 189 project = e5App().getObject("Project")
188 project.saveAllScripts() 190 project.saveAllScripts()
189 ppath = project.getProjectPath() 191 ppath = project.getProjectPath()
190 files = [os.path.join(ppath, file) \ 192 files = [os.path.join(ppath, file) \
191 for file in project.pdata["SOURCES"] \ 193 for file in project.pdata["SOURCES"] \
192 if file.endswith( 194 if file.endswith(
193 tuple(Preferences.getPython("Python3Extensions")) + 195 tuple(Preferences.getPython("Python3Extensions")) +
194 tuple(Preferences.getPython("PythonExtensions")))] 196 tuple(Preferences.getPython("PythonExtensions")))]
195 197
196 from CheckerPlugins.Tabnanny.TabnannyDialog import TabnannyDialog 198 from CheckerPlugins.Tabnanny.TabnannyDialog import TabnannyDialog
197 self.__projectTabnannyDialog = TabnannyDialog() 199 self.__projectTabnannyDialog = TabnannyDialog()

eric ide

mercurial