fixes?
This commit is contained in:
@@ -422,8 +422,11 @@ def main():
|
||||
while new_path.exists():
|
||||
new_path = old_path.with_name(f"{stem}_{counter}{old_path.suffix}")
|
||||
counter += 1
|
||||
old_path.rename(new_path)
|
||||
renamed += 1
|
||||
try:
|
||||
old_path.rename(new_path)
|
||||
renamed += 1
|
||||
except FileNotFoundError:
|
||||
print(f" SKIPPED (not found): {old_path.name}")
|
||||
print(f" Renamed {renamed} file(s).")
|
||||
else:
|
||||
renamed = 0
|
||||
@@ -487,7 +490,10 @@ def main():
|
||||
while np.exists():
|
||||
np = p.with_name(f"{stem}_{counter}{p.suffix}")
|
||||
counter += 1
|
||||
p.rename(np)
|
||||
try:
|
||||
p.rename(np)
|
||||
except FileNotFoundError:
|
||||
print(f" SKIPPED (not found): {p.name}")
|
||||
renamed += len(items) - i
|
||||
break
|
||||
else:
|
||||
@@ -505,8 +511,11 @@ def main():
|
||||
new_path = old_path.with_name(f"{stem}_{counter}{old_path.suffix}")
|
||||
counter += 1
|
||||
print(f" (file existed, saved as {new_path.name})")
|
||||
old_path.rename(new_path)
|
||||
renamed += 1
|
||||
try:
|
||||
old_path.rename(new_path)
|
||||
renamed += 1
|
||||
except FileNotFoundError:
|
||||
print(f" SKIPPED (not found): {old_path.name}")
|
||||
i += 1
|
||||
|
||||
print(f"\n Renamed: {renamed} Skipped: {skipped}")
|
||||
|
||||
Reference in New Issue
Block a user