diff --git a/refit/src/modules/refit_create.py b/refit/src/modules/refit_create.py index 732436b..1660d28 100644 --- a/refit/src/modules/refit_create.py +++ b/refit/src/modules/refit_create.py @@ -101,23 +101,14 @@ 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)}") - self.input = librefit.get_current_path(self.input) - logger.debug( - f"FUNC: rf_create_decider() MSG: successfully retrievd input value: '{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.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: logger.error( @@ -125,6 +116,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: @@ -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)