install.py

changeset 2420
c5a0bc75d5b6
parent 2411
aec0a8a6e548
child 2421
d3bf4def72d7
equal deleted inserted replaced
2418:9fba8b327942 2420:c5a0bc75d5b6
401 if os.path.exists("/Developer/Applications/Eric5"): 401 if os.path.exists("/Developer/Applications/Eric5"):
402 shutil.rmtree("/Developer/Applications/Eric5") 402 shutil.rmtree("/Developer/Applications/Eric5")
403 if os.path.exists("/Applications/" + macAppBundleName): 403 if os.path.exists("/Applications/" + macAppBundleName):
404 shutil.rmtree("/Applications/" + macAppBundleName) 404 shutil.rmtree("/Applications/" + macAppBundleName)
405 405
406 except IOError as msg: 406 except (IOError, OSError) as msg:
407 sys.stderr.write('IOError: {0}\nTry install with admin rights.\n'.format(msg)) 407 sys.stderr.write('IOError: {0}\nTry install with admin rights.\n'.format(msg))
408 exit(7)
409
410 except OSError as msg:
411 sys.stderr.write('OSError: {0}\nTry install with admin rights.\n'.format(msg))
412 exit(7) 408 exit(7)
413 409
414 410
415 def shutilCopy(src, dst, perm=0o644): 411 def shutilCopy(src, dst, perm=0o644):
416 """ 412 """
520 shutilCopy('{1}{0}LICENSE.GPL3'.format(os.sep, sourceDir), cfg['ericDir']) 516 shutilCopy('{1}{0}LICENSE.GPL3'.format(os.sep, sourceDir), cfg['ericDir'])
521 517
522 # create the global plugins directory 518 # create the global plugins directory
523 createGlobalPluginsDir() 519 createGlobalPluginsDir()
524 520
525 except IOError as msg: 521 except (IOError, OSError) as msg:
526 sys.stderr.write('IOError: {0}\nTry install with admin rights.\n'.format(msg)) 522 sys.stderr.write('IOError: {0}\nTry install with admin rights.\n'.format(msg))
527 return(7)
528
529 except OSError as msg:
530 sys.stderr.write('OSError: {0}\nTry install with admin rights.\n'.format(msg))
531 return(7) 523 return(7)
532 524
533 # copy some text files to the doc area 525 # copy some text files to the doc area
534 for name in ["LICENSE.GPL3", "THANKS", "changelog"]: 526 for name in ["LICENSE.GPL3", "THANKS", "changelog"]:
535 try: 527 try:
1092 if doCleanup: 1084 if doCleanup:
1093 if distDir: 1085 if distDir:
1094 shutil.rmtree(distDir, True) 1086 shutil.rmtree(distDir, True)
1095 else: 1087 else:
1096 cleanUp() 1088 cleanUp()
1097 except IOError as msg: 1089 except (IOError, OSError) as msg:
1098 sys.stderr.write('IOError: {0}\nTry install as root.\n'.format(msg)) 1090 sys.stderr.write('IOError: {0}\nTry install as root.\n'.format(msg))
1091 return(7)
1099 1092
1100 # Create a config file and delete the default one 1093 # Create a config file and delete the default one
1101 createConfig() 1094 createConfig()
1102 1095
1103 # Compile .ui files 1096 # Compile .ui files

eric ide

mercurial