added TODO comments

This commit is contained in:
2025-10-02 15:40:36 +02:00
parent f4f5f9bc6b
commit e8ef3c6e53
3 changed files with 31 additions and 13 deletions

View File

@@ -3,6 +3,9 @@ import sys
from .refit_logger import logger
# TODO: Make a standard function for reading config files, so it is
# reusable
def get_standard_name_number(current_number: str, number_str_length: int) -> str:
"""Returns a number string filled to the length of the input number
@@ -117,9 +120,16 @@ def get_current_path(path) -> str:
Returns:
str: _Returns the path of the current directory after check for existence_
"""
# TODO: write test for the current path function, test for:
# - None
# - for existing path
# - for non existing path
# NOTE: research how to check for paths in test functions...
logger.debug(f"FUNC: get_current_path() MSG: entered function with path = '{path}'")
if path is None:
# Set the current directory if none is passed with the command.
path = "."
logger.warning(
@@ -127,7 +137,6 @@ def get_current_path(path) -> str:
)
return path
else:
# Checks if the path, entered by the user, exists.
if os.path.exists(path) is True:
logger.debug(

View File

@@ -1,4 +1,3 @@
from logging import log
import os
from pathlib import Path
import sys
@@ -102,13 +101,17 @@ class Refit_Create:
def input_validator(self):
"""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
# NOTE: find a way on how to return 'True' when the user input
# is valid
# 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")
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(
@@ -116,18 +119,16 @@ 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()
# WARNING: implement the input validator and only continue with
# the decider if the validator returns true
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")
@@ -137,7 +138,6 @@ class Refit_Create:
logger.error("Recursive and filemode don´t work together.")
print("Recursive and filemode don´t work together.")
if self.recursive is None:
self.create_n_folders(self.n, self.input, self.name)
else: