diff --git a/refit/src/modules/refit_create.py b/refit/src/modules/refit_create.py index fb1f408..440dedd 100644 --- a/refit/src/modules/refit_create.py +++ b/refit/src/modules/refit_create.py @@ -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):