install.py

changeset 5963
14522ec8cd08
parent 5810
12d917813110
child 5976
549918576245
equal deleted inserted replaced
5962:a339eed93b19 5963:14522ec8cd08
106 Exit the install script. 106 Exit the install script.
107 107
108 @param rcode result code to report back (integer) 108 @param rcode result code to report back (integer)
109 """ 109 """
110 global currDir 110 global currDir
111
112 print()
111 113
112 if sys.platform.startswith("win"): 114 if sys.platform.startswith("win"):
113 # different meaning of input between Py2 and Py3 115 # different meaning of input between Py2 and Py3
114 try: 116 try:
115 input("Press enter to continue...") 117 input("Press enter to continue...")
1190 print("Found QScintilla2") 1192 print("Found QScintilla2")
1191 1193
1192 if pyqtVariant == "PyQt4": 1194 if pyqtVariant == "PyQt4":
1193 impModulesList = [ 1195 impModulesList = [
1194 "PyQt4.QtGui", "PyQt4.QtNetwork", "PyQt4.QtSql", 1196 "PyQt4.QtGui", "PyQt4.QtNetwork", "PyQt4.QtSql",
1195 "PyQt4.QtSvg", 1197 "PyQt4.QtSvg", "PyQt4.QtWebKit",
1196 ] 1198 ]
1199 altModulesList = []
1197 else: 1200 else:
1198 impModulesList = [ 1201 impModulesList = [
1199 "PyQt5.QtGui", "PyQt5.QtNetwork", "PyQt5.QtPrintSupport", 1202 "PyQt5.QtGui", "PyQt5.QtNetwork", "PyQt5.QtPrintSupport",
1200 "PyQt5.QtSql", "PyQt5.QtSvg", "PyQt5.QtWidgets", 1203 "PyQt5.QtSql", "PyQt5.QtSvg", "PyQt5.QtWidgets",
1201 ] 1204 ]
1205 altModulesList = [
1206 ("PyQt5.QtWebEngineWidgets", "PyQt5.QtWebKitWidgets")
1207 ]
1208 # check mandatory modules
1202 modulesOK = True 1209 modulesOK = True
1203 for impModule in impModulesList: 1210 for impModule in impModulesList:
1204 name = impModule.split(".")[1] 1211 name = impModule.split(".")[1]
1205 try: 1212 try:
1206 __import__(impModule) 1213 __import__(impModule)
1209 print('Sorry, please install {0}.'.format(name)) 1216 print('Sorry, please install {0}.'.format(name))
1210 print('Error: {0}'.format(msg)) 1217 print('Error: {0}'.format(msg))
1211 modulesOK = False 1218 modulesOK = False
1212 if not modulesOK: 1219 if not modulesOK:
1213 exit(1) 1220 exit(1)
1221 # check mandatory modules with alternatives
1222 if altModulesList:
1223 altModulesOK = True
1224 for altModules in altModulesList:
1225 modulesOK = False
1226 for altModule in altModules:
1227 name = altModule.split(".")[1]
1228 try:
1229 __import__(altModule)
1230 print("Found", name)
1231 modulesOK = True
1232 break
1233 except ImportError:
1234 pass
1235 if not modulesOK:
1236 altModulesOK = False
1237 print('Sorry, please install {0}.'
1238 .format(" or ".join(altModulesList)))
1239 if not altModulesOK:
1240 exit(1)
1214 1241
1215 # determine the platform dependent black list 1242 # determine the platform dependent black list
1216 if sys.platform.startswith("win"): 1243 if sys.platform.startswith("win"):
1217 PlatformBlackLists = PlatformsBlackLists["windows"] 1244 PlatformBlackLists = PlatformsBlackLists["windows"]
1218 elif sys.platform.startswith("linux"): 1245 elif sys.platform.startswith("linux"):

eric ide

mercurial