PluginProjectPyramid.py

changeset 74
11587ae1122f
parent 71
8a78fab32c18
child 80
b39b70d147a9
diff -r 3b3e73b730f0 -r 11587ae1122f PluginProjectPyramid.py
--- a/PluginProjectPyramid.py	Sat Apr 26 17:12:15 2014 +0200
+++ b/PluginProjectPyramid.py	Fri Jul 11 19:01:33 2014 +0200
@@ -13,7 +13,7 @@
 import glob
 import fnmatch
 
-from PyQt4.QtCore import QCoreApplication, QObject, QTranslator
+from PyQt5.QtCore import QCoreApplication, QObject, QTranslator
 
 from E5Gui.E5Application import e5App
 
@@ -28,7 +28,7 @@
 author = "Detlev Offenbach <detlev@die-offenbachs.de>"
 autoactivate = True
 deactivateable = True
-version = "1.6.0"
+version = "2.0.0"
 className = "ProjectPyramidPlugin"
 packageName = "ProjectPyramid"
 shortDescription = "Project support for Pyramid projects."
@@ -156,18 +156,18 @@
     
     def __checkVersions(self):
         """
-        Private function to check that the eric5 version is ok.
+        Private function to check that the eric6 version is ok.
         
         @return flag indicating version is ok (boolean)
         """
         global error
         
-        if self.__ui.versionIsNewer('5.0.99', '20120101'):
+        if self.__ui.versionIsNewer('5.99.99', '20140701'):
             error = ""
         else:
-            error = self.trUtf8(
-                "eric5 version is too old, {0}, {1} or newer needed.")\
-                .format("5.1.0", "20120101")
+            error = self.tr(
+                "eric6 version is too old, {0}, {1} or newer needed.")\
+                .format("6.0.0", "20140701")
             return False
         
         return True
@@ -195,7 +195,7 @@
         if self.__supportedVariants:
             try:
                 self.__e5project.registerProjectType(
-                    "Pyramid", self.trUtf8("Pyramid"),
+                    "Pyramid", self.tr("Pyramid"),
                     self.fileTypesCallback,
                     lexerAssociationCallback=self.lexerAssociationCallback,
                     binaryTranslationsCallback=self.binaryTranslationsCallback,
@@ -203,7 +203,7 @@
             except TypeError:
                 # for backward compatibility
                 self.__e5project.registerProjectType(
-                    "Pyramid", self.trUtf8("Pyramid"),
+                    "Pyramid", self.tr("Pyramid"),
                     self.fileTypesCallback,
                     lexerAssociationCallback=self.lexerAssociationCallback,
                     binaryTranslationsCallback=self.binaryTranslationsCallback)
@@ -391,22 +391,12 @@
             # step 2: register again with new language settings
             self.__supportedVariants = supportedVariants
             if self.__supportedVariants:
-                try:
-                    self.__e5project.registerProjectType(
-                        "Pyramid",
-                        self.trUtf8("Pyramid"), self.fileTypesCallback,
-                        lexerAssociationCallback=self.lexerAssociationCallback,
-                        binaryTranslationsCallback=
-                        self.binaryTranslationsCallback,
-                        progLanguages=self.__supportedVariants[:])
-                except TypeError:
-                    # for backward compatibility
-                    self.__e5project.registerProjectType(
-                        "Pyramid",
-                        self.trUtf8("Pyramid"), self.fileTypesCallback,
-                        lexerAssociationCallback=self.lexerAssociationCallback,
-                        binaryTranslationsCallback=
-                        self.binaryTranslationsCallback)
+                self.__e5project.registerProjectType(
+                    "Pyramid",
+                    self.tr("Pyramid"), self.fileTypesCallback,
+                    lexerAssociationCallback=self.lexerAssociationCallback,
+                    binaryTranslationsCallback=self.binaryTranslationsCallback,
+                    progLanguages=self.__supportedVariants[:])
     
     def getMenu(self, name):
         """
@@ -427,7 +417,7 @@
         
         @return menu names (list of string)
         """
-        if self.__object is not None:        
+        if self.__object is not None:
             return list(self.__menus.keys())
         else:
             return []

eric ide

mercurial