Sat, 19 Nov 2016 12:51:02 +0100
Prepared release 16.11.1
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) |
5068
3a5e58eeb64a
Fixed a few issues found by the updated pyflakes checker.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
5055
diff
changeset
|
24 | else: |
3a5e58eeb64a
Fixed a few issues found by the updated pyflakes checker.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
5055
diff
changeset
|
25 | raw_input = input |
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
|
26 | |
3670
f0cb7579c0b4
Finished renaming eric5 for PyQt5 to eric6.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
3621
diff
changeset
|
27 | # 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
|
28 | if os.path.exists("eric6config.py"): |
f0cb7579c0b4
Finished renaming eric5 for PyQt5 to eric6.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
3621
diff
changeset
|
29 | 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
|
30 | from eric6config import getConfig |
0
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
31 | |
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
32 | # Define the globals. |
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
33 | progName = None |
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
34 | 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
|
35 | 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
|
36 | includePythonVariant = False |
3714
4080395e3426
Changed the uninstall code for Mac platforms.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
3697
diff
changeset
|
37 | defaultMacAppBundleName = "eric6.app" |
4080395e3426
Changed the uninstall code for Mac platforms.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
3697
diff
changeset
|
38 | 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
|
39 | 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
|
40 | 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
|
41 | |
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 | # 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
|
43 | 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
|
44 | 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
|
45 | 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
|
46 | } |
0
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
47 | |
945
8cd4d08fa9f6
Made code mostly PEP 8 compliant (except all whitespace and line length).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
908
diff
changeset
|
48 | |
2654
df2c3218cc5e
Fixed an issue uninstalling eric5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
2383
diff
changeset
|
49 | def exit(rcode=0): |
df2c3218cc5e
Fixed an issue uninstalling eric5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
2383
diff
changeset
|
50 | """ |
df2c3218cc5e
Fixed an issue uninstalling eric5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
2383
diff
changeset
|
51 | 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
|
52 | |
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
|
53 | @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
|
54 | """ |
5055
7db1b9496e52
Some enhancements to the install and uninstall scripts.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
4806
diff
changeset
|
55 | global currDir |
7db1b9496e52
Some enhancements to the install and uninstall scripts.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
4806
diff
changeset
|
56 | |
3670
f0cb7579c0b4
Finished renaming eric5 for PyQt5 to eric6.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
3621
diff
changeset
|
57 | # restore the local eric6config.py |
f0cb7579c0b4
Finished renaming eric5 for PyQt5 to eric6.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
3621
diff
changeset
|
58 | 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
|
59 | if os.path.exists("eric6config.py"): |
f0cb7579c0b4
Finished renaming eric5 for PyQt5 to eric6.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
3621
diff
changeset
|
60 | os.remove("eric6config.py") |
f0cb7579c0b4
Finished renaming eric5 for PyQt5 to eric6.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
3621
diff
changeset
|
61 | os.rename("eric6config.py.orig", "eric6config.py") |
5055
7db1b9496e52
Some enhancements to the install and uninstall scripts.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
4806
diff
changeset
|
62 | |
7db1b9496e52
Some enhancements to the install and uninstall scripts.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
4806
diff
changeset
|
63 | if sys.platform.startswith("win"): |
7db1b9496e52
Some enhancements to the install and uninstall scripts.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
4806
diff
changeset
|
64 | # different meaning of input between Py2 and Py3 |
7db1b9496e52
Some enhancements to the install and uninstall scripts.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
4806
diff
changeset
|
65 | try: |
7db1b9496e52
Some enhancements to the install and uninstall scripts.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
4806
diff
changeset
|
66 | input("Press enter to continue...") |
7db1b9496e52
Some enhancements to the install and uninstall scripts.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
4806
diff
changeset
|
67 | except (EOFError, SyntaxError): |
7db1b9496e52
Some enhancements to the install and uninstall scripts.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
4806
diff
changeset
|
68 | pass |
7db1b9496e52
Some enhancements to the install and uninstall scripts.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
4806
diff
changeset
|
69 | |
7db1b9496e52
Some enhancements to the install and uninstall scripts.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
4806
diff
changeset
|
70 | os.chdir(currDir) |
7db1b9496e52
Some enhancements to the install and uninstall scripts.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
4806
diff
changeset
|
71 | |
7db1b9496e52
Some enhancements to the install and uninstall scripts.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
4806
diff
changeset
|
72 | sys.exit(rcode) |
2654
df2c3218cc5e
Fixed an issue uninstalling eric5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
2383
diff
changeset
|
73 | |
df2c3218cc5e
Fixed an issue uninstalling eric5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
2383
diff
changeset
|
74 | |
945
8cd4d08fa9f6
Made code mostly PEP 8 compliant (except all whitespace and line length).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
908
diff
changeset
|
75 | 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
|
76 | """ |
d133c7edd88a
Continued correcting doc strings by using the new doc string checker.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
2736
diff
changeset
|
77 | Display a usage message and exit. |
0
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
78 | |
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
|
79 | @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
|
80 | """ |
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
81 | global progName |
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
82 | |
12
1d8dd9706f46
First commit after changing to Python 3.1.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
0
diff
changeset
|
83 | print("Usage:") |
428
58405c24aa09
Did some more string format conversions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
146
diff
changeset
|
84 | 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
|
85 | print("where:") |
1d8dd9706f46
First commit after changing to Python 3.1.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
0
diff
changeset
|
86 | 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
|
87 | 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
|
88 | |
2654
df2c3218cc5e
Fixed an issue uninstalling eric5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
2383
diff
changeset
|
89 | exit(rcode) |
0
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
90 | |
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
91 | |
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
92 | def initGlobals(): |
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
93 | """ |
2965
d133c7edd88a
Continued correcting doc strings by using the new doc string checker.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
2736
diff
changeset
|
94 | 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
|
95 | """ |
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
96 | global pyModDir |
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
97 | |
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
98 | pyModDir = distutils.sysconfig.get_python_lib(True) |
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
99 | |
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
100 | |
945
8cd4d08fa9f6
Made code mostly PEP 8 compliant (except all whitespace and line length).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
908
diff
changeset
|
101 | 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
|
102 | """ |
d133c7edd88a
Continued correcting doc strings by using the new doc string checker.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
2736
diff
changeset
|
103 | 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
|
104 | |
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
|
105 | @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
|
106 | @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
|
107 | @return the name of the wrapper script |
0
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
108 | """ |
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
109 | if sys.platform.startswith("win"): |
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
110 | wname = dname + "\\" + wfile + ".bat" |
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
111 | else: |
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
112 | wname = dname + "/" + wfile |
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
113 | |
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
114 | return wname |
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
115 | |
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
116 | |
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
117 | def uninstallEric(): |
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
118 | """ |
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
119 | Uninstall the eric files. |
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
120 | """ |
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
121 | global pyModDir |
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
122 | |
146
afeb742e7148
Added installation of a .desktop file for Linux systems.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
107
diff
changeset
|
123 | # 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
|
124 | 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
|
125 | 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
|
126 | 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
|
127 | else: |
ff8e034662d6
Modified the install script to allow parallel installation for Python2 and Python3.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
3758
diff
changeset
|
128 | marker = "" |
ff8e034662d6
Modified the install script to allow parallel installation for Python2 and Python3.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
3758
diff
changeset
|
129 | 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
|
130 | "/usr/share/appdata/eric6" + marker + ".appdata.xml", |
3991
73731c4bf5bd
Corrected some coding style issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
3955
diff
changeset
|
131 | "/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
|
132 | ".desktop", |
4806
5c0745cb26ea
Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
4746
diff
changeset
|
133 | "/usr/share/applications/eric6_browser" + marker + |
5c0745cb26ea
Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
4746
diff
changeset
|
134 | ".desktop", |
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
|
135 | "/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
|
136 | "/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
|
137 | 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
|
138 | os.remove(name) |
afeb742e7148
Added installation of a .desktop file for Linux systems.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
107
diff
changeset
|
139 | |
0
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
140 | # Remove the wrapper scripts |
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
141 | rem_wnames = [ |
3670
f0cb7579c0b4
Finished renaming eric5 for PyQt5 to eric6.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
3621
diff
changeset
|
142 | "eric6_api", "eric6_compare", |
f0cb7579c0b4
Finished renaming eric5 for PyQt5 to eric6.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
3621
diff
changeset
|
143 | "eric6_configure", "eric6_diff", |
f0cb7579c0b4
Finished renaming eric5 for PyQt5 to eric6.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
3621
diff
changeset
|
144 | "eric6_doc", "eric6_qregularexpression", |
f0cb7579c0b4
Finished renaming eric5 for PyQt5 to eric6.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
3621
diff
changeset
|
145 | "eric6_qregexp", "eric6_re", |
f0cb7579c0b4
Finished renaming eric5 for PyQt5 to eric6.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
3621
diff
changeset
|
146 | "eric6_trpreviewer", "eric6_uipreviewer", |
f0cb7579c0b4
Finished renaming eric5 for PyQt5 to eric6.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
3621
diff
changeset
|
147 | "eric6_unittest", "eric6", |
f0cb7579c0b4
Finished renaming eric5 for PyQt5 to eric6.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
3621
diff
changeset
|
148 | "eric6_tray", "eric6_editor", |
f0cb7579c0b4
Finished renaming eric5 for PyQt5 to eric6.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
3621
diff
changeset
|
149 | "eric6_plugininstall", "eric6_pluginuninstall", |
f0cb7579c0b4
Finished renaming eric5 for PyQt5 to eric6.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
3621
diff
changeset
|
150 | "eric6_pluginrepository", "eric6_sqlbrowser", |
f0cb7579c0b4
Finished renaming eric5 for PyQt5 to eric6.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
3621
diff
changeset
|
151 | "eric6_webbrowser", "eric6_iconeditor", |
4806
5c0745cb26ea
Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
4746
diff
changeset
|
152 | "eric6_snap", "eric6_hexeditor", "eric6_browser", |
0
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
153 | ] |
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
|
154 | 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
|
155 | marker = PythonMarkers[sys.version_info.major] |
3678
2866383fd342
Adjusted the install and uninstall scripts.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
3670
diff
changeset
|
156 | 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
|
157 | |
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
|
158 | 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
|
159 | 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
|
160 | 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
|
161 | 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
|
162 | 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
|
163 | |
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 | # Cleanup our config file(s) |
3670
f0cb7579c0b4
Finished renaming eric5 for PyQt5 to eric6.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
3621
diff
changeset
|
165 | 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
|
166 | 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
|
167 | 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
|
168 | 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
|
169 | 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
|
170 | 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
|
171 | 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
|
172 | 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
|
173 | |
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
|
174 | # 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
|
175 | 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
|
176 | '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
|
177 | '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
|
178 | '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
|
179 | 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
|
180 | 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
|
181 | 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
|
182 | |
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
|
183 | # 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
|
184 | for name in glob.glob( |
3670
f0cb7579c0b4
Finished renaming eric5 for PyQt5 to eric6.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
3621
diff
changeset
|
185 | 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
|
186 | 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
|
187 | 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
|
188 | |
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 | # 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
|
190 | apidir = getConfig('apidir') |
3948
6c3720179d6b
Extended the install script to improve cooperation with packagers.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
3943
diff
changeset
|
191 | if apidir: |
6c3720179d6b
Extended the install script to improve cooperation with packagers.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
3943
diff
changeset
|
192 | for progLanguage in progLanguages: |
6c3720179d6b
Extended the install script to improve cooperation with packagers.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
3943
diff
changeset
|
193 | 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
|
194 | 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
|
195 | 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
|
196 | os.remove(apiname) |
6c3720179d6b
Extended the install script to improve cooperation with packagers.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
3943
diff
changeset
|
197 | 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
|
198 | 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
|
199 | 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
|
200 | 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
|
201 | |
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
|
202 | 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
|
203 | # delete the Mac app bundle |
3670
f0cb7579c0b4
Finished renaming eric5 for PyQt5 to eric6.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
3621
diff
changeset
|
204 | 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
|
205 | 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
|
206 | 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
|
207 | 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
|
208 | 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
|
209 | except AttributeError: |
3714
4080395e3426
Changed the uninstall code for Mac platforms.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
3697
diff
changeset
|
210 | macAppBundlePath = defaultMacAppBundlePath |
4080395e3426
Changed the uninstall code for Mac platforms.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
3697
diff
changeset
|
211 | 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
|
212 | 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
|
213 | macAppBundleName), |
4080395e3426
Changed the uninstall code for Mac platforms.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
3697
diff
changeset
|
214 | os.path.join(macAppBundlePath, |
4080395e3426
Changed the uninstall code for Mac platforms.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
3697
diff
changeset
|
215 | macAppBundleName), |
4080395e3426
Changed the uninstall code for Mac platforms.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
3697
diff
changeset
|
216 | ]: |
4080395e3426
Changed the uninstall code for Mac platforms.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
3697
diff
changeset
|
217 | if os.path.exists(bundlePath): |
4080395e3426
Changed the uninstall code for Mac platforms.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
3697
diff
changeset
|
218 | shutil.rmtree(bundlePath) |
4559
5af0cda900b3
Changed unistall.py to end with a message.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
4021
diff
changeset
|
219 | |
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
|
220 | # 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
|
221 | 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
|
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 | # 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
|
224 | 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
|
225 | |
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 | # 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
|
227 | 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
|
228 | |
4559
5af0cda900b3
Changed unistall.py to end with a message.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
4021
diff
changeset
|
229 | 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
|
230 | 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
|
231 | 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
|
232 | '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
|
233 | exit(7) |
2654
df2c3218cc5e
Fixed an issue uninstalling eric5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
2383
diff
changeset
|
234 | |
945
8cd4d08fa9f6
Made code mostly PEP 8 compliant (except all whitespace and line length).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
908
diff
changeset
|
235 | |
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
|
236 | 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
|
237 | """ |
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 | 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
|
239 | """ |
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 | 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
|
241 | |
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 | 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
|
243 | 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
|
244 | 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
|
245 | |
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 | 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
|
247 | 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
|
248 | 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
|
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 | 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
|
251 | 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
|
252 | 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
|
253 | 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
|
254 | 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
|
255 | while answer not in ["y", "Y", "n", "N", ""]: |
5068
3a5e58eeb64a
Fixed a few issues found by the updated pyflakes checker.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
5055
diff
changeset
|
256 | answer = raw_input( |
3a5e58eeb64a
Fixed a few issues found by the updated pyflakes checker.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
5055
diff
changeset
|
257 | "Shall these directories be removed (y/N)? ") |
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
|
258 | 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
|
259 | 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
|
260 | 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
|
261 | |
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 | |
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 | 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
|
264 | """ |
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 | 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
|
266 | """ |
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 | 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
|
268 | 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
|
269 | 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
|
270 | 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
|
271 | 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
|
272 | while answer not in ["y", "Y", "n", "N", ""]: |
5068
3a5e58eeb64a
Fixed a few issues found by the updated pyflakes checker.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
5055
diff
changeset
|
273 | answer = raw_input( |
3a5e58eeb64a
Fixed a few issues found by the updated pyflakes checker.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
5055
diff
changeset
|
274 | "Shall this directory be removed (y/N)? ") |
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
|
275 | 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
|
276 | 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
|
277 | |
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 | |
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 | 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
|
280 | """ |
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 | 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
|
282 | """ |
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 | 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
|
284 | 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
|
285 | 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
|
286 | 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
|
287 | 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
|
288 | 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
|
289 | 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
|
290 | 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
|
291 | 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
|
292 | |
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 | 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
|
294 | 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
|
295 | 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
|
296 | 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
|
297 | 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
|
298 | 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
|
299 | 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
|
300 | while answer not in ["y", "Y", "n", "N", ""]: |
5068
3a5e58eeb64a
Fixed a few issues found by the updated pyflakes checker.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
5055
diff
changeset
|
301 | answer = raw_input( |
3a5e58eeb64a
Fixed a few issues found by the updated pyflakes checker.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
5055
diff
changeset
|
302 | "Shall this directory be removed (y/N)? ") |
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
|
303 | if answer in ["y", "Y"]: |
4746
bd60f10ff4ec
Fixed an issue causing the uninstall script to crash.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
4673
diff
changeset
|
304 | shutil.rmtree(settingsDir) |
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
|
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 | |
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 | 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
|
308 | """ |
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 | 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
|
310 | |
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 | @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
|
312 | """ |
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 | 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
|
314 | 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
|
315 | 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
|
316 | 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
|
317 | 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
|
318 | 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
|
319 | 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
|
320 | |
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
|
321 | |
0
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
322 | 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
|
323 | """ |
d133c7edd88a
Continued correcting doc strings by using the new doc string checker.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
2736
diff
changeset
|
324 | The main function of the script. |
0
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
325 | |
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
|
326 | @param argv list of command line arguments |
0
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
327 | """ |
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
328 | import getopt |
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
329 | |
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
|
330 | 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
|
331 | |
0
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
332 | initGlobals() |
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
333 | |
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
334 | # Parse the command line. |
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
335 | global progName |
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
336 | progName = os.path.basename(argv[0]) |
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 | 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
|
339 | optlist, args = getopt.getopt(argv[1:], "hy") |
0
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
340 | except getopt.GetoptError: |
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
341 | usage() |
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
342 | |
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
343 | global platBinDir |
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
344 | |
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
345 | for opt, arg in optlist: |
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
346 | if opt == "-h": |
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
347 | 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
|
348 | 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
|
349 | includePythonVariant = True |
0
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
350 | |
5055
7db1b9496e52
Some enhancements to the install and uninstall scripts.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
4806
diff
changeset
|
351 | print("\nUninstalling eric6 ...") |
7db1b9496e52
Some enhancements to the install and uninstall scripts.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
4806
diff
changeset
|
352 | uninstallEric() |
7db1b9496e52
Some enhancements to the install and uninstall scripts.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
4806
diff
changeset
|
353 | print("\nUninstallation complete.") |
7db1b9496e52
Some enhancements to the install and uninstall scripts.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
4806
diff
changeset
|
354 | print() |
0
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
355 | |
2654
df2c3218cc5e
Fixed an issue uninstalling eric5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
2383
diff
changeset
|
356 | exit(0) |
df2c3218cc5e
Fixed an issue uninstalling eric5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
2383
diff
changeset
|
357 | |
df2c3218cc5e
Fixed an issue uninstalling eric5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
2383
diff
changeset
|
358 | |
0
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
359 | if __name__ == "__main__": |
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
360 | try: |
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
361 | main(sys.argv) |
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
362 | except SystemExit: |
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
363 | 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
|
364 | except Exception: |
3039
8dd0165d805d
Fixed a bunch of indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
3019
diff
changeset
|
365 | 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
|
366 | """ the program,\n""" |
8dd0165d805d
Fixed a bunch of indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
3019
diff
changeset
|
367 | """including the following traceback, to""" |
3670
f0cb7579c0b4
Finished renaming eric5 for PyQt5 to eric6.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
3621
diff
changeset
|
368 | """ eric-bugs@eric-ide.python-projects.org.\n""") |
0
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
369 | raise |
4566
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 | # |
a2e8f3c420ec
Dealt with the M801 code style checker messages.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
4561
diff
changeset
|
372 | # eflag: noqa = M801 |