uninstall.py

changeset 945
8cd4d08fa9f6
parent 908
d00447340771
child 1161
ddab52aa1a6b
equal deleted inserted replaced
944:1b59c4ba121e 945:8cd4d08fa9f6
19 19
20 # Define the globals. 20 # Define the globals.
21 progName = None 21 progName = None
22 pyModDir = None 22 pyModDir = None
23 23
24 def usage(rcode = 2): 24
25 def usage(rcode=2):
25 """Display a usage message and exit. 26 """Display a usage message and exit.
26 27
27 rcode is the return code passed back to the calling process. 28 rcode is the return code passed back to the calling process.
28 """ 29 """
29 global progName 30 global progName
43 global pyModDir 44 global pyModDir
44 45
45 pyModDir = distutils.sysconfig.get_python_lib(True) 46 pyModDir = distutils.sysconfig.get_python_lib(True)
46 47
47 48
48 def wrapperName(dname,wfile): 49 def wrapperName(dname, wfile):
49 """Create the platform specific name for the wrapper script. 50 """Create the platform specific name for the wrapper script.
50 """ 51 """
51 if sys.platform.startswith("win"): 52 if sys.platform.startswith("win"):
52 wname = dname + "\\" + wfile + ".bat" 53 wname = dname + "\\" + wfile + ".bat"
53 else: 54 else:
62 """ 63 """
63 global pyModDir 64 global pyModDir
64 65
65 # Remove the menu entry for Linux systems 66 # Remove the menu entry for Linux systems
66 if sys.platform.startswith("linux"): 67 if sys.platform.startswith("linux"):
67 for name in ["/usr/share/pixmaps/eric.png", 68 for name in ["/usr/share/pixmaps/eric.png",
68 "/usr/share/applications/eric5.desktop"]: 69 "/usr/share/applications/eric5.desktop"]:
69 if os.path.exists(name): 70 if os.path.exists(name):
70 os.remove(name) 71 os.remove(name)
71 72
72 # Remove the wrapper scripts 73 # Remove the wrapper scripts
73 rem_wnames = [ 74 rem_wnames = [
74 "eric5-api", "eric5-compare", 75 "eric5-api", "eric5-compare",
75 "eric5-configure", "eric5-diff", 76 "eric5-configure", "eric5-diff",
76 "eric5-doc", 77 "eric5-doc",
77 "eric5-qregexp", "eric5-re", 78 "eric5-qregexp", "eric5-re",
78 "eric5-trpreviewer", "eric5-uipreviewer", 79 "eric5-trpreviewer", "eric5-uipreviewer",
79 "eric5-unittest", "eric5", 80 "eric5-unittest", "eric5",
80 "eric5-tray", "eric5-editor", 81 "eric5-tray", "eric5-editor",
81 "eric5-plugininstall", "eric5-pluginuninstall", 82 "eric5-plugininstall", "eric5-pluginuninstall",
82 "eric5-pluginrepository", "eric5-sqlbrowser", 83 "eric5-pluginrepository", "eric5-sqlbrowser",
83 "eric5-webbrowser", "eric5-iconeditor", 84 "eric5-webbrowser", "eric5-iconeditor",
84 "eric5_api", "eric5_compare", 85 "eric5_api", "eric5_compare",
85 "eric5_configure", "eric5_diff", 86 "eric5_configure", "eric5_diff",
86 "eric5_doc", 87 "eric5_doc",
87 "eric5_qregexp", "eric5_re", 88 "eric5_qregexp", "eric5_re",
88 "eric5_trpreviewer", "eric5_uipreviewer", 89 "eric5_trpreviewer", "eric5_uipreviewer",
89 "eric5_unittest", "eric5", 90 "eric5_unittest", "eric5",
90 "eric5_tray", "eric5_editor", 91 "eric5_tray", "eric5_editor",
91 "eric5_plugininstall", "eric5_pluginuninstall", 92 "eric5_plugininstall", "eric5_pluginuninstall",
92 "eric5_pluginrepository", "eric5_sqlbrowser", 93 "eric5_pluginrepository", "eric5_sqlbrowser",
93 "eric5_webbrowser", "eric5_iconeditor", 94 "eric5_webbrowser", "eric5_iconeditor",
94 ] 95 ]
95 for rem_wname in rem_wnames: 96 for rem_wname in rem_wnames:
96 rwname = wrapperName(getConfig('bindir'),rem_wname) 97 rwname = wrapperName(getConfig('bindir'), rem_wname)
97 if os.path.exists(rwname): 98 if os.path.exists(rwname):
98 os.remove(rwname) 99 os.remove(rwname)
99 100
100 # Cleanup our config file(s) 101 # Cleanup our config file(s)
101 for name in ['eric5config.py', 'eric5config.pyc', 'eric5.pth']: 102 for name in ['eric5config.py', 'eric5config.pyc', 'eric5.pth']:
121 for name in getConfig('apis'): 122 for name in getConfig('apis'):
122 apiname = os.path.join(apidir, name) 123 apiname = os.path.join(apidir, name)
123 if os.path.exists(apiname): 124 if os.path.exists(apiname):
124 os.remove(apiname) 125 os.remove(apiname)
125 126
127
126 def main(argv): 128 def main(argv):
127 """The main function of the script. 129 """The main function of the script.
128 130
129 argv is the list of command line arguments. 131 argv is the list of command line arguments.
130 """ 132 """
135 # Parse the command line. 137 # Parse the command line.
136 global progName 138 global progName
137 progName = os.path.basename(argv[0]) 139 progName = os.path.basename(argv[0])
138 140
139 try: 141 try:
140 optlist, args = getopt.getopt(argv[1:],"h") 142 optlist, args = getopt.getopt(argv[1:], "h")
141 except getopt.GetoptError: 143 except getopt.GetoptError:
142 usage() 144 usage()
143 145
144 global platBinDir 146 global platBinDir
145 147

eric ide

mercurial