Project/Project.py

changeset 1491
985c5abc8226
parent 1239
697757468865
child 1509
c0b5e693b0eb
--- a/Project/Project.py	Wed Dec 14 19:57:54 2011 +0100
+++ b/Project/Project.py	Sat Dec 17 15:19:45 2011 +0100
@@ -2647,6 +2647,30 @@
         """
         return self.pdata["PROGLANGUAGE"][0]
         
+    def isPy3Project(self):
+        """
+        Public method to check, if this project is a Python3 project.
+        
+        @return flag indicating a Python3 project (boolean)
+        """
+        return self.pdata["PROGLANGUAGE"][0] == "Python3"
+        
+    def isPy2Project(self):
+        """
+        Public method to check, if this project is a Python2 project.
+        
+        @return flag indicating a Python2 project (boolean)
+        """
+        return self.pdata["PROGLANGUAGE"][0] in ["Python", "Python2"]
+        
+    def isRubyProject(self):
+        """
+        Public method to check, if this project is a Ruby project.
+        
+        @return flag indicating a Ruby project (boolean)
+        """
+        return self.pdata["PROGLANGUAGE"][0] == "Ruby"
+        
     def getProjectSpellLanguage(self):
         """
         Public method to get the project's programming language.
@@ -3871,7 +3895,7 @@
                 os.path.isfile("{0}.profile".format(basename)) or \
                 os.path.isfile("{0}.profile".format(tbasename)))
             self.codeCoverageAct.setEnabled(
-                self.pdata["PROGLANGUAGE"][0] == "Python3" and \
+                self.isPy3Project() and \
                 (os.path.isfile("{0}.coverage".format(basename)) or \
                  os.path.isfile("{0}.coverage".format(tbasename))))
         else:

eric ide

mercurial