Plugins/PluginTabnanny.py

changeset 55
b5c84934de9c
parent 53
c3eb7cc1ff8b
child 398
5b5636320dca
child 792
a13346916170
equal deleted inserted replaced
54:31463df17fd5 55:b5c84934de9c
9 9
10 import os 10 import os
11 11
12 from PyQt4.QtCore import QObject, SIGNAL 12 from PyQt4.QtCore import QObject, SIGNAL
13 13
14 from E4Gui.E4Application import e5App 14 from E5Gui.E5Application import e5App
15 15
16 from E4Gui.E4Action import E4Action 16 from E5Gui.E5Action import E5Action
17 17
18 from CheckerPlugins.Tabnanny.TabnannyDialog import TabnannyDialog 18 from CheckerPlugins.Tabnanny.TabnannyDialog import TabnannyDialog
19 19
20 import Preferences 20 import Preferences
21 21
70 70
71 @return tuple of None and activation status (boolean) 71 @return tuple of None and activation status (boolean)
72 """ 72 """
73 menu = e5App().getObject("Project").getMenu("Checks") 73 menu = e5App().getObject("Project").getMenu("Checks")
74 if menu: 74 if menu:
75 self.__projectAct = E4Action(self.trUtf8('Check Indentations'), 75 self.__projectAct = E5Action(self.trUtf8('Check Indentations'),
76 self.trUtf8('&Indentations...'), 0, 0, 76 self.trUtf8('&Indentations...'), 0, 0,
77 self,'project_check_indentations') 77 self,'project_check_indentations')
78 self.__projectAct.setStatusTip(\ 78 self.__projectAct.setStatusTip(\
79 self.trUtf8('Check indentations using tabnanny.')) 79 self.trUtf8('Check indentations using tabnanny.'))
80 self.__projectAct.setWhatsThis(self.trUtf8( 80 self.__projectAct.setWhatsThis(self.trUtf8(
81 """<b>Check Indentations...</b>""" 81 """<b>Check Indentations...</b>"""
82 """<p>This checks Python files""" 82 """<p>This checks Python files"""
83 """ for bad indentations using tabnanny.</p>""" 83 """ for bad indentations using tabnanny.</p>"""
84 )) 84 ))
85 self.connect(self.__projectAct, SIGNAL('triggered()'), self.__projectTabnanny) 85 self.connect(self.__projectAct, SIGNAL('triggered()'), self.__projectTabnanny)
86 e5App().getObject("Project").addE4Actions([self.__projectAct]) 86 e5App().getObject("Project").addE5Actions([self.__projectAct])
87 menu.addAction(self.__projectAct) 87 menu.addAction(self.__projectAct)
88 88
89 self.__editorAct = E4Action(self.trUtf8('Check Indentations'), 89 self.__editorAct = E5Action(self.trUtf8('Check Indentations'),
90 self.trUtf8('&Indentations...'), 0, 0, 90 self.trUtf8('&Indentations...'), 0, 0,
91 self, "") 91 self, "")
92 self.__editorAct.setWhatsThis(self.trUtf8( 92 self.__editorAct.setWhatsThis(self.trUtf8(
93 """<b>Check Indentations...</b>""" 93 """<b>Check Indentations...</b>"""
94 """<p>This checks Python files""" 94 """<p>This checks Python files"""
161 """ 161 """
162 if menuName == "Checks" and \ 162 if menuName == "Checks" and \
163 e5App().getObject("Project").getProjectLanguage() == "Python3": 163 e5App().getObject("Project").getProjectLanguage() == "Python3":
164 self.__projectBrowserMenu = menu 164 self.__projectBrowserMenu = menu
165 if self.__projectBrowserAct is None: 165 if self.__projectBrowserAct is None:
166 self.__projectBrowserAct = E4Action(self.trUtf8('Check Indentations'), 166 self.__projectBrowserAct = E5Action(self.trUtf8('Check Indentations'),
167 self.trUtf8('&Indentations...'), 0, 0, 167 self.trUtf8('&Indentations...'), 0, 0,
168 self, "") 168 self, "")
169 self.__projectBrowserAct.setWhatsThis(self.trUtf8( 169 self.__projectBrowserAct.setWhatsThis(self.trUtf8(
170 """<b>Check Indentations...</b>""" 170 """<b>Check Indentations...</b>"""
171 """<p>This checks Python files""" 171 """<p>This checks Python files"""

eric ide

mercurial