From: Renaud Barate Date: Tue, 26 Apr 2011 15:28:09 +0000 (+0000) Subject: Added a test for PyQt version X-Git-Tag: LOGILAB~322 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=9034d6ab195bae60d766e2187bbc40fa3bc1b7b8;p=tools%2Feficas.git Added a test for PyQt version --- diff --git a/InterfaceQT4/eficas_go.py b/InterfaceQT4/eficas_go.py index 6f3e2f92..d385fc0f 100644 --- a/InterfaceQT4/eficas_go.py +++ b/InterfaceQT4/eficas_go.py @@ -24,6 +24,27 @@ """ # Modules Python import sys + +# Test PyQt version +min_version_number_str = "4.4.2" +min_version_number = 0x040402 +version_number_str = "0" +version_number = 0 +try: + from PyQt4 import pyqtconfig + conf = pyqtconfig.Configuration() + version_number_str = conf.pyqt_version_str + version_number = conf.pyqt_version +except: + sys.stderr.write("Error: PyQt4 not found (Eficas needs PyQt4 version %s or greater to run).\n" % + min_version_number_str) + sys.exit(1) +if version_number < min_version_number: + sys.stderr.write("Error: Eficas needs PyQt4 version %s or greater to run " + "(installed version is %s).\n" % + (min_version_number_str, version_number_str)) + sys.exit(1) + from PyQt4.QtGui import * from Editeur import import_code