install/uninstall: implemented code to cope with the situation that the names contained in the eric6config.py file were generated with a non-utf8 encoding. without_py2_and_pyqt4

Thu, 05 Sep 2019 18:47:56 +0200

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Thu, 05 Sep 2019 18:47:56 +0200
branch
without_py2_and_pyqt4
changeset 7211
1c97f3142fa8
parent 7209
ad27005f08ac
child 7220
5cf645f6daab
child 7223
2d58b9c1a981

install/uninstall: implemented code to cope with the situation that the names contained in the eric6config.py file were generated with a non-utf8 encoding.
(grafted from 8fe313d039e6752ab7459ad3d7b1f5a637ed22f1)

scripts/install-i18n.py file | annotate | diff | comparison | revisions
scripts/install.py file | annotate | diff | comparison | revisions
scripts/uninstall.py file | annotate | diff | comparison | revisions
--- a/scripts/install-i18n.py	Wed Sep 04 20:01:53 2019 +0200
+++ b/scripts/install-i18n.py	Thu Sep 05 18:47:56 2019 +0200
@@ -21,6 +21,10 @@
 except ImportError:
     print("The eric6 IDE doesn't seem to be installed. Aborting.")
     sys.exit(1)
+except SyntaxError:
+    # an incomplete or old config file was found
+    print("The eric6 IDE seems to be installed incompletely. Aborting.")
+    sys.exit(1)
     
 
 def getConfigDir():
--- a/scripts/install.py	Wed Sep 04 20:01:53 2019 +0200
+++ b/scripts/install.py	Thu Sep 05 18:47:56 2019 +0200
@@ -478,6 +478,9 @@
     except ImportError:
         # eric6 wasn't installed previously
         return
+    except SyntaxError:
+        # an incomplete or old config file was found
+        return
     
     global pyModDir, progLanguages
     
--- a/scripts/uninstall.py	Wed Sep 04 20:01:53 2019 +0200
+++ b/scripts/uninstall.py	Thu Sep 05 18:47:56 2019 +0200
@@ -18,11 +18,6 @@
 import glob
 import distutils.sysconfig
 
-# get a local eric6config.py out of the way
-if os.path.exists("eric6config.py"):
-    os.rename("eric6config.py", "eric6config.py.orig")
-from eric6config import getConfig
-
 # Define the globals.
 progName = None
 currDir = os.getcwd()
@@ -58,6 +53,19 @@
     
     sys.exit(rcode)
 
+# get a local eric6config.py out of the way
+if os.path.exists("eric6config.py"):
+    os.rename("eric6config.py", "eric6config.py.orig")
+try:
+    from eric6config import getConfig
+except ImportError:
+    print("The eric6 IDE doesn't seem to be installed. Aborting.")
+    exit(1)
+except SyntaxError:
+    # an incomplete or old config file was found
+    print("The eric6 IDE seems to be installed incompletely. Aborting.")
+    exit(1)
+
 
 def usage(rcode=2):
     """

eric ide

mercurial