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.

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

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Thu, 05 Sep 2019 18:47:56 +0200
changeset 7210
8fe313d039e6
parent 7208
d30ac02a5f04
child 7212
1f4826a126d9

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.

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
@@ -581,6 +581,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
@@ -27,11 +27,6 @@
 else:
     raw_input = input
 
-# 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()
@@ -75,6 +70,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