"""
Configuration file containing information about project directory tree structure
"""
import sys
import os


def path2unix(path):
    """Convert path to unix format

    Args:
        path (str): input path

    Returns:
        str: converted path
    """
    # check if input path is already in unix format
    if path[0] == '/':
        return path
    # convert slashes to forward slashes, drive letter to lower, remove colon and add slash to the start
    splits = path.split('\\')
    path = f'/{splits[0].lower().replace(":", "")}/{"/".join(s for s in splits[1:])}'
    return path


class Config:
    """Configuration object
    """
    BASE_PATH = os.path.join(os.path.dirname(os.path.realpath(__file__)), '..')
    PARENT_PATH = os.path.join(BASE_PATH, '..')
    # model directory
    MODEL_DATA_DIR = os.path.join(BASE_PATH, 'data')
    # gltf model path
    MODEL_NAME = 'avatar.gltf'
    MODEL_PATH = os.path.join(BASE_PATH, 'data', MODEL_NAME)
    # sign queue length -> max amount of requests in a queue
    SIGN_QUEUE_SIZE = 20
    # lowest sign probability of animation request
    SIGN_PROB_THOLD = 0.2


CFG = Config()
