install.py

changeset 2634
8bd79dfb48a5
parent 2618
bc7339209500
child 2677
3d4277929fb3
child 2690
8ca13f15e1f2
equal deleted inserted replaced
2633:3231fa5bcb25 2634:8bd79dfb48a5
1084 os.remove(configName) 1084 os.remove(configName)
1085 except EnvironmentError: 1085 except EnvironmentError:
1086 pass 1086 pass
1087 1087
1088 # cleanup old installation 1088 # cleanup old installation
1089 print("Cleaning up old installation ...")
1089 try: 1090 try:
1090 if doCleanup: 1091 if doCleanup:
1091 if distDir: 1092 if distDir:
1092 shutil.rmtree(distDir, True) 1093 shutil.rmtree(distDir, True)
1093 else: 1094 else:
1095 except (IOError, OSError) as msg: 1096 except (IOError, OSError) as msg:
1096 sys.stderr.write('Error: {0}\nTry install as root.\n'.format(msg)) 1097 sys.stderr.write('Error: {0}\nTry install as root.\n'.format(msg))
1097 exit(7) 1098 exit(7)
1098 1099
1099 # Create a config file and delete the default one 1100 # Create a config file and delete the default one
1101 print("\nCreating configuration file ...")
1100 createConfig() 1102 createConfig()
1101 1103
1102 # Compile .ui files 1104 # Compile .ui files
1103 print("Compiling user interface files...") 1105 print("\nCompiling user interface files ...")
1104 # step 1: remove old Ui_*.py files 1106 # step 1: remove old Ui_*.py files
1105 for root, _, files in os.walk(sourceDir): 1107 for root, _, files in os.walk(sourceDir):
1106 for file in [f for f in files if fnmatch.fnmatch(f, 'Ui_*.py')]: 1108 for file in [f for f in files if fnmatch.fnmatch(f, 'Ui_*.py')]:
1107 os.remove(os.path.join(root, file)) 1109 os.remove(os.path.join(root, file))
1108 # step 2: compile the forms 1110 # step 2: compile the forms
1109 compileUiFiles() 1111 compileUiFiles()
1110 1112
1111 if doCompile: 1113 if doCompile:
1112 print("\nCompiling source files...") 1114 print("\nCompiling source files ...")
1113 if distDir: 1115 if distDir:
1114 compileall.compile_dir(sourceDir, 1116 compileall.compile_dir(sourceDir,
1115 ddir=os.path.join(distDir, modDir, cfg['ericDir']), 1117 ddir=os.path.join(distDir, modDir, cfg['ericDir']),
1116 rx=re.compile(r"DebugClients[\\/]Python[\\/]|UtilitiesPython2[\\/]"), 1118 rx=re.compile(r"DebugClients[\\/]Python[\\/]|UtilitiesPython2[\\/]"),
1117 quiet=True) 1119 quiet=True)

eric ide

mercurial