decider WIP

This commit is contained in:
2025-10-01 08:06:26 +02:00
parent efcec653cb
commit caff94ab41
3 changed files with 27 additions and 21 deletions

View File

@@ -1,3 +1,4 @@
from logging import log
import os
from pathlib import Path
import sys
@@ -28,25 +29,25 @@ class Refit_Create:
self.recursive = args.recursive
self.args = args
def create_input_valid(self, args):
"""Checks if the input is argument for its existence. If no input
argument with a value is passed, the current directory is used and
passed to the input"""
# def create_input_valid(self, args):
# """Checks if the input is argument for its existence. If no input
# argument with a value is passed, the current directory is used and
# passed to the input"""
logger.debug(f"Start create_input_valid() value= {self.input}")
logger.debug(f"FUNC: create_input_valid() MSG: arguments: {args}")
if self.input is None:
input = "."
self.input = input
logger.info(
f"FUNC: create_input_valid MSG: Usingsing current directory as input. value={self.input} "
)
return self.input
else:
logger.debug(
f"FUNC: create_input_valid() MSG: Exit with valid input. value= {self.input}"
)
return True
# logger.debug(f"Start create_input_valid() value= {self.input}")
# logger.debug(f"FUNC: create_input_valid() MSG: arguments: {args}")
# if self.input is None:
# input = "."
# self.input = input
# logger.info(
# f"FUNC: create_input_valid MSG: Usingsing current directory as input. value={self.input} "
# )
# return self.input
# else:
# logger.debug(
# f"FUNC: create_input_valid() MSG: Exit with valid input. value= {self.input}"
# )
# return True
def create_n_folders(self, n, input, name):
"""Creates an set ammount of folders. Using the default directory
@@ -134,11 +135,14 @@ class Refit_Create:
if self.filemode:
logger.debug("DECISION if filemode")
self.create_n_files(self.n, self.input, self.name)
elif self.n is not None:
elif self.n is not None and self.recursive is False:
logger.debug(
f"DIR-MODE | ARGS: n={self.n} input={self.input} name={self.name}"
f"FUNC: {self.rf_create_decider.__name__} DIR-MODE | ARGS: n={self.n} input={self.input} name={self.name}"
)
self.create_n_folders(self.n, self.input, self.name)
elif self.recursive:
logger.error("EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE")
logger.debug(f"FUNC: {self.rf_create_decider.__name__}")
else:
logger.debug(f"FUNC: rf_create_decider() MSG: given arguments: {self.args}")
print(