scripts/uninstall.py

branch
eric7
changeset 9380
3d662dda80e8
parent 9361
718bc86e1c3f
child 9381
3c9192161833
equal deleted inserted replaced
9378:ac7786c2109f 9380:3d662dda80e8
129 "eric7_diff", 129 "eric7_diff",
130 "eric7_doc", 130 "eric7_doc",
131 "eric7_editor", 131 "eric7_editor",
132 "eric7_hexeditor", 132 "eric7_hexeditor",
133 "eric7_iconeditor", 133 "eric7_iconeditor",
134 "eric7_ide",
134 "eric7_plugininstall", 135 "eric7_plugininstall",
135 "eric7_pluginrepository", 136 "eric7_pluginrepository",
136 "eric7_pluginuninstall", 137 "eric7_pluginuninstall",
137 "eric7_qregularexpression", 138 "eric7_qregularexpression",
138 "eric7_re", 139 "eric7_re",
142 "eric7_testing", 143 "eric7_testing",
143 "eric7_tray", 144 "eric7_tray",
144 "eric7_trpreviewer", 145 "eric7_trpreviewer",
145 "eric7_uipreviewer", 146 "eric7_uipreviewer",
146 "eric7_virtualenv", 147 "eric7_virtualenv",
147 "eric7",
148 # obsolete scripts below 148 # obsolete scripts below
149 "eric7_unittest", 149 "eric7_unittest",
150 "eric7",
150 ] 151 ]
151 152
152 try: 153 try:
153 for rem_wname in rem_wnames: 154 for rem_wname in rem_wnames:
154 for rwname in wrapperNames(getConfig("bindir"), rem_wname): 155 for rwname in wrapperNames(getConfig("bindir"), rem_wname):
206 if os.path.exists(apiname): 207 if os.path.exists(apiname):
207 os.remove(apiname) 208 os.remove(apiname)
208 for apiname in glob.glob( 209 for apiname in glob.glob(
209 os.path.join(apidir, progLanguage, "*.bas") 210 os.path.join(apidir, progLanguage, "*.bas")
210 ) + glob.glob(os.path.join(apidir, progLanguage.lower(), "*.bas")): 211 ) + glob.glob(os.path.join(apidir, progLanguage.lower(), "*.bas")):
211 os.remove(apiname) 212 if os.path.exists(apiname):
213 os.remove(apiname)
212 214
213 # remove empty directories 215 # remove empty directories
214 with contextlib.suppress(FileNotFoundError, OSError): 216 with contextlib.suppress(FileNotFoundError, OSError):
215 os.rmdir(os.path.join(apidir, progLanguage)) 217 os.rmdir(os.path.join(apidir, progLanguage))
216 with contextlib.suppress(FileNotFoundError, OSError): 218 with contextlib.suppress(FileNotFoundError, OSError):
444 @return list of desktop link names 446 @return list of desktop link names
445 @rtype list of str 447 @rtype list of str
446 """ 448 """
447 majorVersion, minorVersion = sys.version_info[:2] 449 majorVersion, minorVersion = sys.version_info[:2]
448 linkTemplates = [ 450 linkTemplates = [
451 "eric7 IDE (Python {0}.{1}).lnk",
452 "eric7 Browser (Python {0}.{1}).lnk",
453 # obsolete entries below
449 "eric7 (Python {0}.{1}).lnk", 454 "eric7 (Python {0}.{1}).lnk",
450 "eric7 Browser (Python {0}.{1}).lnk",
451 ] 455 ]
452 456
453 return [ll.format(majorVersion, minorVersion) for ll in linkTemplates] 457 return [ll.format(majorVersion, minorVersion) for ll in linkTemplates]
454 458
455 459

eric ide

mercurial