uninstall.py

Sun, 17 Jan 2016 13:05:52 +0100

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Sun, 17 Jan 2016 13:05:52 +0100
changeset 4675
adb8882de5af
parent 4673
6fa2418f010c
child 4746
bd60f10ff4ec
permissions
-rw-r--r--

Added a todo comment to the highlighters configuration page.

12
1d8dd9706f46 First commit after changing to Python 3.1.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 0
diff changeset
1 #!/usr/bin/env python3
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2 # -*- coding: utf-8 -*-
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
3
4631
5c1a96925da4 Updated copyright for 2016.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4566
diff changeset
4 # Copyright (c) 2002 - 2016 Detlev Offenbach <detlev@die-offenbachs.de>
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
5 #
3670
f0cb7579c0b4 Finished renaming eric5 for PyQt5 to eric6.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3621
diff changeset
6 # This is the uninstall script for eric6.
4561
5bc6ed226471 Extended the uninstall script to remove the plug-ins directories, the data directory and the configuration directory.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4559
diff changeset
7 #
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
8
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
9 """
3670
f0cb7579c0b4 Finished renaming eric5 for PyQt5 to eric6.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3621
diff changeset
10 Uninstallation script for the eric6 IDE and all eric6 related tools.
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
11 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
12
4561
5bc6ed226471 Extended the uninstall script to remove the plug-ins directories, the data directory and the configuration directory.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4559
diff changeset
13 from __future__ import unicode_literals, print_function
2525
8b507a9a2d40 Script changes: Future import added, super calls modified and unicode behavior for str.
T.Rzepka <Tobias.Rzepka@gmail.com>
parents: 2383
diff changeset
14
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
15 import sys
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
16 import os
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
17 import shutil
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
18 import glob
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
19 import distutils.sysconfig
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
20
4561
5bc6ed226471 Extended the uninstall script to remove the plug-ins directories, the data directory and the configuration directory.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4559
diff changeset
21 if sys.version_info[0] == 2:
5bc6ed226471 Extended the uninstall script to remove the plug-ins directories, the data directory and the configuration directory.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4559
diff changeset
22 import sip
5bc6ed226471 Extended the uninstall script to remove the plug-ins directories, the data directory and the configuration directory.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4559
diff changeset
23 sip.setapi('QString', 2)
5bc6ed226471 Extended the uninstall script to remove the plug-ins directories, the data directory and the configuration directory.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4559
diff changeset
24
3670
f0cb7579c0b4 Finished renaming eric5 for PyQt5 to eric6.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3621
diff changeset
25 # get a local eric6config.py out of the way
f0cb7579c0b4 Finished renaming eric5 for PyQt5 to eric6.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3621
diff changeset
26 if os.path.exists("eric6config.py"):
f0cb7579c0b4 Finished renaming eric5 for PyQt5 to eric6.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3621
diff changeset
27 os.rename("eric6config.py", "eric6config.py.orig")
f0cb7579c0b4 Finished renaming eric5 for PyQt5 to eric6.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3621
diff changeset
28 from eric6config import getConfig
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
29
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
30 # Define the globals.
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
31 progName = None
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
32 pyModDir = None
3468
869d0b6e1e16 Added an API file for QSS and corrected an issue in the APIs manager.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
33 progLanguages = ["Python", "Ruby", "QSS"]
3597
137370f7114b Added the '-y' switch to the install script to allow to install Python2 and Python3 variants of eric5 in parallel by giving the startup script a '_py2' or '_py3' postfix.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3515
diff changeset
34 includePythonVariant = False
3714
4080395e3426 Changed the uninstall code for Mac platforms.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3697
diff changeset
35 defaultMacAppBundleName = "eric6.app"
4080395e3426 Changed the uninstall code for Mac platforms.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3697
diff changeset
36 defaultMacAppBundlePath = "/Applications"
4561
5bc6ed226471 Extended the uninstall script to remove the plug-ins directories, the data directory and the configuration directory.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4559
diff changeset
37 settingsNameOrganization = "Eric6"
5bc6ed226471 Extended the uninstall script to remove the plug-ins directories, the data directory and the configuration directory.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4559
diff changeset
38 settingsNameGlobal = "eric6"
3597
137370f7114b Added the '-y' switch to the install script to allow to install Python2 and Python3 variants of eric5 in parallel by giving the startup script a '_py2' or '_py3' postfix.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3515
diff changeset
39
137370f7114b Added the '-y' switch to the install script to allow to install Python2 and Python3 variants of eric5 in parallel by giving the startup script a '_py2' or '_py3' postfix.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3515
diff changeset
40 # Define file name markers for Python variants
137370f7114b Added the '-y' switch to the install script to allow to install Python2 and Python3 variants of eric5 in parallel by giving the startup script a '_py2' or '_py3' postfix.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3515
diff changeset
41 PythonMarkers = {
137370f7114b Added the '-y' switch to the install script to allow to install Python2 and Python3 variants of eric5 in parallel by giving the startup script a '_py2' or '_py3' postfix.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3515
diff changeset
42 2: "_py2",
137370f7114b Added the '-y' switch to the install script to allow to install Python2 and Python3 variants of eric5 in parallel by giving the startup script a '_py2' or '_py3' postfix.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3515
diff changeset
43 3: "_py3",
137370f7114b Added the '-y' switch to the install script to allow to install Python2 and Python3 variants of eric5 in parallel by giving the startup script a '_py2' or '_py3' postfix.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3515
diff changeset
44 }
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
45
945
8cd4d08fa9f6 Made code mostly PEP 8 compliant (except all whitespace and line length).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 908
diff changeset
46
2654
df2c3218cc5e Fixed an issue uninstalling eric5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2383
diff changeset
47 def exit(rcode=0):
df2c3218cc5e Fixed an issue uninstalling eric5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2383
diff changeset
48 """
df2c3218cc5e Fixed an issue uninstalling eric5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2383
diff changeset
49 Exit the uninstall script.
3019
7912530a33e2 Fixed a few documentation strings that got broken while doing the line shortening job. That concludes the later.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2992
diff changeset
50
7912530a33e2 Fixed a few documentation strings that got broken while doing the line shortening job. That concludes the later.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2992
diff changeset
51 @param rcode result code to report back (integer)
2654
df2c3218cc5e Fixed an issue uninstalling eric5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2383
diff changeset
52 """
3670
f0cb7579c0b4 Finished renaming eric5 for PyQt5 to eric6.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3621
diff changeset
53 # restore the local eric6config.py
f0cb7579c0b4 Finished renaming eric5 for PyQt5 to eric6.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3621
diff changeset
54 if os.path.exists("eric6config.py.orig"):
f0cb7579c0b4 Finished renaming eric5 for PyQt5 to eric6.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3621
diff changeset
55 if os.path.exists("eric6config.py"):
f0cb7579c0b4 Finished renaming eric5 for PyQt5 to eric6.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3621
diff changeset
56 os.remove("eric6config.py")
f0cb7579c0b4 Finished renaming eric5 for PyQt5 to eric6.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3621
diff changeset
57 os.rename("eric6config.py.orig", "eric6config.py")
2654
df2c3218cc5e Fixed an issue uninstalling eric5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2383
diff changeset
58
df2c3218cc5e Fixed an issue uninstalling eric5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2383
diff changeset
59
945
8cd4d08fa9f6 Made code mostly PEP 8 compliant (except all whitespace and line length).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 908
diff changeset
60 def usage(rcode=2):
2965
d133c7edd88a Continued correcting doc strings by using the new doc string checker.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2736
diff changeset
61 """
d133c7edd88a Continued correcting doc strings by using the new doc string checker.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2736
diff changeset
62 Display a usage message and exit.
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
63
3019
7912530a33e2 Fixed a few documentation strings that got broken while doing the line shortening job. That concludes the later.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2992
diff changeset
64 @param rcode return code passed back to the calling process (integer)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
65 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
66 global progName
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
67
12
1d8dd9706f46 First commit after changing to Python 3.1.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 0
diff changeset
68 print("Usage:")
428
58405c24aa09 Did some more string format conversions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 146
diff changeset
69 print(" {0} [-h]".format(progName))
12
1d8dd9706f46 First commit after changing to Python 3.1.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 0
diff changeset
70 print("where:")
1d8dd9706f46 First commit after changing to Python 3.1.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 0
diff changeset
71 print(" -h display this help message")
3597
137370f7114b Added the '-y' switch to the install script to allow to install Python2 and Python3 variants of eric5 in parallel by giving the startup script a '_py2' or '_py3' postfix.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3515
diff changeset
72 print(" -y remove executables with Python variant in name")
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
73
2654
df2c3218cc5e Fixed an issue uninstalling eric5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2383
diff changeset
74 exit(rcode)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
75
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
76
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
77 def initGlobals():
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
78 """
2965
d133c7edd88a Continued correcting doc strings by using the new doc string checker.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2736
diff changeset
79 Set the values of globals that need more than a simple assignment.
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
80 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
81 global pyModDir
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
82
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
83 pyModDir = distutils.sysconfig.get_python_lib(True)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
84
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
85
945
8cd4d08fa9f6 Made code mostly PEP 8 compliant (except all whitespace and line length).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 908
diff changeset
86 def wrapperName(dname, wfile):
2965
d133c7edd88a Continued correcting doc strings by using the new doc string checker.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2736
diff changeset
87 """
d133c7edd88a Continued correcting doc strings by using the new doc string checker.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2736
diff changeset
88 Create the platform specific name for the wrapper script.
3019
7912530a33e2 Fixed a few documentation strings that got broken while doing the line shortening job. That concludes the later.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2992
diff changeset
89
7912530a33e2 Fixed a few documentation strings that got broken while doing the line shortening job. That concludes the later.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2992
diff changeset
90 @param dname name of the directory to place the wrapper into
7912530a33e2 Fixed a few documentation strings that got broken while doing the line shortening job. That concludes the later.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2992
diff changeset
91 @param wfile basename (without extension) of the wrapper script
7912530a33e2 Fixed a few documentation strings that got broken while doing the line shortening job. That concludes the later.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2992
diff changeset
92 @return the name of the wrapper script
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
93 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
94 if sys.platform.startswith("win"):
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
95 wname = dname + "\\" + wfile + ".bat"
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
96 else:
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
97 wname = dname + "/" + wfile
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
98
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
99 return wname
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
100
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
101
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
102 def uninstallEric():
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
103 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
104 Uninstall the eric files.
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
105 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
106 global pyModDir
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
107
146
afeb742e7148 Added installation of a .desktop file for Linux systems.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 107
diff changeset
108 # Remove the menu entry for Linux systems
3751
3b5476d5420c Improved install script for non-root installations.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3714
diff changeset
109 if sys.platform.startswith("linux") and os.getuid() == 0:
3931
ff8e034662d6 Modified the install script to allow parallel installation for Python2 and Python3.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3758
diff changeset
110 if includePythonVariant:
ff8e034662d6 Modified the install script to allow parallel installation for Python2 and Python3.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3758
diff changeset
111 marker = PythonMarkers[sys.version_info.major]
ff8e034662d6 Modified the install script to allow parallel installation for Python2 and Python3.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3758
diff changeset
112 else:
ff8e034662d6 Modified the install script to allow parallel installation for Python2 and Python3.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3758
diff changeset
113 marker = ""
ff8e034662d6 Modified the install script to allow parallel installation for Python2 and Python3.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3758
diff changeset
114 for name in ["/usr/share/applications/eric6" + marker + ".desktop",
ff8e034662d6 Modified the install script to allow parallel installation for Python2 and Python3.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3758
diff changeset
115 "/usr/share/appdata/eric6" + marker + ".appdata.xml",
3991
73731c4bf5bd Corrected some coding style issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3955
diff changeset
116 "/usr/share/applications/eric6_webbrowser" + marker +
3943
37d88bed7bb9 Extended install script to mark more files with Python variant markers and added the '--noapis' switch to suppress API files installation.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3931
diff changeset
117 ".desktop",
37d88bed7bb9 Extended install script to mark more files with Python variant markers and added the '--noapis' switch to suppress API files installation.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3931
diff changeset
118 "/usr/share/pixmaps/eric" + marker + ".png",
37d88bed7bb9 Extended install script to mark more files with Python variant markers and added the '--noapis' switch to suppress API files installation.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3931
diff changeset
119 "/usr/share/pixmaps/ericWeb" + marker + ".png"]:
146
afeb742e7148 Added installation of a .desktop file for Linux systems.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 107
diff changeset
120 if os.path.exists(name):
afeb742e7148 Added installation of a .desktop file for Linux systems.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 107
diff changeset
121 os.remove(name)
afeb742e7148 Added installation of a .desktop file for Linux systems.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 107
diff changeset
122
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
123 # Remove the wrapper scripts
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
124 rem_wnames = [
3670
f0cb7579c0b4 Finished renaming eric5 for PyQt5 to eric6.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3621
diff changeset
125 "eric6_api", "eric6_compare",
f0cb7579c0b4 Finished renaming eric5 for PyQt5 to eric6.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3621
diff changeset
126 "eric6_configure", "eric6_diff",
f0cb7579c0b4 Finished renaming eric5 for PyQt5 to eric6.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3621
diff changeset
127 "eric6_doc", "eric6_qregularexpression",
f0cb7579c0b4 Finished renaming eric5 for PyQt5 to eric6.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3621
diff changeset
128 "eric6_qregexp", "eric6_re",
f0cb7579c0b4 Finished renaming eric5 for PyQt5 to eric6.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3621
diff changeset
129 "eric6_trpreviewer", "eric6_uipreviewer",
f0cb7579c0b4 Finished renaming eric5 for PyQt5 to eric6.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3621
diff changeset
130 "eric6_unittest", "eric6",
f0cb7579c0b4 Finished renaming eric5 for PyQt5 to eric6.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3621
diff changeset
131 "eric6_tray", "eric6_editor",
f0cb7579c0b4 Finished renaming eric5 for PyQt5 to eric6.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3621
diff changeset
132 "eric6_plugininstall", "eric6_pluginuninstall",
f0cb7579c0b4 Finished renaming eric5 for PyQt5 to eric6.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3621
diff changeset
133 "eric6_pluginrepository", "eric6_sqlbrowser",
f0cb7579c0b4 Finished renaming eric5 for PyQt5 to eric6.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3621
diff changeset
134 "eric6_webbrowser", "eric6_iconeditor",
4673
6fa2418f010c Finalized the hex editor.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
135 "eric6_snap", "eric6_hexeditor",
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
136 ]
3597
137370f7114b Added the '-y' switch to the install script to allow to install Python2 and Python3 variants of eric5 in parallel by giving the startup script a '_py2' or '_py3' postfix.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3515
diff changeset
137 if includePythonVariant:
137370f7114b Added the '-y' switch to the install script to allow to install Python2 and Python3 variants of eric5 in parallel by giving the startup script a '_py2' or '_py3' postfix.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3515
diff changeset
138 marker = PythonMarkers[sys.version_info.major]
3678
2866383fd342 Adjusted the install and uninstall scripts.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3670
diff changeset
139 rem_wnames = [n + marker for n in rem_wnames]
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
140
3597
137370f7114b Added the '-y' switch to the install script to allow to install Python2 and Python3 variants of eric5 in parallel by giving the startup script a '_py2' or '_py3' postfix.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3515
diff changeset
141 try:
137370f7114b Added the '-y' switch to the install script to allow to install Python2 and Python3 variants of eric5 in parallel by giving the startup script a '_py2' or '_py3' postfix.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3515
diff changeset
142 for rem_wname in rem_wnames:
137370f7114b Added the '-y' switch to the install script to allow to install Python2 and Python3 variants of eric5 in parallel by giving the startup script a '_py2' or '_py3' postfix.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3515
diff changeset
143 rwname = wrapperName(getConfig('bindir'), rem_wname)
137370f7114b Added the '-y' switch to the install script to allow to install Python2 and Python3 variants of eric5 in parallel by giving the startup script a '_py2' or '_py3' postfix.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3515
diff changeset
144 if os.path.exists(rwname):
137370f7114b Added the '-y' switch to the install script to allow to install Python2 and Python3 variants of eric5 in parallel by giving the startup script a '_py2' or '_py3' postfix.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3515
diff changeset
145 os.remove(rwname)
137370f7114b Added the '-y' switch to the install script to allow to install Python2 and Python3 variants of eric5 in parallel by giving the startup script a '_py2' or '_py3' postfix.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3515
diff changeset
146
137370f7114b Added the '-y' switch to the install script to allow to install Python2 and Python3 variants of eric5 in parallel by giving the startup script a '_py2' or '_py3' postfix.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3515
diff changeset
147 # Cleanup our config file(s)
3670
f0cb7579c0b4 Finished renaming eric5 for PyQt5 to eric6.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3621
diff changeset
148 for name in ['eric6config.py', 'eric6config.pyc', 'eric6.pth']:
3597
137370f7114b Added the '-y' switch to the install script to allow to install Python2 and Python3 variants of eric5 in parallel by giving the startup script a '_py2' or '_py3' postfix.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3515
diff changeset
149 e5cfile = os.path.join(pyModDir, name)
137370f7114b Added the '-y' switch to the install script to allow to install Python2 and Python3 variants of eric5 in parallel by giving the startup script a '_py2' or '_py3' postfix.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3515
diff changeset
150 if os.path.exists(e5cfile):
137370f7114b Added the '-y' switch to the install script to allow to install Python2 and Python3 variants of eric5 in parallel by giving the startup script a '_py2' or '_py3' postfix.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3515
diff changeset
151 os.remove(e5cfile)
137370f7114b Added the '-y' switch to the install script to allow to install Python2 and Python3 variants of eric5 in parallel by giving the startup script a '_py2' or '_py3' postfix.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3515
diff changeset
152 e5cfile = os.path.join(pyModDir, "__pycache__", name)
137370f7114b Added the '-y' switch to the install script to allow to install Python2 and Python3 variants of eric5 in parallel by giving the startup script a '_py2' or '_py3' postfix.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3515
diff changeset
153 path, ext = os.path.splitext(e5cfile)
137370f7114b Added the '-y' switch to the install script to allow to install Python2 and Python3 variants of eric5 in parallel by giving the startup script a '_py2' or '_py3' postfix.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3515
diff changeset
154 for f in glob.glob("{0}.*{1}".format(path, ext)):
137370f7114b Added the '-y' switch to the install script to allow to install Python2 and Python3 variants of eric5 in parallel by giving the startup script a '_py2' or '_py3' postfix.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3515
diff changeset
155 os.remove(f)
137370f7114b Added the '-y' switch to the install script to allow to install Python2 and Python3 variants of eric5 in parallel by giving the startup script a '_py2' or '_py3' postfix.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3515
diff changeset
156
137370f7114b Added the '-y' switch to the install script to allow to install Python2 and Python3 variants of eric5 in parallel by giving the startup script a '_py2' or '_py3' postfix.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3515
diff changeset
157 # Cleanup the install directories
3621
15f23ed3f216 Fixed a few source code style issues found by the updated pe8 checker.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3597
diff changeset
158 for name in ['ericExamplesDir', 'ericDocDir', 'ericDTDDir',
15f23ed3f216 Fixed a few source code style issues found by the updated pe8 checker.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3597
diff changeset
159 'ericCSSDir', 'ericIconDir', 'ericPixDir',
15f23ed3f216 Fixed a few source code style issues found by the updated pe8 checker.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3597
diff changeset
160 'ericTemplatesDir', 'ericCodeTemplatesDir',
15f23ed3f216 Fixed a few source code style issues found by the updated pe8 checker.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3597
diff changeset
161 'ericOthersDir', 'ericStylesDir', 'ericDir']:
3597
137370f7114b Added the '-y' switch to the install script to allow to install Python2 and Python3 variants of eric5 in parallel by giving the startup script a '_py2' or '_py3' postfix.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3515
diff changeset
162 dirpath = getConfig(name)
137370f7114b Added the '-y' switch to the install script to allow to install Python2 and Python3 variants of eric5 in parallel by giving the startup script a '_py2' or '_py3' postfix.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3515
diff changeset
163 if os.path.exists(dirpath):
137370f7114b Added the '-y' switch to the install script to allow to install Python2 and Python3 variants of eric5 in parallel by giving the startup script a '_py2' or '_py3' postfix.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3515
diff changeset
164 shutil.rmtree(dirpath, True)
137370f7114b Added the '-y' switch to the install script to allow to install Python2 and Python3 variants of eric5 in parallel by giving the startup script a '_py2' or '_py3' postfix.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3515
diff changeset
165
137370f7114b Added the '-y' switch to the install script to allow to install Python2 and Python3 variants of eric5 in parallel by giving the startup script a '_py2' or '_py3' postfix.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3515
diff changeset
166 # Cleanup translations
137370f7114b Added the '-y' switch to the install script to allow to install Python2 and Python3 variants of eric5 in parallel by giving the startup script a '_py2' or '_py3' postfix.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3515
diff changeset
167 for name in glob.glob(
3670
f0cb7579c0b4 Finished renaming eric5 for PyQt5 to eric6.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3621
diff changeset
168 os.path.join(getConfig('ericTranslationsDir'), 'eric6_*.qm')):
3597
137370f7114b Added the '-y' switch to the install script to allow to install Python2 and Python3 variants of eric5 in parallel by giving the startup script a '_py2' or '_py3' postfix.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3515
diff changeset
169 if os.path.exists(name):
137370f7114b Added the '-y' switch to the install script to allow to install Python2 and Python3 variants of eric5 in parallel by giving the startup script a '_py2' or '_py3' postfix.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3515
diff changeset
170 os.remove(name)
137370f7114b Added the '-y' switch to the install script to allow to install Python2 and Python3 variants of eric5 in parallel by giving the startup script a '_py2' or '_py3' postfix.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3515
diff changeset
171
137370f7114b Added the '-y' switch to the install script to allow to install Python2 and Python3 variants of eric5 in parallel by giving the startup script a '_py2' or '_py3' postfix.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3515
diff changeset
172 # Cleanup API files
137370f7114b Added the '-y' switch to the install script to allow to install Python2 and Python3 variants of eric5 in parallel by giving the startup script a '_py2' or '_py3' postfix.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3515
diff changeset
173 apidir = getConfig('apidir')
3948
6c3720179d6b Extended the install script to improve cooperation with packagers.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3943
diff changeset
174 if apidir:
6c3720179d6b Extended the install script to improve cooperation with packagers.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3943
diff changeset
175 for progLanguage in progLanguages:
6c3720179d6b Extended the install script to improve cooperation with packagers.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3943
diff changeset
176 for name in getConfig('apis'):
6c3720179d6b Extended the install script to improve cooperation with packagers.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3943
diff changeset
177 apiname = os.path.join(apidir, progLanguage.lower(), name)
6c3720179d6b Extended the install script to improve cooperation with packagers.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3943
diff changeset
178 if os.path.exists(apiname):
6c3720179d6b Extended the install script to improve cooperation with packagers.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3943
diff changeset
179 os.remove(apiname)
6c3720179d6b Extended the install script to improve cooperation with packagers.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3943
diff changeset
180 for apiname in glob.glob(
6c3720179d6b Extended the install script to improve cooperation with packagers.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3943
diff changeset
181 os.path.join(apidir, progLanguage.lower(), "*.bas")):
6c3720179d6b Extended the install script to improve cooperation with packagers.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3943
diff changeset
182 if os.path.basename(apiname) != "eric6.bas":
6c3720179d6b Extended the install script to improve cooperation with packagers.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3943
diff changeset
183 os.remove(apiname)
3597
137370f7114b Added the '-y' switch to the install script to allow to install Python2 and Python3 variants of eric5 in parallel by giving the startup script a '_py2' or '_py3' postfix.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3515
diff changeset
184
137370f7114b Added the '-y' switch to the install script to allow to install Python2 and Python3 variants of eric5 in parallel by giving the startup script a '_py2' or '_py3' postfix.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3515
diff changeset
185 if sys.platform == "darwin":
137370f7114b Added the '-y' switch to the install script to allow to install Python2 and Python3 variants of eric5 in parallel by giving the startup script a '_py2' or '_py3' postfix.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3515
diff changeset
186 # delete the Mac app bundle
3670
f0cb7579c0b4 Finished renaming eric5 for PyQt5 to eric6.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3621
diff changeset
187 if os.path.exists("/Developer/Applications/Eric6"):
f0cb7579c0b4 Finished renaming eric5 for PyQt5 to eric6.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3621
diff changeset
188 shutil.rmtree("/Developer/Applications/Eric6")
3597
137370f7114b Added the '-y' switch to the install script to allow to install Python2 and Python3 variants of eric5 in parallel by giving the startup script a '_py2' or '_py3' postfix.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3515
diff changeset
189 try:
137370f7114b Added the '-y' switch to the install script to allow to install Python2 and Python3 variants of eric5 in parallel by giving the startup script a '_py2' or '_py3' postfix.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3515
diff changeset
190 macAppBundlePath = getConfig("macAppBundlePath")
137370f7114b Added the '-y' switch to the install script to allow to install Python2 and Python3 variants of eric5 in parallel by giving the startup script a '_py2' or '_py3' postfix.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3515
diff changeset
191 macAppBundleName = getConfig("macAppBundleName")
137370f7114b Added the '-y' switch to the install script to allow to install Python2 and Python3 variants of eric5 in parallel by giving the startup script a '_py2' or '_py3' postfix.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3515
diff changeset
192 except AttributeError:
3714
4080395e3426 Changed the uninstall code for Mac platforms.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3697
diff changeset
193 macAppBundlePath = defaultMacAppBundlePath
4080395e3426 Changed the uninstall code for Mac platforms.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3697
diff changeset
194 macAppBundleName = defaultMacAppBundleName
3955
9c3e54d351e2 Changed some code in the install script to improve virtualenv support for Mac.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3948
diff changeset
195 for bundlePath in [os.path.join(defaultMacAppBundlePath,
3714
4080395e3426 Changed the uninstall code for Mac platforms.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3697
diff changeset
196 macAppBundleName),
4080395e3426 Changed the uninstall code for Mac platforms.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3697
diff changeset
197 os.path.join(macAppBundlePath,
4080395e3426 Changed the uninstall code for Mac platforms.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3697
diff changeset
198 macAppBundleName),
4080395e3426 Changed the uninstall code for Mac platforms.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3697
diff changeset
199 ]:
4080395e3426 Changed the uninstall code for Mac platforms.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3697
diff changeset
200 if os.path.exists(bundlePath):
4080395e3426 Changed the uninstall code for Mac platforms.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3697
diff changeset
201 shutil.rmtree(bundlePath)
4559
5af0cda900b3 Changed unistall.py to end with a message.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4021
diff changeset
202
4561
5bc6ed226471 Extended the uninstall script to remove the plug-ins directories, the data directory and the configuration directory.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4559
diff changeset
203 # remove plug-in directories
5bc6ed226471 Extended the uninstall script to remove the plug-ins directories, the data directory and the configuration directory.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4559
diff changeset
204 removePluginDirectories()
5bc6ed226471 Extended the uninstall script to remove the plug-ins directories, the data directory and the configuration directory.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4559
diff changeset
205
5bc6ed226471 Extended the uninstall script to remove the plug-ins directories, the data directory and the configuration directory.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4559
diff changeset
206 # remove the eric data directory
5bc6ed226471 Extended the uninstall script to remove the plug-ins directories, the data directory and the configuration directory.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4559
diff changeset
207 removeDataDirectory()
5bc6ed226471 Extended the uninstall script to remove the plug-ins directories, the data directory and the configuration directory.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4559
diff changeset
208
5bc6ed226471 Extended the uninstall script to remove the plug-ins directories, the data directory and the configuration directory.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4559
diff changeset
209 # remove the eric configuration directory
5bc6ed226471 Extended the uninstall script to remove the plug-ins directories, the data directory and the configuration directory.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4559
diff changeset
210 removeConfigurationData()
5bc6ed226471 Extended the uninstall script to remove the plug-ins directories, the data directory and the configuration directory.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4559
diff changeset
211
4559
5af0cda900b3 Changed unistall.py to end with a message.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4021
diff changeset
212 print("\nUninstallation completed")
3597
137370f7114b Added the '-y' switch to the install script to allow to install Python2 and Python3 variants of eric5 in parallel by giving the startup script a '_py2' or '_py3' postfix.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3515
diff changeset
213 except (IOError, OSError) as msg:
137370f7114b Added the '-y' switch to the install script to allow to install Python2 and Python3 variants of eric5 in parallel by giving the startup script a '_py2' or '_py3' postfix.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3515
diff changeset
214 sys.stderr.write(
137370f7114b Added the '-y' switch to the install script to allow to install Python2 and Python3 variants of eric5 in parallel by giving the startup script a '_py2' or '_py3' postfix.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3515
diff changeset
215 'Error: {0}\nTry uninstall with admin rights.\n'.format(msg))
137370f7114b Added the '-y' switch to the install script to allow to install Python2 and Python3 variants of eric5 in parallel by giving the startup script a '_py2' or '_py3' postfix.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3515
diff changeset
216 exit(7)
2654
df2c3218cc5e Fixed an issue uninstalling eric5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2383
diff changeset
217
945
8cd4d08fa9f6 Made code mostly PEP 8 compliant (except all whitespace and line length).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 908
diff changeset
218
4561
5bc6ed226471 Extended the uninstall script to remove the plug-ins directories, the data directory and the configuration directory.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4559
diff changeset
219 def removePluginDirectories():
5bc6ed226471 Extended the uninstall script to remove the plug-ins directories, the data directory and the configuration directory.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4559
diff changeset
220 """
5bc6ed226471 Extended the uninstall script to remove the plug-ins directories, the data directory and the configuration directory.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4559
diff changeset
221 Remove the plug-in directories.
5bc6ed226471 Extended the uninstall script to remove the plug-ins directories, the data directory and the configuration directory.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4559
diff changeset
222 """
5bc6ed226471 Extended the uninstall script to remove the plug-ins directories, the data directory and the configuration directory.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4559
diff changeset
223 pathsToRemove = []
5bc6ed226471 Extended the uninstall script to remove the plug-ins directories, the data directory and the configuration directory.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4559
diff changeset
224
5bc6ed226471 Extended the uninstall script to remove the plug-ins directories, the data directory and the configuration directory.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4559
diff changeset
225 globalPluginsDir = os.path.join(getConfig('mdir'), "eric6plugins")
5bc6ed226471 Extended the uninstall script to remove the plug-ins directories, the data directory and the configuration directory.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4559
diff changeset
226 if os.path.exists(globalPluginsDir):
5bc6ed226471 Extended the uninstall script to remove the plug-ins directories, the data directory and the configuration directory.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4559
diff changeset
227 pathsToRemove.append(globalPluginsDir)
5bc6ed226471 Extended the uninstall script to remove the plug-ins directories, the data directory and the configuration directory.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4559
diff changeset
228
5bc6ed226471 Extended the uninstall script to remove the plug-ins directories, the data directory and the configuration directory.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4559
diff changeset
229 localPluginsDir = os.path.join(getConfigDir(), "eric6plugins")
5bc6ed226471 Extended the uninstall script to remove the plug-ins directories, the data directory and the configuration directory.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4559
diff changeset
230 if os.path.exists(localPluginsDir):
5bc6ed226471 Extended the uninstall script to remove the plug-ins directories, the data directory and the configuration directory.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4559
diff changeset
231 pathsToRemove.append(localPluginsDir)
5bc6ed226471 Extended the uninstall script to remove the plug-ins directories, the data directory and the configuration directory.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4559
diff changeset
232
5bc6ed226471 Extended the uninstall script to remove the plug-ins directories, the data directory and the configuration directory.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4559
diff changeset
233 if pathsToRemove:
5bc6ed226471 Extended the uninstall script to remove the plug-ins directories, the data directory and the configuration directory.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4559
diff changeset
234 print("Found these plug-in directories")
5bc6ed226471 Extended the uninstall script to remove the plug-ins directories, the data directory and the configuration directory.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4559
diff changeset
235 for path in pathsToRemove:
5bc6ed226471 Extended the uninstall script to remove the plug-ins directories, the data directory and the configuration directory.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4559
diff changeset
236 print(" - {0}".format(path))
5bc6ed226471 Extended the uninstall script to remove the plug-ins directories, the data directory and the configuration directory.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4559
diff changeset
237 answer = "c"
5bc6ed226471 Extended the uninstall script to remove the plug-ins directories, the data directory and the configuration directory.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4559
diff changeset
238 while answer not in ["y", "Y", "n", "N", ""]:
5bc6ed226471 Extended the uninstall script to remove the plug-ins directories, the data directory and the configuration directory.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4559
diff changeset
239 if sys.version_info[0] == 2:
5bc6ed226471 Extended the uninstall script to remove the plug-ins directories, the data directory and the configuration directory.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4559
diff changeset
240 answer = raw_input(
5bc6ed226471 Extended the uninstall script to remove the plug-ins directories, the data directory and the configuration directory.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4559
diff changeset
241 "Shall these directories be removed (y/N)? ")
5bc6ed226471 Extended the uninstall script to remove the plug-ins directories, the data directory and the configuration directory.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4559
diff changeset
242 else:
5bc6ed226471 Extended the uninstall script to remove the plug-ins directories, the data directory and the configuration directory.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4559
diff changeset
243 answer = input(
5bc6ed226471 Extended the uninstall script to remove the plug-ins directories, the data directory and the configuration directory.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4559
diff changeset
244 "Shall these directories be removed (y/N)? ")
5bc6ed226471 Extended the uninstall script to remove the plug-ins directories, the data directory and the configuration directory.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4559
diff changeset
245 if answer in ["y", "Y"]:
5bc6ed226471 Extended the uninstall script to remove the plug-ins directories, the data directory and the configuration directory.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4559
diff changeset
246 for path in pathsToRemove:
5bc6ed226471 Extended the uninstall script to remove the plug-ins directories, the data directory and the configuration directory.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4559
diff changeset
247 shutil.rmtree(path)
5bc6ed226471 Extended the uninstall script to remove the plug-ins directories, the data directory and the configuration directory.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4559
diff changeset
248
5bc6ed226471 Extended the uninstall script to remove the plug-ins directories, the data directory and the configuration directory.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4559
diff changeset
249
5bc6ed226471 Extended the uninstall script to remove the plug-ins directories, the data directory and the configuration directory.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4559
diff changeset
250 def removeDataDirectory():
5bc6ed226471 Extended the uninstall script to remove the plug-ins directories, the data directory and the configuration directory.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4559
diff changeset
251 """
5bc6ed226471 Extended the uninstall script to remove the plug-ins directories, the data directory and the configuration directory.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4559
diff changeset
252 Remove the eric data directory.
5bc6ed226471 Extended the uninstall script to remove the plug-ins directories, the data directory and the configuration directory.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4559
diff changeset
253 """
5bc6ed226471 Extended the uninstall script to remove the plug-ins directories, the data directory and the configuration directory.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4559
diff changeset
254 cfg = getConfigDir()
5bc6ed226471 Extended the uninstall script to remove the plug-ins directories, the data directory and the configuration directory.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4559
diff changeset
255 if os.path.exists(cfg):
5bc6ed226471 Extended the uninstall script to remove the plug-ins directories, the data directory and the configuration directory.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4559
diff changeset
256 print("Found the eric data directory")
5bc6ed226471 Extended the uninstall script to remove the plug-ins directories, the data directory and the configuration directory.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4559
diff changeset
257 print(" - {0}".format(cfg))
5bc6ed226471 Extended the uninstall script to remove the plug-ins directories, the data directory and the configuration directory.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4559
diff changeset
258 answer = "c"
5bc6ed226471 Extended the uninstall script to remove the plug-ins directories, the data directory and the configuration directory.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4559
diff changeset
259 while answer not in ["y", "Y", "n", "N", ""]:
5bc6ed226471 Extended the uninstall script to remove the plug-ins directories, the data directory and the configuration directory.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4559
diff changeset
260 if sys.version_info[0] == 2:
5bc6ed226471 Extended the uninstall script to remove the plug-ins directories, the data directory and the configuration directory.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4559
diff changeset
261 answer = raw_input(
5bc6ed226471 Extended the uninstall script to remove the plug-ins directories, the data directory and the configuration directory.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4559
diff changeset
262 "Shall this directory be removed (y/N)? ")
5bc6ed226471 Extended the uninstall script to remove the plug-ins directories, the data directory and the configuration directory.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4559
diff changeset
263 else:
5bc6ed226471 Extended the uninstall script to remove the plug-ins directories, the data directory and the configuration directory.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4559
diff changeset
264 answer = input(
5bc6ed226471 Extended the uninstall script to remove the plug-ins directories, the data directory and the configuration directory.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4559
diff changeset
265 "Shall this directory be removed (y/N)? ")
5bc6ed226471 Extended the uninstall script to remove the plug-ins directories, the data directory and the configuration directory.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4559
diff changeset
266 if answer in ["y", "Y"]:
5bc6ed226471 Extended the uninstall script to remove the plug-ins directories, the data directory and the configuration directory.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4559
diff changeset
267 shutil.rmtree(cfg)
5bc6ed226471 Extended the uninstall script to remove the plug-ins directories, the data directory and the configuration directory.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4559
diff changeset
268
5bc6ed226471 Extended the uninstall script to remove the plug-ins directories, the data directory and the configuration directory.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4559
diff changeset
269
5bc6ed226471 Extended the uninstall script to remove the plug-ins directories, the data directory and the configuration directory.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4559
diff changeset
270 def removeConfigurationData():
5bc6ed226471 Extended the uninstall script to remove the plug-ins directories, the data directory and the configuration directory.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4559
diff changeset
271 """
5bc6ed226471 Extended the uninstall script to remove the plug-ins directories, the data directory and the configuration directory.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4559
diff changeset
272 Remove the eric configuration directory.
5bc6ed226471 Extended the uninstall script to remove the plug-ins directories, the data directory and the configuration directory.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4559
diff changeset
273 """
5bc6ed226471 Extended the uninstall script to remove the plug-ins directories, the data directory and the configuration directory.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4559
diff changeset
274 try:
5bc6ed226471 Extended the uninstall script to remove the plug-ins directories, the data directory and the configuration directory.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4559
diff changeset
275 from PyQt5.QtCore import QSettings
5bc6ed226471 Extended the uninstall script to remove the plug-ins directories, the data directory and the configuration directory.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4559
diff changeset
276 except ImportError:
5bc6ed226471 Extended the uninstall script to remove the plug-ins directories, the data directory and the configuration directory.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4559
diff changeset
277 try:
5bc6ed226471 Extended the uninstall script to remove the plug-ins directories, the data directory and the configuration directory.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4559
diff changeset
278 from PyQt4.QtCore import QSettings
5bc6ed226471 Extended the uninstall script to remove the plug-ins directories, the data directory and the configuration directory.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4559
diff changeset
279 except ImportError:
5bc6ed226471 Extended the uninstall script to remove the plug-ins directories, the data directory and the configuration directory.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4559
diff changeset
280 print("No PyQt variant installed. The configuration directory")
5bc6ed226471 Extended the uninstall script to remove the plug-ins directories, the data directory and the configuration directory.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4559
diff changeset
281 print("cannot be determined. You have to remove it manually.\n")
5bc6ed226471 Extended the uninstall script to remove the plug-ins directories, the data directory and the configuration directory.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4559
diff changeset
282 return
5bc6ed226471 Extended the uninstall script to remove the plug-ins directories, the data directory and the configuration directory.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4559
diff changeset
283
5bc6ed226471 Extended the uninstall script to remove the plug-ins directories, the data directory and the configuration directory.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4559
diff changeset
284 settings = QSettings(QSettings.IniFormat, QSettings.UserScope,
5bc6ed226471 Extended the uninstall script to remove the plug-ins directories, the data directory and the configuration directory.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4559
diff changeset
285 settingsNameOrganization, settingsNameGlobal)
5bc6ed226471 Extended the uninstall script to remove the plug-ins directories, the data directory and the configuration directory.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4559
diff changeset
286 settingsDir = os.path.dirname(settings.fileName())
5bc6ed226471 Extended the uninstall script to remove the plug-ins directories, the data directory and the configuration directory.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4559
diff changeset
287 if os.path.exists(settingsDir):
5bc6ed226471 Extended the uninstall script to remove the plug-ins directories, the data directory and the configuration directory.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4559
diff changeset
288 print("Found the eric configuration directory")
5bc6ed226471 Extended the uninstall script to remove the plug-ins directories, the data directory and the configuration directory.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4559
diff changeset
289 print(" - {0}".format(settingsDir))
5bc6ed226471 Extended the uninstall script to remove the plug-ins directories, the data directory and the configuration directory.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4559
diff changeset
290 answer = "c"
5bc6ed226471 Extended the uninstall script to remove the plug-ins directories, the data directory and the configuration directory.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4559
diff changeset
291 while answer not in ["y", "Y", "n", "N", ""]:
5bc6ed226471 Extended the uninstall script to remove the plug-ins directories, the data directory and the configuration directory.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4559
diff changeset
292 if sys.version_info[0] == 2:
5bc6ed226471 Extended the uninstall script to remove the plug-ins directories, the data directory and the configuration directory.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4559
diff changeset
293 answer = raw_input(
5bc6ed226471 Extended the uninstall script to remove the plug-ins directories, the data directory and the configuration directory.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4559
diff changeset
294 "Shall this directory be removed (y/N)? ")
5bc6ed226471 Extended the uninstall script to remove the plug-ins directories, the data directory and the configuration directory.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4559
diff changeset
295 else:
5bc6ed226471 Extended the uninstall script to remove the plug-ins directories, the data directory and the configuration directory.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4559
diff changeset
296 answer = input(
5bc6ed226471 Extended the uninstall script to remove the plug-ins directories, the data directory and the configuration directory.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4559
diff changeset
297 "Shall this directory be removed (y/N)? ")
5bc6ed226471 Extended the uninstall script to remove the plug-ins directories, the data directory and the configuration directory.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4559
diff changeset
298 if answer in ["y", "Y"]:
5bc6ed226471 Extended the uninstall script to remove the plug-ins directories, the data directory and the configuration directory.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4559
diff changeset
299 shutil.rmtree(settings)
5bc6ed226471 Extended the uninstall script to remove the plug-ins directories, the data directory and the configuration directory.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4559
diff changeset
300
5bc6ed226471 Extended the uninstall script to remove the plug-ins directories, the data directory and the configuration directory.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4559
diff changeset
301
5bc6ed226471 Extended the uninstall script to remove the plug-ins directories, the data directory and the configuration directory.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4559
diff changeset
302 def getConfigDir():
5bc6ed226471 Extended the uninstall script to remove the plug-ins directories, the data directory and the configuration directory.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4559
diff changeset
303 """
5bc6ed226471 Extended the uninstall script to remove the plug-ins directories, the data directory and the configuration directory.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4559
diff changeset
304 Module function to get the name of the directory storing the config data.
5bc6ed226471 Extended the uninstall script to remove the plug-ins directories, the data directory and the configuration directory.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4559
diff changeset
305
5bc6ed226471 Extended the uninstall script to remove the plug-ins directories, the data directory and the configuration directory.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4559
diff changeset
306 @return directory name of the config dir (string)
5bc6ed226471 Extended the uninstall script to remove the plug-ins directories, the data directory and the configuration directory.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4559
diff changeset
307 """
5bc6ed226471 Extended the uninstall script to remove the plug-ins directories, the data directory and the configuration directory.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4559
diff changeset
308 if sys.platform.startswith("win"):
5bc6ed226471 Extended the uninstall script to remove the plug-ins directories, the data directory and the configuration directory.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4559
diff changeset
309 cdn = "_eric6"
5bc6ed226471 Extended the uninstall script to remove the plug-ins directories, the data directory and the configuration directory.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4559
diff changeset
310 return os.path.join(os.path.expanduser("~"), cdn)
5bc6ed226471 Extended the uninstall script to remove the plug-ins directories, the data directory and the configuration directory.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4559
diff changeset
311 else:
5bc6ed226471 Extended the uninstall script to remove the plug-ins directories, the data directory and the configuration directory.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4559
diff changeset
312 cdn = ".eric6"
5bc6ed226471 Extended the uninstall script to remove the plug-ins directories, the data directory and the configuration directory.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4559
diff changeset
313 return os.path.join(
5bc6ed226471 Extended the uninstall script to remove the plug-ins directories, the data directory and the configuration directory.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4559
diff changeset
314 os.path.expanduser("~{0}".format(os.getlogin())), cdn)
5bc6ed226471 Extended the uninstall script to remove the plug-ins directories, the data directory and the configuration directory.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4559
diff changeset
315
5bc6ed226471 Extended the uninstall script to remove the plug-ins directories, the data directory and the configuration directory.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4559
diff changeset
316
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
317 def main(argv):
2965
d133c7edd88a Continued correcting doc strings by using the new doc string checker.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2736
diff changeset
318 """
d133c7edd88a Continued correcting doc strings by using the new doc string checker.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2736
diff changeset
319 The main function of the script.
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
320
3019
7912530a33e2 Fixed a few documentation strings that got broken while doing the line shortening job. That concludes the later.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2992
diff changeset
321 @param argv list of command line arguments
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
322 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
323 import getopt
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
324
3597
137370f7114b Added the '-y' switch to the install script to allow to install Python2 and Python3 variants of eric5 in parallel by giving the startup script a '_py2' or '_py3' postfix.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3515
diff changeset
325 global includePythonVariant
137370f7114b Added the '-y' switch to the install script to allow to install Python2 and Python3 variants of eric5 in parallel by giving the startup script a '_py2' or '_py3' postfix.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3515
diff changeset
326
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
327 initGlobals()
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
328
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
329 # Parse the command line.
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
330 global progName
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
331 progName = os.path.basename(argv[0])
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
332
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
333 try:
3597
137370f7114b Added the '-y' switch to the install script to allow to install Python2 and Python3 variants of eric5 in parallel by giving the startup script a '_py2' or '_py3' postfix.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3515
diff changeset
334 optlist, args = getopt.getopt(argv[1:], "hy")
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
335 except getopt.GetoptError:
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
336 usage()
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
337
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
338 global platBinDir
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
339
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
340 for opt, arg in optlist:
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
341 if opt == "-h":
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
342 usage(0)
3597
137370f7114b Added the '-y' switch to the install script to allow to install Python2 and Python3 variants of eric5 in parallel by giving the startup script a '_py2' or '_py3' postfix.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3515
diff changeset
343 if opt == "-y":
137370f7114b Added the '-y' switch to the install script to allow to install Python2 and Python3 variants of eric5 in parallel by giving the startup script a '_py2' or '_py3' postfix.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3515
diff changeset
344 includePythonVariant = True
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
345
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
346 try:
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
347 uninstallEric()
12
1d8dd9706f46 First commit after changing to Python 3.1.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 0
diff changeset
348 except IOError as msg:
2992
dbdf27746da5 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2965
diff changeset
349 sys.stderr.write(
dbdf27746da5 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2965
diff changeset
350 'IOError: {0}\nTry uninstall with admin rights.\n'.format(msg))
1387
1734bc5f4f82 Mac related changes.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1346
diff changeset
351 except OSError as msg:
2992
dbdf27746da5 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2965
diff changeset
352 sys.stderr.write(
dbdf27746da5 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2965
diff changeset
353 'OSError: {0}\nTry uninstall with admin rights.\n'.format(msg))
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
354
2654
df2c3218cc5e Fixed an issue uninstalling eric5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2383
diff changeset
355 exit(0)
df2c3218cc5e Fixed an issue uninstalling eric5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2383
diff changeset
356
df2c3218cc5e Fixed an issue uninstalling eric5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2383
diff changeset
357
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
358 if __name__ == "__main__":
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
359 try:
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
360 main(sys.argv)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
361 except SystemExit:
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
362 raise
4561
5bc6ed226471 Extended the uninstall script to remove the plug-ins directories, the data directory and the configuration directory.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4559
diff changeset
363 except Exception:
3039
8dd0165d805d Fixed a bunch of indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3019
diff changeset
364 print("""An internal error occured. Please report all the output of"""
8dd0165d805d Fixed a bunch of indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3019
diff changeset
365 """ the program,\n"""
8dd0165d805d Fixed a bunch of indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3019
diff changeset
366 """including the following traceback, to"""
3670
f0cb7579c0b4 Finished renaming eric5 for PyQt5 to eric6.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3621
diff changeset
367 """ eric-bugs@eric-ide.python-projects.org.\n""")
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
368 raise
4566
a2e8f3c420ec Dealt with the M801 code style checker messages.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4561
diff changeset
369
a2e8f3c420ec Dealt with the M801 code style checker messages.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4561
diff changeset
370 #
a2e8f3c420ec Dealt with the M801 code style checker messages.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4561
diff changeset
371 # eflag: noqa = M801

eric ide

mercurial