install.py

branch
maintenance
changeset 6004
548a9ba8c970
parent 5992
d184ca2d3a95
child 6048
82ad8ec9548c
--- a/install.py	Sun Nov 19 13:06:01 2017 +0100
+++ b/install.py	Sat Dec 02 12:40:22 2017 +0100
@@ -109,6 +109,8 @@
     """
     global currDir
     
+    print()
+    
     if sys.platform.startswith("win"):
         # different meaning of input between Py2 and Py3
         try:
@@ -737,6 +739,9 @@
             '{1}{0}Styles'.format(os.sep, sourceDir), cfg['ericStylesDir'],
             ['*.qss'])
         copyTree(
+            '{1}{0}Styles'.format(os.sep, sourceDir), cfg['ericStylesDir'],
+            ['*.e4h'])
+        copyTree(
             '{1}{0}i18n'.format(os.sep, sourceDir), cfg['ericTranslationsDir'],
             ['*.qm'])
         copyTree(
@@ -1192,13 +1197,18 @@
     if pyqtVariant == "PyQt4":
         impModulesList = [
             "PyQt4.QtGui", "PyQt4.QtNetwork", "PyQt4.QtSql",
-            "PyQt4.QtSvg",
+            "PyQt4.QtSvg", "PyQt4.QtWebKit",
         ]
+        altModulesList = []
     else:
         impModulesList = [
             "PyQt5.QtGui", "PyQt5.QtNetwork", "PyQt5.QtPrintSupport",
             "PyQt5.QtSql", "PyQt5.QtSvg", "PyQt5.QtWidgets",
         ]
+        altModulesList = [
+            ("PyQt5.QtWebEngineWidgets", "PyQt5.QtWebKitWidgets")
+        ]
+    # check mandatory modules
     modulesOK = True
     for impModule in impModulesList:
         name = impModule.split(".")[1]
@@ -1211,6 +1221,26 @@
             modulesOK = False
     if not modulesOK:
         exit(1)
+    # check mandatory modules with alternatives
+    if altModulesList:
+        altModulesOK = True
+        for altModules in altModulesList:
+            modulesOK = False
+            for altModule in altModules:
+                name = altModule.split(".")[1]
+                try:
+                    __import__(altModule)
+                    print("Found", name)
+                    modulesOK = True
+                    break
+                except ImportError:
+                    pass
+            if not modulesOK:
+                altModulesOK = False
+                print('Sorry, please install {0}.'
+                      .format(" or ".join(altModules)))
+        if not altModulesOK:
+            exit(1)
     
     # determine the platform dependent black list
     if sys.platform.startswith("win"):

eric ide

mercurial