Moved a function to this class, more fitting.

This commit is contained in:
Mr Finchum 2025-01-02 15:11:31 +01:00
parent ad62200bb5
commit 46ab11847c

View file

@ -20,6 +20,16 @@ class Utilities:
except PermissionError as e:
print(f"Error saving setings: {e}")
def append_number_to_name(self, base_name: str, current_image: int, total_images: int, invert: bool):
""""Returns name, combination of base_name and ending number."""
total_digits = len(str(total_images))
if invert:
ending_number = total_images - (current_image - 1)
else:
ending_number = current_image
ending = f"{ending_number:0{total_digits}}"
return f"{base_name}_{ending}"
def yes_no(self, str):
"""Ask user y/n question"""
while True: