modified .gitignore

This commit is contained in:
2025-10-01 22:20:23 +02:00
parent 461533b717
commit 691b68cb4c
5 changed files with 61 additions and 57 deletions

View File

@@ -1,3 +1,4 @@
from logging import log
import os
from pathlib import Path
import sys
@@ -20,33 +21,13 @@ class Refit_Create:
def __init__(self, args):
"""Initiating variables for creation"""
self.args = args
self.name = args.name
self.input = args.input
self.n = args.n
self.filemode = args.filemode
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"""
# 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
@@ -119,39 +100,54 @@ class Refit_Create:
# Counting down n for the next ieration of the while-loop
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)
print(self.input)
# if self.input is None:
# self.input = "."
# logger.info(
# f"FUNC: rf_create_decider() MSG: Usingsing current directory as input. value={self.input} "
# )
logger.debug(
f"FUNC: rf_create_decider() MSG: successfully retrievd input value: '{self.input}'"
)
# Exit the program if the -n argument is not passed
if self.n is None:
logger.error(
f"FUNC rf_create_decider() MSG: the number value cannot be '{self.n}'"
)
print("Use the '-n' flag for the create command.")
sys.exit(1)
# if self.filemode:
# logger.debug("DECISION if filemode")
# self.create_n_files(self.n, self.input, self.name)
# if self.recursive is False:
# logger.debug(
# f"FUNC: {self.rf_create_decider.__name__} DIR-MODE | ARGS: n={self.n} input={self.input} name={self.name}"
# )
# if self.n is not None: self.create_n_folders(self.n, self.input, self.name)
# else:
# ERROR_MESSAGE="Please input the number on how many objects you want to create"
# else:
# logger.debug(f"FUNC: rf_create_decider() MSG: given arguments: {self.args}")
# print(
# "Use '-n' argument to create directories.\nPlease use 'refit create -h' for help"
# )
# sys.exit(1)
# 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")
if self.recursive is None:
self.create_n_files(self.n, self.input, self.name)
else:
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)
else:
logger.debug(
f"FUNC: rf_create_decider(end) MSG: given arguments: {self.args}"
)
print(
"Use '-n' argument to create directories.\nPlease use 'refit create -h' for help"
)
sys.exit(1)
def __call__(self):
"""Gets called when the 'create' subcommand is used."""