49 sys.exec_prefix) |
49 sys.exec_prefix) |
50 |
50 |
51 # Define blacklisted versions of the prerequisites |
51 # Define blacklisted versions of the prerequisites |
52 BlackLists = { |
52 BlackLists = { |
53 "sip": ["4.11", "4.12.3"], |
53 "sip": ["4.11", "4.12.3"], |
54 "PyQt5": ["4.7.5"], |
54 "PyQt5": [], |
55 "QScintilla2": [], |
55 "QScintilla2": [], |
56 } |
56 } |
57 PlatformsBlackLists = { |
57 PlatformsBlackLists = { |
58 "windows": { |
58 "windows": { |
59 "sip": [], |
59 "sip": [], |
60 "PyQt5": ["4.9.2", "4.9.3"], |
60 "PyQt5": [], |
61 "QScintilla2": [], |
61 "QScintilla2": [], |
62 }, |
62 }, |
63 |
63 |
64 "linux": { |
64 "linux": { |
65 "sip": [], |
65 "sip": [], |
956 print('Error: {0}'.format(msg)) |
956 print('Error: {0}'.format(msg)) |
957 exit(1) |
957 exit(1) |
958 print("Found QScintilla2") |
958 print("Found QScintilla2") |
959 |
959 |
960 for impModule in [ |
960 for impModule in [ |
961 "PyQt5.QtGui", "PyQt5.QtNetwork", "PyQt5.QtSql", |
961 "PyQt5.QtGui", "PyQt5.QtNetwork", "PyQt4.QtPrintSupport", |
962 "PyQt5.QtSvg", "PyQt5.QtWebKit", |
962 "PyQt5.QtSql", "PyQt5.QtSvg", "PyQt5.QtWebKit", |
|
963 "PyQt5.QtWebKitWidgets", "PyQt5.QtWidgets", |
|
964 |
963 ]: |
965 ]: |
964 name = impModule.split(".")[1] |
966 name = impModule.split(".")[1] |
965 modulesOK = True |
967 modulesOK = True |
966 try: |
968 try: |
967 __import__(impModule) |
969 __import__(impModule) |
982 PlatformBlackLists = PlatformsBlackLists["mac"] |
984 PlatformBlackLists = PlatformsBlackLists["mac"] |
983 |
985 |
984 # check version of Qt |
986 # check version of Qt |
985 qtMajor = int(qVersion().split('.')[0]) |
987 qtMajor = int(qVersion().split('.')[0]) |
986 qtMinor = int(qVersion().split('.')[1]) |
988 qtMinor = int(qVersion().split('.')[1]) |
987 if qtMajor < 4 or (qtMajor == 4 and qtMinor < 6): |
989 if qtMajor < 5 or (qtMajor == 3 and qtMinor < 6): |
988 print('Sorry, you must have Qt version 4.6.0 or higher.') |
990 print('Sorry, you must have Qt version 5.3.0 or higher.') |
989 exit(2) |
991 exit(2) |
990 print("Qt Version: {0}".format(qVersion())) |
992 print("Qt Version: {0}".format(qVersion())) |
991 |
993 |
992 # check version of sip |
994 # check version of sip |
993 try: |
995 try: |
1026 pyqtVersion += '.0' |
1028 pyqtVersion += '.0' |
1027 (maj, min, pat) = pyqtVersion.split('.') |
1029 (maj, min, pat) = pyqtVersion.split('.') |
1028 maj = int(maj) |
1030 maj = int(maj) |
1029 min = int(min) |
1031 min = int(min) |
1030 pat = int(pat) |
1032 pat = int(pat) |
1031 if maj < 4 or (maj == 4 and min < 8): |
1033 if maj < 5 or (maj == 5 and min < 3): |
1032 print('Sorry, you must have PyQt 4.8.0 or higher or' |
1034 print('Sorry, you must have PyQt 5.3.0 or higher or' |
1033 ' a recent snapshot release.') |
1035 ' a recent snapshot release.') |
1034 exit(4) |
1036 exit(4) |
1035 # check for blacklisted versions |
1037 # check for blacklisted versions |
1036 for vers in BlackLists["PyQt5"] + PlatformBlackLists["PyQt5"]: |
1038 for vers in BlackLists["PyQt5"] + PlatformBlackLists["PyQt5"]: |
1037 if vers == pyqtVersion: |
1039 if vers == pyqtVersion: |
1050 scintillaVersion += '.0' |
1052 scintillaVersion += '.0' |
1051 (maj, min, pat) = scintillaVersion.split('.') |
1053 (maj, min, pat) = scintillaVersion.split('.') |
1052 maj = int(maj) |
1054 maj = int(maj) |
1053 min = int(min) |
1055 min = int(min) |
1054 pat = int(pat) |
1056 pat = int(pat) |
1055 if maj < 2 or (maj == 2 and min < 6): |
1057 if maj < 2 or (maj == 2 and min < 8): |
1056 print('Sorry, you must have QScintilla 2.6.0 or higher or' |
1058 print('Sorry, you must have QScintilla 2.8.0 or higher or' |
1057 ' a recent snapshot release.') |
1059 ' a recent snapshot release.') |
1058 exit(5) |
1060 exit(5) |
1059 # check for blacklisted versions |
1061 # check for blacklisted versions |
1060 for vers in BlackLists["QScintilla2"] + \ |
1062 for vers in BlackLists["QScintilla2"] + \ |
1061 PlatformBlackLists["QScintilla2"]: |
1063 PlatformBlackLists["QScintilla2"]: |