install.py

branch
5_3_x
changeset 2635
76edcbd56632
parent 2611
dd77cc80e343
child 2638
11b930473425
equal deleted inserted replaced
2631:06f866e83d3a 2635:76edcbd56632
1089 os.remove(configName) 1089 os.remove(configName)
1090 except EnvironmentError: 1090 except EnvironmentError:
1091 pass 1091 pass
1092 1092
1093 # cleanup old installation 1093 # cleanup old installation
1094 print("Cleaning up old installation ...")
1094 try: 1095 try:
1095 if doCleanup: 1096 if doCleanup:
1096 if distDir: 1097 if distDir:
1097 shutil.rmtree(distDir, True) 1098 shutil.rmtree(distDir, True)
1098 else: 1099 else:
1100 except (IOError, OSError) as msg: 1101 except (IOError, OSError) as msg:
1101 sys.stderr.write('Error: {0}\nTry install as root.\n'.format(msg)) 1102 sys.stderr.write('Error: {0}\nTry install as root.\n'.format(msg))
1102 exit(7) 1103 exit(7)
1103 1104
1104 # Create a config file and delete the default one 1105 # Create a config file and delete the default one
1106 print("\nCreating configuration file ...")
1105 createConfig() 1107 createConfig()
1106 1108
1107 # Compile .ui files 1109 # Compile .ui files
1108 print("Compiling user interface files...") 1110 print("\nCompiling user interface files ...")
1109 # step 1: remove old Ui_*.py files 1111 # step 1: remove old Ui_*.py files
1110 for root, _, files in os.walk(sourceDir): 1112 for root, _, files in os.walk(sourceDir):
1111 for file in [f for f in files if fnmatch.fnmatch(f, 'Ui_*.py')]: 1113 for file in [f for f in files if fnmatch.fnmatch(f, 'Ui_*.py')]:
1112 os.remove(os.path.join(root, file)) 1114 os.remove(os.path.join(root, file))
1113 # step 2: compile the forms 1115 # step 2: compile the forms
1114 compileUiFiles() 1116 compileUiFiles()
1115 1117
1116 if doCompile: 1118 if doCompile:
1117 print("\nCompiling source files...") 1119 print("\nCompiling source files ...")
1118 if distDir: 1120 if distDir:
1119 compileall.compile_dir(sourceDir, 1121 compileall.compile_dir(sourceDir,
1120 ddir=os.path.join(distDir, modDir, cfg['ericDir']), 1122 ddir=os.path.join(distDir, modDir, cfg['ericDir']),
1121 rx=re.compile(r"DebugClients[\\/]Python[\\/]|UtilitiesPython2[\\/]"), 1123 rx=re.compile(r"DebugClients[\\/]Python[\\/]|UtilitiesPython2[\\/]"),
1122 quiet=True) 1124 quiet=True)

eric ide

mercurial