Utilities/__init__.py

changeset 565
21191e634b47
parent 432
497e188ee86e
child 682
91114a975eda
--- a/Utilities/__init__.py	Sat Sep 04 19:51:48 2010 +0200
+++ b/Utilities/__init__.py	Sun Sep 05 13:36:40 2010 +0200
@@ -1198,6 +1198,58 @@
     
     return infoStr
 
+def checkBlacklistedVersions():
+    """
+    Module functions to check for blacklisted versions of the prerequisites.
+    
+    @return flag indicating good versions were found (boolean)
+    """
+    from install import BlackLists
+    
+    # check version of sip
+    try:
+        import sipconfig
+        sipVersion = sipconfig.Configuration().sip_version_str
+        # always assume, that snapshots are good
+        if "snapshot" not in sipVersion:
+            # check for blacklisted versions
+            for vers in BlackLists["sip"]:
+                if vers == sipVersion:
+                    print('Sorry, sip version {0} is not compatible with eric5.'\
+                          .format(vers))
+                    print('Please install another version.')
+                    return False
+    except ImportError:
+        pass
+    
+    # check version of PyQt
+    from PyQt4.QtCore import PYQT_VERSION_STR
+    pyqtVersion = PYQT_VERSION_STR
+    # always assume, that snapshots are good
+    if "snapshot" not in pyqtVersion:
+        # check for blacklisted versions
+        for vers in BlackLists["PyQt4"]:
+            if vers == pyqtVersion:
+                print('Sorry, PyQt4 version {0} is not compatible with eric5.'\
+                      .format(vers))
+                print('Please install another version.')
+                return False
+    
+    # check version of QScintilla
+    from PyQt4.Qsci import QSCINTILLA_VERSION_STR
+    scintillaVersion = QSCINTILLA_VERSION_STR
+    # always assume, that snapshots are new enough
+    if "snapshot" not in scintillaVersion:
+        # check for blacklisted versions
+        for vers in BlackLists["QScintilla2"]:
+            if vers == scintillaVersion:
+                print('Sorry, QScintilla2 version {0} is not compatible with eric5.'\
+                      .format(vers))
+                print('Please install another version.')
+                return False
+    
+    return True
+
 ################################################################################
 # password handling functions below
 ################################################################################

eric ide

mercurial