# Path: mod/log.py
# RED = '\033[1;31m'
# GREEN = '\033[1;32m'
# YELLOW = '\033[1;33m'
# BLUE = '\033[1;36m'
# DEF = '\033[0;0m'
# def error(msg, fatal=True) :
# def warn(msg) :
# def ok(item, status) :
# def failed(item, status) :
# def optional(item, status) :
# def info(msg) :
# def colored(color, msg) :


import os.path
import sys
import platform
import multiprocessing
import yaml
from mod import log
    from mod import settings
    from mod import settings
        log.error("'{}' is not a valid project directory".format(proj_dir))

#-------------------------------------------------------------------------------
def is_git_url(url) :
    """check if 'url' is a valid git url

    :param url:     url string
    :returns:       True if a valid url
    """
    # we simply check whether the 'naked' url ends with '.git'
    url = get_giturl_from_url(url)
    return url[-4:] == '.git'

#-------------------------------------------------------------------------------
def confirm(question) :
    """ask user to confirm (y/N)

    :param question:    the question to confirm
    :return:            True: user pressed 'y', False: user pressed 'n'
    """
    validAnswers={'': False, 'yes': True, 'ye': True, 'y': True, 'no': False, 'n': False }
    while True :
        sys.stdout.write(question + ' [y/N]: ')
        if sys.version_info[0] >= 3:
            choice = str(input()).lower()
        else:
            choice = raw_input().lower()
        if choice in validAnswers :
            return validAnswers[choice]
        else :

# Path: mod/log.py
# RED = '\033[1;31m'
# GREEN = '\033[1;32m'
# YELLOW = '\033[1;33m'
# BLUE = '\033[1;36m'
# DEF = '\033[0;0m'
# def error(msg, fatal=True) :
# def warn(msg) :
# def ok(item, status) :
# def failed(item, status) :
# def optional(item, status) :
# def info(msg) :
# def colored(color, msg) :


# Path: mod/util.py
import os.path
import sys
import platform
import multiprocessing
import yaml
from mod import log
    from mod import settings
    from mod import settings

        log.error("'{}' is not a valid project directory".format(proj_dir))

#-------------------------------------------------------------------------------
def is_git_url(url) :
    """check if 'url' is a valid git url

    :param url:     url string
    :returns:       True if a valid url
    """
    # we simply check whether the 'naked' url ends with '.git'
    url = get_giturl_from_url(url)
    return url[-4:] == '.git'

#-------------------------------------------------------------------------------
def confirm(question) :
    """ask user to confirm (y/N)

    :param question:    the question to confirm
    :return:            True: user pressed 'y', False: user pressed 'n'
    """
    validAnswers={'': False, 'yes': True, 'ye': True, 'y': True, 'no': False, 'n': False }
    while True :
        sys.stdout.write(question + ' [y/N]: ')
        if sys.version_info[0] >= 3:
            choice = str(input()).lower()
        else:
            choice = raw_input().lower()
        if choice in validAnswers :
            return validAnswers[choice]
        else :

            log.info("please respond with 'y', 'yes', 'n' or 'no'")