Moved a function to this class, more fitting.
This commit is contained in:
parent
ad62200bb5
commit
46ab11847c
1 changed files with 10 additions and 0 deletions
|
@ -20,6 +20,16 @@ class Utilities:
|
||||||
except PermissionError as e:
|
except PermissionError as e:
|
||||||
print(f"Error saving setings: {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):
|
def yes_no(self, str):
|
||||||
"""Ask user y/n question"""
|
"""Ask user y/n question"""
|
||||||
while True:
|
while True:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue