def moveFiles(_src, _dst):
    for src_dir, dirs, files in os.walk(_src):
        dst_dir = src_dir.replace(_src, _dst, 1)
        if not os.path.exists(dst_dir):
            # print dst_dir
            os.mkdir(dst_dir)
        for file_ in files:
            src_file = os.path.join(src_dir, file_)
            dst_file = os.path.join(dst_dir, file_)
            if os.path.exists(dst_file):
                os.remove(dst_file)
            myshutil.move(src_file, dst_dir)
コード例 #2
0
def make_local_version():
    global SourcePath
    local_bin = TempMainPath + version + common + binFolder

    copyFiles(SourcePath + binFolder, local_bin)

    for f in os.listdir(local_bin):
        if os.path.isfile(local_bin + "\\" + f):
            if f == "iClone3DXchangePipeline.exe":
                myshutil.move(
                    local_bin + "\\" + f,
                    TempMainPath + version + pipeline + "iClone3DXchange.exe")
                print("Move " + f)
            elif f == "iClone3DXchangePro.exe":
                myshutil.move(
                    local_bin + "\\" + f,
                    TempMainPath + version + full + "iClone3DXchange.exe")
                print("Move " + f)
            elif f == "iClone3DXchangePipelineEx.exe":
                myshutil.move(
                    local_bin + "\\" + f,
                    TempMainPath + version + trial + "iClone3DXchange.exe")
                print("Move " + f)
            elif f == "iClone3DXchangeStd.exe":
                os.remove(local_bin + "\\" + f)
                print("Delete " + f)
            elif f == "3DXchangeRes.dll":
                createFolder(TempLangPath + version + common_rea + binFolder)
                myshutil.move(
                    local_bin + "\\" + f,
                    TempLangPath + version + common_rea + "Bin\\" + f)
                print("Move " + f)

    copyFiles(SourcePath + "3DX template",
              TempLangPath + version + common + "3DX template")
    copyFiles(SourcePath + "Config",
              TempLangPath + version + common + "Config")
    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. \n"
    )

    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)
    print("Copy Extra Data to local Languages. \n")