27
27
OTHER DEALINGS IN THE SOFTWARE.
31
31
__license__ = __doc__
33
def check_requirement(package, module_name, version_attr, required_str):
34
wng = "\n%s v%s or higher is required" % (package, required_str)
36
module = __import__(module_name)
38
return wng+" (not found!)"
40
if module_name.find('.'):
41
module = getattr(module, module_name.split('.')[1])
42
actual_str = getattr(module, version_attr)
43
actual = actual_str.split('.')
44
required = required_str.split('.')
45
if actual[0] < required[0] or \
46
(actual[0] == required[0] and actual[1] < required[1]):
47
return wng+" (found v%s)" % actual_str
51
def check_pyqt_qscintilla():
52
wng = check_requirement("PyQt", "PyQt4.QtCore", "PYQT_VERSION_STR", "4.4")
53
wng += check_requirement("QScintilla", "PyQt4.Qsci",
54
"QSCINTILLA_VERSION_STR", "2.2")
57
message = "Please check Spyder installation requirements:"+wng
61
Windows XP/Vista/7 users:
62
QScintilla2 is distributed together with PyQt4
63
(Python(x,y) plugin or official PyQt4 Windows installer)"""
65
# If Tkinter is installed (highly probable), showing an error pop-up
66
import Tkinter, tkMessageBox
69
tkMessageBox.showerror("Spyder", message)
72
raise ImportError, wng
74
check_pyqt_qscintilla()