uninstall.py

changeset 5068
3a5e58eeb64a
parent 5055
7db1b9496e52
child 5389
9b1c800daff3
equal deleted inserted replaced
5067:e2f171f08af8 5068:3a5e58eeb64a
19 import distutils.sysconfig 19 import distutils.sysconfig
20 20
21 if sys.version_info[0] == 2: 21 if sys.version_info[0] == 2:
22 import sip 22 import sip
23 sip.setapi('QString', 2) 23 sip.setapi('QString', 2)
24 else:
25 raw_input = input
24 26
25 # get a local eric6config.py out of the way 27 # get a local eric6config.py out of the way
26 if os.path.exists("eric6config.py"): 28 if os.path.exists("eric6config.py"):
27 os.rename("eric6config.py", "eric6config.py.orig") 29 os.rename("eric6config.py", "eric6config.py.orig")
28 from eric6config import getConfig 30 from eric6config import getConfig
249 print("Found these plug-in directories") 251 print("Found these plug-in directories")
250 for path in pathsToRemove: 252 for path in pathsToRemove:
251 print(" - {0}".format(path)) 253 print(" - {0}".format(path))
252 answer = "c" 254 answer = "c"
253 while answer not in ["y", "Y", "n", "N", ""]: 255 while answer not in ["y", "Y", "n", "N", ""]:
254 if sys.version_info[0] == 2: 256 answer = raw_input(
255 answer = raw_input( 257 "Shall these directories be removed (y/N)? ")
256 "Shall these directories be removed (y/N)? ")
257 else:
258 answer = input(
259 "Shall these directories be removed (y/N)? ")
260 if answer in ["y", "Y"]: 258 if answer in ["y", "Y"]:
261 for path in pathsToRemove: 259 for path in pathsToRemove:
262 shutil.rmtree(path) 260 shutil.rmtree(path)
263 261
264 262
270 if os.path.exists(cfg): 268 if os.path.exists(cfg):
271 print("Found the eric data directory") 269 print("Found the eric data directory")
272 print(" - {0}".format(cfg)) 270 print(" - {0}".format(cfg))
273 answer = "c" 271 answer = "c"
274 while answer not in ["y", "Y", "n", "N", ""]: 272 while answer not in ["y", "Y", "n", "N", ""]:
275 if sys.version_info[0] == 2: 273 answer = raw_input(
276 answer = raw_input( 274 "Shall this directory be removed (y/N)? ")
277 "Shall this directory be removed (y/N)? ")
278 else:
279 answer = input(
280 "Shall this directory be removed (y/N)? ")
281 if answer in ["y", "Y"]: 275 if answer in ["y", "Y"]:
282 shutil.rmtree(cfg) 276 shutil.rmtree(cfg)
283 277
284 278
285 def removeConfigurationData(): 279 def removeConfigurationData():
302 if os.path.exists(settingsDir): 296 if os.path.exists(settingsDir):
303 print("Found the eric configuration directory") 297 print("Found the eric configuration directory")
304 print(" - {0}".format(settingsDir)) 298 print(" - {0}".format(settingsDir))
305 answer = "c" 299 answer = "c"
306 while answer not in ["y", "Y", "n", "N", ""]: 300 while answer not in ["y", "Y", "n", "N", ""]:
307 if sys.version_info[0] == 2: 301 answer = raw_input(
308 answer = raw_input( 302 "Shall this directory be removed (y/N)? ")
309 "Shall this directory be removed (y/N)? ")
310 else:
311 answer = input(
312 "Shall this directory be removed (y/N)? ")
313 if answer in ["y", "Y"]: 303 if answer in ["y", "Y"]:
314 shutil.rmtree(settingsDir) 304 shutil.rmtree(settingsDir)
315 305
316 306
317 def getConfigDir(): 307 def getConfigDir():

eric ide

mercurial