modified .gitignore
This commit is contained in:
@@ -104,32 +104,38 @@ def get_standard_file_name(name) -> str:
|
||||
return standard_file_name
|
||||
|
||||
|
||||
def get_current_path(path: str) -> str:
|
||||
def get_current_path(path) -> str:
|
||||
"""Checks if the path argument is emty and applies the current directory as working path.
|
||||
|
||||
This function takes an list with strings as an input. If the input is `None` the current
|
||||
This function takes an list with strings as an input. If the input is `None` the current
|
||||
directory is taken as the working directory.
|
||||
If the path is passed, a check for its existence takes place.
|
||||
|
||||
|
||||
Args:
|
||||
path (str): _The current working directory._
|
||||
|
||||
Returns:
|
||||
str: _Returns the path of the current directory after check for existence_
|
||||
"""
|
||||
|
||||
logger.debug(f"FUNC: get_current_path() MSG: entered function with path = '{path}'")
|
||||
if path is None:
|
||||
path = "."
|
||||
logger.debug(f"FUNC: {get_current_path.__name__} MSG: Path now has the value: '{path}'")
|
||||
logger.debug(
|
||||
f"FUNC: {get_current_path.__name__} MSG: Path now has the value: '{path}'"
|
||||
)
|
||||
return path
|
||||
else:
|
||||
# Here the check for the path to exist takes place
|
||||
|
||||
|
||||
if os.path.exists(path) is True:
|
||||
logger.debug(f"FUNC: {get_current_path.__name__} MSG: Path '{path}' exists, continue....")
|
||||
logger.debug(
|
||||
f"FUNC: {get_current_path.__name__} MSG: Path '{path}' exists, continue...."
|
||||
)
|
||||
return path
|
||||
else:
|
||||
ERROR_MESSAGE = f"FUNC: {get_current_path.__name__} MSG: '{path}' is no valid path."
|
||||
logger.error(ERROR_MESSAGE)
|
||||
ERROR_MESSAGE = (
|
||||
f"FUNC: {get_current_path.__name__} MSG: '{path}' does not exist"
|
||||
)
|
||||
logger.warning(ERROR_MESSAGE)
|
||||
print(ERROR_MESSAGE)
|
||||
sys.exit(1)
|
||||
|
||||
Reference in New Issue
Block a user