added comments to file creation function

This commit is contained in:
2025-09-30 07:59:02 +02:00
parent 927d5358f5
commit 49e16a522c

View File

@@ -90,27 +90,30 @@ class Refit_Create:
f"FUNC: create_n_files() MSG: Entered function VALUES: n={self.n} name={self.name} input={self.input}"
)
# Get name of the file
# Get the name from the input argument.
file_name = librefit.get_standard_file_name(name)
# Get the length of the entered number to fill it with 0
length_n = len(str(n))
logger.debug(
f"FUNC: create_n_files() MSG: file name='{file_name}' length_n={length_n}"
)
while n > 0:
# Get number of the file(s) to create
file_number = str(n - 1)
number_string = librefit.get_standard_name_number(file_number, length_n)
# Get the name of the file, either applying default or using first list item.
temp_name = f"{file_name}_{number_string}"
file_path = Path(os.path.join(input, temp_name))
file_path.touch(exist_ok=True)
file_path = Path(os.path.join(input, temp_name)) # Build file path
file_path.touch(exist_ok=True) # creating file
logger.debug(
f"FUNC: create_n_files MSG: created file at {os.path.join(input, temp_name)}"
)
# Counting down n for the next ieration of the while-loop
n -= 1
def rf_create_decider(self):