def initTemp(): try: myshutil.rmtree(TempMainPath + version) myshutil.rmtree(TempMainPatchPath + version) myshutil.rmtree(TempLangPath + version) myshutil.rmtree(TempLangPatchPath + version) except: print "Didn't found folders in Temp. \n" createFolder(TempMainPath + version + common) createFolder(TempMainPath + version + pipeline) createFolder(TempMainPath + version + full) createFolder(TempMainPath + version + trial) createFolder(TempMainPatchPath + version + common) createFolder(TempMainPatchPath + version + pipeline) createFolder(TempMainPatchPath + version + full) createFolder(TempMainPatchPath + version + trial) createFolder(TempLangPath + version + common) createFolder(TempLangPath + version + common_rea) createFolder(TempLangPath + version + pipeline) createFolder(TempLangPath + version + full) createFolder(TempLangPath + version + trial) createFolder(TempLangPatchPath + version + common) createFolder(TempLangPatchPath + version + common_rea)
def copy_to_server(): try: print "delete server files" myshutil.rmtree(mainFolderPath+version) myshutil.rmtree(mainPatchFolderPath+version) myshutil.rmtree(langFolderPath+version) myshutil.rmtree(langPatchFolderPath+version) except IOError as e: print "I/O error({0}): {1}".format(e.errno, e.strerror) except: print "Unknown Error" start_to_copy(localMainPath+version,mainFolderPath+version, "copy to master") start_to_copy(localMainPatchPath+version,mainPatchFolderPath+version, "copy to master patch") start_to_copy(localLangPath+version,langFolderPath+version, "copy to lang") start_to_copy(localLangPatchPath+version,langPatchFolderPath+version, "copy to lang patch") '''
def initTemp(): try: myshutil.rmtree(localMainPath + version) myshutil.rmtree(localMainPatchPath + version) myshutil.rmtree(localLangPath + version) myshutil.rmtree(localLangPatchPath + version) except: print "not find folders" createFolder(localMainPath + version + common) createFolder(localMainPath + version + full) createFolder(localMainPath + version + trial) createFolder(localMainPatchPath + version + common) createFolder(localMainPatchPath + version + full) createFolder(localMainPatchPath + version + trial) createFolder(localLangPath + version + common) createFolder(localLangPath + version + full) createFolder(localLangPath + version + trial) createFolder(localLangPatchPath + version + common) createFolder(localLangPatchPath + version + full) createFolder(localLangPatchPath + version + trial)
def move_to_lang(): ## Main Common/Image/Program/Resource folders ## moveFiles(TempMainPath + version + "Common\\Common\\", TempLangPath + version + "Common\\Common\\") moveFiles(TempMainPath + version + "Common\\Image\\", TempLangPath + version + "Common\\Image\\") moveFiles(TempMainPath + version + "Common\\Program\\", TempLangPath + version + "Common\\Program\\") moveFiles(TempMainPath + version + "Common\\Resource\\", TempLangPath + version + "Common\\Resource\\") try: myshutil.rmtree(TempMainPath + version + "Common\\Common\\") myshutil.rmtree(TempMainPath + version + "Common\\Image\\") myshutil.rmtree(TempMainPath + version + "Common\\Program\\") myshutil.rmtree(TempMainPath + version + "Common\\Resource\\") except: None print("Move main Common/Image/Program/Resource folders to Lang.\n") copyFiles(extraDataPath + "Common\\", TempLangPath + version + "Common\\") copyFiles(extraDataPath + "Pro\\", TempLangPath + version + "Pro\\") copyFiles(extraDataPath + "Trial\\", TempLangPath + version + "Trial\\")
def copy_to_server(): try: print "delete server files" myshutil.rmtree(ServerMainPath + version) myshutil.rmtree(ServerMainPatchPath + version) myshutil.rmtree(ServerLangPath + version) myshutil.rmtree(ServerLangPatchPath + version) except IOError as e: print "I/O error({0}): {1}".format(e.errno, e.strerror) except: print "Unknown Error" start_to_copy(TempMainPath + version, ServerMainPath + version, "Copy to Neutral") start_to_copy(TempMainPatchPath + version, ServerMainPatchPath + version, "Copy to Neutral Patch") start_to_copy(TempLangPath + version, ServerLangPath + version, "Copy to Lang") start_to_copy(TempLangPatchPath + version, ServerLangPatchPath + version, "Copy to Lang Patch")
def lang_patch_content_merge(): res_folder = TempLangPatchPath + version + iCData + "Resource for PRO Trial\\iClone Template\\" template_full = TempLangPatchPath + version + iCData + "Template Full\\iClone Template\\" moveFiles(res_folder, template_full) myshutil.rmtree(res_folder) print("Merge Patch Content.")
def initTemp(): try: myshutil.rmtree(TempMainPath + version) myshutil.rmtree(TempMainPatchPath + version) myshutil.rmtree(TempLangPath + version) myshutil.rmtree(TempLangPatchPath + version) myshutil.rmtree(TempMainPath + "temp_plugin\\") myshutil.rmtree(TempLangPatchPath + "temp_plugin\\") except: print "Didn't found folders in Temp. \n" createFolder(TempMainPath + version + common) createFolder(TempMainPath + version + full) createFolder(TempMainPath + version + trial) createFolder(TempMainPath + "temp_plugin\\" + full) createFolder(TempMainPath + "temp_plugin\\" + trial) createFolder(TempMainPatchPath + version + common) createFolder(TempMainPatchPath + version + full) createFolder(TempMainPatchPath + version + trial) createFolder(TempLangPath + version + common) createFolder(TempLangPath + version + iCData) createFolder(TempLangPath + version + full) createFolder(TempLangPath + version + trial) createFolder(TempLangPath + "temp_plugin\\" + full) createFolder(TempLangPath + "temp_plugin\\" + trial) createFolder(TempLangPatchPath + version + common) createFolder(TempLangPatchPath + version + iCData)
def remove_useless_files(): file = open(plugin_list_path) for line in file: line = line.replace("\n", "") plugin_list.append(line) print "Pulg-ins Count : " + str(len(plugin_list)) ## Delete at Pro ## try: os.remove(SourceFullPath + "\\Program\\Thumb\\iClone\\QuickSave.png") except: print("No QuickSave.png in Pro") try: ## Plugin ## os.remove(SourceFullPath + "Bin64\\NeuronDataReader.dll") except: print("No NeuronDataReader.dll in Pro") ## Pro Plugin ## for p in plugin_list: try: createFolder(TempMainPath + "temp_plugin\\" + full + "\\Bin64\\Plugin\\") myshutil.copy2( SourceFullPath + "Bin64\\Plugin\\" + p + ".dll", TempMainPath + "temp_plugin\\" + full + "Bin64\\Plugin\\" + p + ".dll") createFolder(TempLangPath + "temp_plugin\\" + full + "Resource\\" + p + "\\") copyFiles( SourceFullPath + "\\Resource\\" + p + "\\", TempLangPath + "temp_plugin\\" + full + "Resource\\" + p + "\\") print "Moving Pro Pulg-in : " + p os.remove(SourceFullPath + "Bin64\\Plugin\\" + p + ".dll") myshutil.rmtree(SourceFullPath + "\\Resource\\" + p + "\\") print "Deleting Pro Pulg-in : " + p except: print "No Plug-in " + p + " in Pro" ## Delete at Trial ## try: os.remove(SourceTrialPath + "\\Program\\Thumb\\iClone\\QuickSave.png") except: print("No QuickSave.png in Trial") try: ## Plugin ## os.remove(SourceTrialPath + "Bin64\\NeuronDataReader.dll") except: print("No NeuronDataReader.dll in Trial") ## Trial Plugin ## for p in plugin_list: try: createFolder(TempMainPath + "temp_plugin\\" + trial + "\\Bin64\\Plugin\\") myshutil.copy2( SourceTrialPath + "Bin64\\Plugin\\" + p + ".dll", TempMainPath + "temp_plugin\\" + trial + "Bin64\\Plugin\\" + p + ".dll") createFolder(TempLangPath + "temp_plugin\\" + trial + "Resource\\" + p + "\\") copyFiles( SourceTrialPath + "\\Resource\\" + p + "\\", TempLangPath + "temp_plugin\\" + trial + "Resource\\" + p + "\\") print "Moving Trial Pulg-in : " + p os.remove(SourceTrialPath + "Bin64\\Plugin\\" + p + ".dll") myshutil.rmtree(SourceTrialPath + "\\Resource\\" + p + "\\") print "Deleting Trial Pulg-in : " + p except: print "No Plug-in " + p + " in Trial"
def remove_empty_folder(src, msg): path, dirs, files = os.walk(src).next() if len(files) == 0 and len(dirs) == 0: print msg myshutil.rmtree(src)
copyFiles(SourcePath + "Content", TempLangPath + version + common + "Content") copyFiles(SourcePath + "Image", TempLangPath + version + common + "Image") print("Copy 3DX template/Config/Content/Image folders to local Languages.") copyFiles(extraDataPath + "Languages\\Common\\", TempLangPath + version + common) copyFiles(extraDataPath + "Languages\\Pro\\", TempLangPath + version + full) copyFiles(extraDataPath + "Languages\\Trial\\", TempLangPath + version + trial) copyFiles(extraDataPath + "Languages\\Pipeline\\", TempLangPath + version + pipeline) copyFiles(extraDataPath + "Neutral\\Common\\", TempMainPath + version + common) # initMainInstaller() # initLangInstaller() # initTemp() # make_local_version() path, dirs, files = os.walk(TempLangPatchPath + version + common).next() if len(files) == 0 and len(dirs) == 0: print "No files in Languages/Patchs/Common. Delete it now." myshutil.rmtree(TempLangPatchPath + version + common) path, dirs, files = os.walk(TempLangPatchPath + version + common_rea).next() if len(files) == 0 and len(dirs) == 0: print "No files in Languages/Patchs/Common. Delete it now." myshutil.rmtree(TempLangPatchPath + version + common_rea)
def remove_useless_files(): file = open(plugin_list_path) for line in file: line = line.replace("\n", "") plugin_list.append(line) print "Pulg-ins Count : " + str(len(plugin_list)) try: myshutil.rmtree(SourceFullPath + "\\Program\\Assets\\Creator\\") myshutil.rmtree(SourceFullPath + "\\Program\\Default\\Atmosphere\\") myshutil.rmtree(SourceFullPath + "\\Program\\Default\\LocomotionProfile\\") os.remove(SourceFullPath + "\\Program\\Thumb\\iClone\\QuickSave.png") ## Plugin ## os.remove(SourceFullPath + "\\Bin64\\Plugin\\ICFacewareFacialMocap.dll") os.remove(SourceFullPath + "\\Bin64\\Plugin\\ICIndigoRender.dll") os.remove(SourceFullPath + "\\Bin64\\Plugin\\ICNoitomMocap.dll") os.remove(SourceFullPath + "\\Bin64\\Plugin\\ICCurveEditor.dll") os.remove(SourceFullPath + "\\Bin64\\NeuronDataReader.dll") myshutil.rmtree(SourceFullPath + "\\Resource\\ICFacewareFacialMocap\\") myshutil.rmtree(SourceFullPath + "\\Resource\\ICIndigoRender\\") myshutil.rmtree(SourceFullPath + "\\Resource\\ICNoitomMocap\\") myshutil.rmtree(SourceFullPath + "\\Resource\\ICCurveEditor\\") except: print "Already remove iC7 useless files. \n" try: myshutil.rmtree(SourceTrialPath + "\\Program\\Assets\\Creator\\") myshutil.rmtree(SourceTrialPath + "\\Program\\Default\\Atmosphere\\") myshutil.rmtree(SourceTrialPath + "\\Program\\Default\\LocomotionProfile\\") os.remove(SourceTrialPath + "\\Program\\Thumb\\iClone\\QuickSave.png") ## Plugin ## os.remove(SourceTrialPath + "\\Bin64\\Plugin\\ICFacewareFacialMocap.dll") os.remove(SourceTrialPath + "\\Bin64\\Plugin\\ICIndigoRender.dll") os.remove(SourceTrialPath + "\\Bin64\\Plugin\\ICNoitomMocap.dll") os.remove(SourceTrialPath + "\\Bin64\\Plugin\\ICCurveEditor.dll") os.remove(SourceTrialPath + "\\Bin64\\NeuronDataReader.dll") myshutil.rmtree(SourceTrialPath + "\\Resource\\ICFacewareFacialMocap\\") myshutil.rmtree(SourceTrialPath + "\\Resource\\ICIndigoRender\\") myshutil.rmtree(SourceTrialPath + "\\Resource\\ICNoitomMocap\\") myshutil.rmtree(SourceTrialPath + "\\Resource\\ICCurveEditor\\") except: print "Already remove iC7 Trial useless files. \n"
def remove_useless_files(): try: myshutil.rmtree(SourceFullPath + "\\Program\\Assets\\Creator\\") myshutil.rmtree(SourceFullPath + "\\Program\\Default\\Atmosphere\\") myshutil.rmtree(SourceFullPath + "\\Program\\Default\\LocomotionProfile\\") os.remove(SourceFullPath + "\\Program\\Thumb\\iClone\\QuickSave.png") ## Plugin ## os.remove(SourceFullPath + "\\Bin64\\Plugin\\ICFacewareFacialMocap.dll") os.remove(SourceFullPath + "\\Bin64\\Plugin\\ICIndigoRender.dll") os.remove(SourceFullPath + "\\Bin64\\Plugin\\ICNoitomMocap.dll") os.remove(SourceFullPath + "\\Bin64\\Plugin\\ICCurveEditor.dll") os.remove(SourceFullPath + "\\Bin64\\NeuronDataReader.dll") myshutil.rmtree(SourceFullPath + "\\Resource\\ICFacewareFacialMocap\\") myshutil.rmtree(SourceFullPath + "\\Resource\\ICIndigoRender\\") myshutil.rmtree(SourceFullPath + "\\Resource\\ICNoitomMocap\\") myshutil.rmtree(SourceFullPath + "\\Resource\\ICCurveEditor\\") except: print "Already remove iC7 useless files. \n" try: myshutil.rmtree(SourceTrialPath + "\\Program\\Assets\\Creator\\") myshutil.rmtree(SourceTrialPath + "\\Program\\Default\\Atmosphere\\") myshutil.rmtree(SourceTrialPath + "\\Program\\Default\\LocomotionProfile\\") os.remove(SourceTrialPath + "\\Program\\Thumb\\iClone\\QuickSave.png") ## Plugin ## os.remove(SourceTrialPath + "\\Bin64\\Plugin\\ICFacewareFacialMocap.dll") os.remove(SourceTrialPath + "\\Bin64\\Plugin\\ICIndigoRender.dll") os.remove(SourceTrialPath + "\\Bin64\\Plugin\\ICNoitomMocap.dll") os.remove(SourceTrialPath + "\\Bin64\\Plugin\\ICCurveEditor.dll") os.remove(SourceTrialPath + "\\Bin64\\NeuronDataReader.dll") myshutil.rmtree(SourceTrialPath + "\\Resource\\ICFacewareFacialMocap\\") myshutil.rmtree(SourceTrialPath + "\\Resource\\ICIndigoRender\\") myshutil.rmtree(SourceTrialPath + "\\Resource\\ICNoitomMocap\\") myshutil.rmtree(SourceTrialPath + "\\Resource\\ICCurveEditor\\") except: print "Already remove iC7 Trial useless files. \n"