Actually added file-counter
What was I doing
This commit is contained in:
parent
618263b5d4
commit
638d0b04a6
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user