diff --git a/UniversalModloader.py b/UniversalModloader.py index 9a3f82a..1cf89b8 100644 --- a/UniversalModloader.py +++ b/UniversalModloader.py @@ -170,6 +170,18 @@ def areModsLoaded(): return False def cloneFolder(src,dst,rpl,ignoreMods = True, isMod = False): + maxCount = 0 + count = 0 + + for root,dirs,files in os.walk(src): + newRoot = root.replace(src,dst) + if ignoreMods == True: + if root.replace(modPath,"") != root: continue + + maxCount = maxCount + len(files) + sys.stdout.write("\r" +str(count)+ "/" +str(maxCount)) + sys.stdout.flush() + for root,dirs,files in os.walk(src): newRoot = root.replace(src,dst) if ignoreMods == True: @@ -178,6 +190,10 @@ def cloneFolder(src,dst,rpl,ignoreMods = True, isMod = False): if os.path.isdir(newRoot) == False: os.makedirs(newRoot) for file in files: + count = count + 1 + sys.stdout.write("\r" +str(count)+ "/" +str(maxCount)) + sys.stdout.flush() + if isMod == True: if file[:4] == "uml_": continue fullFile = os.path.join(root,file) @@ -189,6 +205,8 @@ def cloneFolder(src,dst,rpl,ignoreMods = True, isMod = False): os.link(fullFile,newFile) else: os.link(fullFile,newFile) + + print("") def claimFolder(path): os.chmod(path, stat.S_IRWXU| stat.S_IRWXG| stat.S_IRWXO)