Plugins/PluginTabnanny.py

changeset 805
83ca4d1ff648
parent 791
9ec2ac20e54e
child 945
8cd4d08fa9f6
child 955
377efd9104a7
diff -r 3465556892de -r 83ca4d1ff648 Plugins/PluginTabnanny.py
--- a/Plugins/PluginTabnanny.py	Mon Jan 03 17:45:11 2011 +0100
+++ b/Plugins/PluginTabnanny.py	Tue Jan 04 17:37:48 2011 +0100
@@ -143,7 +143,8 @@
         """
         if menuName == "Checks" and self.__projectAct is not None:
             self.__projectAct.setEnabled(
-                e5App().getObject("Project").getProjectLanguage() == "Python3")
+                e5App().getObject("Project").getProjectLanguage() in \
+                    ["Python3", "Python2", "Python"])
     
     def __projectBrowserShowMenu(self, menuName, menu):
         """
@@ -154,7 +155,8 @@
         @param menu reference to the menu (QMenu)
         """
         if menuName == "Checks" and \
-           e5App().getObject("Project").getProjectLanguage() == "Python3":
+           e5App().getObject("Project").getProjectLanguage() in \
+                ["Python3", "Python2", "Python"]:
             self.__projectBrowserMenu = menu
             if self.__projectBrowserAct is None:
                 self.__projectBrowserAct = E5Action(self.trUtf8('Check Indentations'),
@@ -179,7 +181,8 @@
         ppath = project.getProjectPath()
         files = [os.path.join(ppath, file) \
             for file in project.pdata["SOURCES"] \
-                if file.endswith(tuple(Preferences.getPython("Python3Extensions")))]
+                if file.endswith(tuple(Preferences.getPython("Python3Extensions")) +
+                                 tuple(Preferences.getPython("PythonExtensions")))]
         
         self.__projectTabnannyDialog = TabnannyDialog()
         self.__projectTabnannyDialog.show()
@@ -236,7 +239,7 @@
         if menuName == "Checks":
             if not self.__editorAct in menu.actions():
                 menu.addAction(self.__editorAct)
-            self.__editorAct.setEnabled(editor.isPy3File())
+            self.__editorAct.setEnabled(editor.isPy3File() or editor.isPy2File())
     
     def __editorTabnanny(self):
         """

eric ide

mercurial