Actually added file-counter

What was I doing
This commit is contained in:
Fierelier 2018-11-03 11:56:00 +01:00
parent 618263b5d4
commit 638d0b04a6

View File

@ -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)