install.py

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

eric ide

mercurial