split decider and input_validator

This commit is contained in:
2025-10-02 15:12:04 +02:00
parent 3c1d881de7
commit f4f5f9bc6b

View File

@@ -101,22 +101,13 @@ class Refit_Create:
n -= 1
def input_validator(self):
logger.debug("FUNC: input_validator()")
return True
def rf_create_decider(self):
"""Coordination of the 'create' sub command"""
logger.debug("FUNC: rf_create_decider() MSG: Entered decider function")
# !!!ToDo: implement input_validator()
if self.input_validator():
logger.debug("yippie")
# if no input is provided, current directory is set to input
logger.debug(f"DEBUG HERE!: type of path is: {type(self.input)}")
"""Function, which checks if the user input is valid"""
# !!!TODO: make the function return true for the check and only continue the decider if the validation check
# passes
# Check working directory
if self.input is None:
self.input = librefit.get_current_path(self.input)
logger.debug(
f"FUNC: rf_create_decider() MSG: successfully retrievd input value: '{self.input}'"
)
logger.info("FUNC: input_validator() MSG: No directory passed to the command, continue with current directory")
# Exit the program if the -n argument is not passed
if self.n is None:
@@ -126,6 +117,17 @@ class Refit_Create:
print("Use the '-n' flag for the create command.")
sys.exit(1)
def rf_create_decider(self):
"""Coordination of the 'create' sub command"""
logger.debug("FUNC: rf_create_decider() MSG: Entered decider function")
# !!!ToDo: implement input_validator()
if self.input_validator():
logger.debug("yippie")
# Exits the program if recursive and filemode flags are set at the same time
if self.filemode:
logger.debug("DECISION filemode set, creating files instead of folders")
@@ -135,8 +137,6 @@ class Refit_Create:
logger.error("Recursive and filemode don´t work together.")
print("Recursive and filemode don´t work together.")
if self.recursive:
print("help")
if self.recursive is None:
self.create_n_folders(self.n, self.input, self.name)