install.py

branch
maintenance
changeset 6004
548a9ba8c970
parent 5992
d184ca2d3a95
child 6048
82ad8ec9548c
equal deleted inserted replaced
5985:ab851fd69434 6004:548a9ba8c970
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...")
735 ['*.css']) 737 ['*.css'])
736 copyTree( 738 copyTree(
737 '{1}{0}Styles'.format(os.sep, sourceDir), cfg['ericStylesDir'], 739 '{1}{0}Styles'.format(os.sep, sourceDir), cfg['ericStylesDir'],
738 ['*.qss']) 740 ['*.qss'])
739 copyTree( 741 copyTree(
742 '{1}{0}Styles'.format(os.sep, sourceDir), cfg['ericStylesDir'],
743 ['*.e4h'])
744 copyTree(
740 '{1}{0}i18n'.format(os.sep, sourceDir), cfg['ericTranslationsDir'], 745 '{1}{0}i18n'.format(os.sep, sourceDir), cfg['ericTranslationsDir'],
741 ['*.qm']) 746 ['*.qm'])
742 copyTree( 747 copyTree(
743 '{1}{0}icons'.format(os.sep, sourceDir), cfg['ericIconDir'], 748 '{1}{0}icons'.format(os.sep, sourceDir), cfg['ericIconDir'],
744 ['*.png', 'LICENSE*.*', 'readme.txt']) 749 ['*.png', 'LICENSE*.*', 'readme.txt'])
1190 print("Found QScintilla2") 1195 print("Found QScintilla2")
1191 1196
1192 if pyqtVariant == "PyQt4": 1197 if pyqtVariant == "PyQt4":
1193 impModulesList = [ 1198 impModulesList = [
1194 "PyQt4.QtGui", "PyQt4.QtNetwork", "PyQt4.QtSql", 1199 "PyQt4.QtGui", "PyQt4.QtNetwork", "PyQt4.QtSql",
1195 "PyQt4.QtSvg", 1200 "PyQt4.QtSvg", "PyQt4.QtWebKit",
1196 ] 1201 ]
1202 altModulesList = []
1197 else: 1203 else:
1198 impModulesList = [ 1204 impModulesList = [
1199 "PyQt5.QtGui", "PyQt5.QtNetwork", "PyQt5.QtPrintSupport", 1205 "PyQt5.QtGui", "PyQt5.QtNetwork", "PyQt5.QtPrintSupport",
1200 "PyQt5.QtSql", "PyQt5.QtSvg", "PyQt5.QtWidgets", 1206 "PyQt5.QtSql", "PyQt5.QtSvg", "PyQt5.QtWidgets",
1201 ] 1207 ]
1208 altModulesList = [
1209 ("PyQt5.QtWebEngineWidgets", "PyQt5.QtWebKitWidgets")
1210 ]
1211 # check mandatory modules
1202 modulesOK = True 1212 modulesOK = True
1203 for impModule in impModulesList: 1213 for impModule in impModulesList:
1204 name = impModule.split(".")[1] 1214 name = impModule.split(".")[1]
1205 try: 1215 try:
1206 __import__(impModule) 1216 __import__(impModule)
1209 print('Sorry, please install {0}.'.format(name)) 1219 print('Sorry, please install {0}.'.format(name))
1210 print('Error: {0}'.format(msg)) 1220 print('Error: {0}'.format(msg))
1211 modulesOK = False 1221 modulesOK = False
1212 if not modulesOK: 1222 if not modulesOK:
1213 exit(1) 1223 exit(1)
1224 # check mandatory modules with alternatives
1225 if altModulesList:
1226 altModulesOK = True
1227 for altModules in altModulesList:
1228 modulesOK = False
1229 for altModule in altModules:
1230 name = altModule.split(".")[1]
1231 try:
1232 __import__(altModule)
1233 print("Found", name)
1234 modulesOK = True
1235 break
1236 except ImportError:
1237 pass
1238 if not modulesOK:
1239 altModulesOK = False
1240 print('Sorry, please install {0}.'
1241 .format(" or ".join(altModules)))
1242 if not altModulesOK:
1243 exit(1)
1214 1244
1215 # determine the platform dependent black list 1245 # determine the platform dependent black list
1216 if sys.platform.startswith("win"): 1246 if sys.platform.startswith("win"):
1217 PlatformBlackLists = PlatformsBlackLists["windows"] 1247 PlatformBlackLists = PlatformsBlackLists["windows"]
1218 elif sys.platform.startswith("linux"): 1248 elif sys.platform.startswith("linux"):

eric ide

mercurial